xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Public Attributes | Public Member Functions | Protected Member Functions | List of all members
xtd::forms::exception_dialog Class Referencefinal

#include <exception_dialog.h>

Definition

Represents a common dialog box that displays exception dialog.

Namespace
xtd::forms
Library
xtd.forms
Examples
The following code example demonstrate the use of exception_dialog dialog.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
text("Exception dialog example");
controls().push_back(button1);
button1.location({10, 10});
button1.auto_size(true);
button1.text("Exception...");
button1.click += [&] {
try{
throw invalid_operation_exception("Throws an invalid operation exception to show an exception dialog.", current_stack_frame_);
} catch(const xtd::system_exception& e) {
dialog.exception(e);
}
};
}
private:
};
int main() {
application::run(form1());
}
Examples:
exception_dialog.cpp.

Public Attributes

event< exception_dialog, dialog_closed_event_handlerdialog_closed
 Occurs when the user close an exception dialog box with dialog close button or other dialog buttons. More...
 

Public Member Functions

 exception_dialog ()=default
 Initializes a new instance of the exception_dialog class. More...
 
xtd::forms::dialog_result dialog_result () const
 Get async dialog_result result after dialog box is closing. More...
 
xtd::forms::dialog_style dialog_style () const
 Gets the dialog style. More...
 
exception_dialogdialog_style (xtd::forms::dialog_style dialog_style)
 Sets the dialog style. More...
 
std::reference_wrapper< const std::exception > exception () const
 Gets exception reference. More...
 
exception_dialogexception (const std::exception &exception)
 Sets exception. More...
 
void reset ()
 Resets all properties to empty string. More...
 
xtd::forms::dialog_result show_dialog ()
 Runs exception dialog box. More...
 
xtd::forms::dialog_result show_dialog (const iwin32_window &owner)
 Runs exception dialog box. More...
 
void show_sheet (const iwin32_window &owner)
 Runs exception dialog box. More...
 
xtd::forms::dialog_result show_sheet_dialog (const iwin32_window &owner)
 Runs exception dialog box. More...
 
xtd::ustring text () const
 Gets the dialog caption text. More...
 
exception_dialogtext (const xtd::ustring &text)
 Sets the dialog caption text. More...
 
- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object. More...
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const
 Gets the type of the current instance. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a std::string that represents the current object. More...
 

Protected Member Functions

void on_dialog_closed (const dialog_closed_event_args &e)
 Raises the close event. More...
 
- Protected Member Functions inherited from xtd::forms::component
 component ()=default
 Initialises a new instance of the component class. More...
 
virtual bool can_raise_events () const
 Gets a value indicating whether the component can raise an event. More...
 
bool design_mode () const
 Gets a value that indicates whether the component is currently in design mode. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from xtd::object
static bool equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are considered equal. More...
 
static bool reference_equals (const object &object_a, const object &object_b) noexcept
 Determines whether the specified object instances are the same instance. More...
 

Constructor & Destructor Documentation

◆ exception_dialog()

xtd::forms::exception_dialog::exception_dialog ( )
default

Initializes a new instance of the exception_dialog class.

Member Function Documentation

◆ dialog_result()

xtd::forms::dialog_result xtd::forms::exception_dialog::dialog_result ( ) const
inline

Get async dialog_result result after dialog box is closing.

Returns
ok if the user clicks OK in the dialog box; otherwise, cancel.

◆ dialog_style() [1/2]

xtd::forms::dialog_style xtd::forms::exception_dialog::dialog_style ( ) const
inline

Gets the dialog style.

Returns
One of the xtd::forms::dialog_style values. The default value is xtd::forms::dialog_style::standard.

◆ dialog_style() [2/2]

exception_dialog& xtd::forms::exception_dialog::dialog_style ( xtd::forms::dialog_style  dialog_style)
inline

Sets the dialog style.

Parameters
dialog_styleOne of the xtd::forms::dialog_style values. The default value is xtd::forms::dialog_style::standard.
Returns
Current exception_dialog instance.

◆ exception() [1/2]

std::reference_wrapper<const std::exception> xtd::forms::exception_dialog::exception ( ) const
inline

Gets exception reference.

Returns
A exception reference.
Examples:
exception_dialog.cpp.

◆ exception() [2/2]

exception_dialog& xtd::forms::exception_dialog::exception ( const std::exception &  exception)
inline

Sets exception.

Parameters
exceptionThe exception.
Returns
Current exception_dialog instance.
Warning
Contains only a reference on the parameter exception. Do not delete exception before closing dialog.

◆ on_dialog_closed()

void xtd::forms::exception_dialog::on_dialog_closed ( const dialog_closed_event_args e)
inlineprotected

Raises the close event.

Parameters
eAn exception_dialog_closed_event_args that provides the event data.
Remarks
This method is invoked when the exception dialog box is closed.

◆ reset()

void xtd::forms::exception_dialog::reset ( )

Resets all properties to empty string.

◆ show_dialog() [1/2]

xtd::forms::dialog_result xtd::forms::exception_dialog::show_dialog ( )

Runs exception dialog box.

◆ show_dialog() [2/2]

xtd::forms::dialog_result xtd::forms::exception_dialog::show_dialog ( const iwin32_window owner)

Runs exception dialog box.

◆ show_sheet()

void xtd::forms::exception_dialog::show_sheet ( const iwin32_window owner)

Runs exception dialog box.

Remarks
The result will done in async. Check result_dialog property after dialog box closed to obtain the result.

◆ show_sheet_dialog()

xtd::forms::dialog_result xtd::forms::exception_dialog::show_sheet_dialog ( const iwin32_window owner)

Runs exception dialog box.

Examples:
exception_dialog.cpp.

◆ text() [1/2]

xtd::ustring xtd::forms::exception_dialog::text ( ) const
inline

Gets the dialog caption text.

Returns
The current dialog caption text.

◆ text() [2/2]

exception_dialog& xtd::forms::exception_dialog::text ( const xtd::ustring text)
inline

Sets the dialog caption text.

Parameters
textThe new dialog caption text.
Returns
Current input_dialog instance.

The documentation for this class was generated from the following file: