xtd 0.2.0
Loading...
Searching...
No Matches
xtd::forms::trace_message_dialog Class Referencefinal
Inheritance diagram for xtd::forms::trace_message_dialog:
xtd::forms::component xtd::object

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  
 
 
 
 
 
Dark  
 
 
 
 
 
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 {});
}
static void run()
Begins running a standard application message loop on the current thread, without a form.
Represents a Windows button control.
Definition button.h:49
virtual drawing::point location() const noexcept
Gets the coordinates of the upper-left corner of the control relative to the upper-left corner of its...
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:54
Represents a form that displays trace form. This class cannot be inherited.
Definition trace_form.h:36
Displays a message window and write debug, which presents a debug message to the user.
Definition trace_message_dialog.h:29
xtd::string message() const noexcept
Gets the text message.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition xtd_about_box.h:12
Examples
trace_message_dialog.cpp.

Public 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.
 

Public Constructors

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

Public Properties

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

Public Methods

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

Additional Inherited Members

- Public Member Functions inherited from xtd::object
 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual size_t get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<typename object_t >
xtd::uptr< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const noexcept
 Returns a xtd::string that represents the current object.
 
- Static Public Member Functions inherited from xtd::object
template<typename object_a_t , typename object_b_t >
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<typename object_a_t , typename object_b_t >
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 
- Protected Member Functions inherited from xtd::forms::component
 component ()
 Initialises a new instance of the component class.
 
virtual bool can_raise_events () const noexcept
 Gets a value indicating whether the component can raise an event.
 
bool design_mode () const noexcept
 Gets a value that indicates whether the component is currently in design mode.
 

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::string 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::string 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: