xtd 0.2.0
xtd::forms::trace_message_dialog Class Referencefinal

Definition

Displays a message window and write debug, which presents a debug message to the user.

Header
#include <xtd/forms/trace_message_dialog>
Namespace
xtd::forms
Library
xtd.forms
Appearance
Windows macOS Gnome
Light  
dialog_trace_message_box_w.png
    html dialog_trace_message_box_m.png    html dialog_trace_message_box_g.png 
Dark  
dialog_trace_message_box_wd.png
    html dialog_trace_message_box_md.png    html dialog_trace_message_box_gd.png 
Examples
The following code example demonstrates the use of trace_message_dialog dialog.
#define TRACE
#include <xtd/forms/application>
#include <xtd/forms/button>
#include <xtd/forms/form>
#include <xtd/forms/trace_form>
#include <xtd/forms/trace_message_dialog>
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
button_show_debug_message.location({10, 10});
button_show_debug_message.parent(*this);
button_show_debug_message.text("Error...");
button_show_debug_message.auto_size(true);
button_show_debug_message.click += [&] {
auto dialog = trace_message_dialog {};
dialog.message("An unknown process error occured.");
dialog.show_sheet_dialog(*this);
};
}
private:
button button_show_debug_message;
};
auto main()->int {
auto tf = trace_form {};
application::run(form1 {});
}
Examples:
trace_message_dialog.cpp.

Constructors

 trace_message_dialog ()
 Initializes a new instance of the trace_message_dialog class. More...
 

Properties

xtd::forms::dialog_result dialog_result () const noexcept
 Gets async dialog_result result after dialog box is closing. More...
 
xtd::ustring message () const noexcept
 Gets the text message. More...
 
trace_message_dialogmessage (const xtd::ustring &message)
 Sets the text message. More...
 

Methods

void reset ()
 Resets all properties to empty string. More...
 
xtd::forms::dialog_result show_dialog ()
 Runs message dialog box. More...
 
xtd::forms::dialog_result show_dialog (const iwin32_window &owner)
 Runs message dialog box. More...
 
void show_sheet (const iwin32_window &owner)
 Runs message dialog box. More...
 
xtd::forms::dialog_result show_sheet_dialog (const iwin32_window &owner)
 Runs message dialog box. More...
 

Events

event< trace_message_dialog, dialog_closed_event_handlerdialog_closed
 Occurs when the user close a message dialog box with dialog close button or other dialog buttons. More...
 

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object. More...
 
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...
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance. More...
 
template<typename object_t >
std::unique_ptr< object_t > memberwise_clone () const noexcept
 Creates a shallow copy of the current object. More...
 
virtual xtd::ustring to_string () const noexcept
 Returns a sxd::ustring that represents the current object. More...
 
- 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...
 
- Protected Member Functions inherited from xtd::forms::component
 component ()
 Initialises a new instance of the component class. More...
 
virtual bool can_raise_events () const noexcept
 Gets a value indicating whether the component can raise an event. More...
 
bool design_mode () const noexcept
 Gets a value that indicates whether the component is currently in design mode. More...
 

Constructor & Destructor Documentation

◆ trace_message_dialog()

xtd::forms::trace_message_dialog::trace_message_dialog ( )

Initializes a new instance of the trace_message_dialog class.

Member Function Documentation

◆ dialog_result()

xtd::forms::dialog_result xtd::forms::trace_message_dialog::dialog_result ( ) const
noexcept

Gets async dialog_result result after dialog box is closing.

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

◆ message() [1/2]

xtd::ustring xtd::forms::trace_message_dialog::message ( ) const
noexcept

Gets the text message.

Returns
The text message.
Examples:
trace_message_dialog.cpp.

◆ message() [2/2]

trace_message_dialog& xtd::forms::trace_message_dialog::message ( const xtd::ustring message)
inline

Sets the text message.

Parameters
messageThe text message.
Returns
Current trace_message_dialog instance.

◆ reset()

void xtd::forms::trace_message_dialog::reset ( )

Resets all properties to empty string.

◆ show_dialog() [1/2]

xtd::forms::dialog_result xtd::forms::trace_message_dialog::show_dialog ( )
inline

Runs message dialog box.

◆ show_dialog() [2/2]

xtd::forms::dialog_result xtd::forms::trace_message_dialog::show_dialog ( const iwin32_window owner)
inline

Runs message dialog box.

◆ show_sheet()

void xtd::forms::trace_message_dialog::show_sheet ( const iwin32_window owner)
inline

Runs message dialog box.

◆ show_sheet_dialog()

xtd::forms::dialog_result xtd::forms::trace_message_dialog::show_sheet_dialog ( const iwin32_window owner)
inline

Runs message dialog box.

Member Data Documentation

◆ dialog_closed

event<trace_message_dialog, dialog_closed_event_handler> xtd::forms::trace_message_dialog::dialog_closed

Occurs when the user close a message dialog box with dialog close button or other dialog buttons.

Remarks
For more information about handling events, see Handling and Raising Events.

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