xtd 1.0.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
Remarks
To disable debug mode with CMake, add the command line add_definitions(-DNDEBUG) in your CMakeLists.txt, or define NDEBUG at the top of your file.
Note
If you define #define DEBUG above your includes, debug mode will still be active even if NDEBUG is defined.
Remarks
To activate your code if DEBUG is defined, you must enclose calls to the methods of Debug in an #if DEBUG ... #endif block.
To disable trace mode with CMake, add the command line add_definitions(-DNTRACE) in your CMakeLists.txt, or define NTRACE at the top of your file.
Note
If you define #define TRACE above your includes, trace mode will still be active even if NTRACE is defined.
Remarks
To activate your code if TRACE is defined, you must enclose calls to the methods of Debug in an #if DEBUG || TRACE ... #endif block.
Examples
The following code example demonstrates the use of trace_message_dialog dialog.
#define TRACE 1 // Force to trace even if example is builded with -DNTRACE.
#include <xtd/xtd>
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 += delegate_ {
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 {});
}
virtual auto location() const noexcept -> xtd::drawing::point
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.hpp:54
Displays a message window and write debug, which presents a debug message to the user.
Definition trace_message_dialog.hpp:36
auto message() const noexcept -> xtd::string
Gets the text message.
#define delegate_
The declaration of a delegate type is similar to a method signature. It has a return value and any nu...
Definition delegate.hpp:1018
xtd::forms::style_sheets::control button
The buttton data allows you to specify the box of a button control.
Definition button.hpp:25

Public Events

xtd::event< trace_message_dialog, xtd::forms::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

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

Public Methods

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

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
virtual auto equals (const object &obj) const noexcept -> bool
 Determines whether the specified object is equal to the current object.
virtual auto get_hash_code () const noexcept -> xtd::usize
 Serves as a hash function for a particular type.
virtual auto get_type () const noexcept -> type_object
 Gets the type of the current instance.
template<typename object_t>
auto memberwise_clone () const -> xtd::unique_ptr_object< object_t >
 Creates a shallow copy of the current object.
virtual auto to_string () const -> xtd::string
 Returns a xtd::string that represents the current object.
template<typename object_a_t, typename object_b_t>
static auto equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are considered equal.
template<typename object_a_t, typename object_b_t>
static auto reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool
 Determines whether the specified object instances are the same instance.
 component ()
 Initialises a new instance of the component class.
virtual auto can_raise_events () const noexcept -> bool
 Gets a value indicating whether the component can raise an event.
auto design_mode () const noexcept -> bool
 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()

auto xtd::forms::trace_message_dialog::dialog_result ( ) const -> xtd::forms::dialog_result
nodiscardnoexcept

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]

auto xtd::forms::trace_message_dialog::message ( ) const -> xtd::string
nodiscardnoexcept

Gets the text message.

Returns
The text message.

◆ message() [2/2]

auto xtd::forms::trace_message_dialog::message ( const xtd::string & message) -> trace_message_dialog &
inline

Sets the text message.

Parameters
messageThe text message.
Returns
Current trace_message_dialog instance.

◆ reset()

auto xtd::forms::trace_message_dialog::reset ( ) -> void

Resets all properties to empty string.

◆ show_dialog() [1/2]

auto xtd::forms::trace_message_dialog::show_dialog ( ) -> xtd::forms::dialog_result
inline

Runs message dialog box.

◆ show_dialog() [2/2]

auto xtd::forms::trace_message_dialog::show_dialog ( const xtd::forms::iwin32_window & owner) -> xtd::forms::dialog_result
inline

Runs message dialog box.

◆ show_sheet()

auto xtd::forms::trace_message_dialog::show_sheet ( const xtd::forms::iwin32_window & owner) -> void
inline

Runs message dialog box.

◆ show_sheet_dialog()

auto xtd::forms::trace_message_dialog::show_sheet_dialog ( const xtd::forms::iwin32_window & owner) -> xtd::forms::dialog_result
inline

Runs message dialog box.

Member Data Documentation

◆ dialog_closed

xtd::event<trace_message_dialog, xtd::forms::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: