xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.
xtd::forms::message_dialog Class Referencefinal

Represents a common dialog box that displays message box. More...

#include <message_dialog.h>

Inheritance diagram for xtd::forms::message_dialog:

Public Member Functions

 message_dialog ()=default
 Initializes a new instance of the message_dialog class. More...
xtd::forms::message_dialog_buttons buttons () const
message_dialogbuttons (xtd::forms::message_dialog_buttons buttons)
xtd::forms::message_dialog_default_button default_button () const
message_dialogdefault_button (xtd::forms::message_dialog_default_button default_button)
xtd::forms::dialog_style dialog_style () const
message_dialogdialog_style (xtd::forms::dialog_style dialog_style)
bool display_help_button () const
message_dialogdisplay_help_button (bool display_help_button)
xtd::forms::message_dialog_icon icon () const
message_dialogicon (xtd::forms::message_dialog_icon icon)
message_dialogmessage (const std::string &message)
 Sets the text message. More...
std::string messsage () const
 Gets the text message. More...
xtd::forms::message_dialog_options options () const
message_dialogoptions (xtd::forms::message_dialog_options options)
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...
std::string text () const
 Gets the dialog caption text. More...
message_dialogtext (const std::string &text)
 Sets the dialog caption text. More...

Public Attributes

event< message_dialog, help_event_handler< message_dialog & > > help_request
 Occurs when the user clicks the Help button on a common dialog box. More...
event< message_dialog, message_dialog_closed_event_handler< message_dialog & > > message_dialog_closed

Protected Member Functions

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

Detailed Description

Represents a common dialog box that displays message box.

The following code example demonstrate the use of message_dialog dialog.
#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
form1() {
controls().push_back_range({button_show_message, label_dialog_result});
location({400, 200});
text("Message dialog exemple");
button_show_message.location({10, 10});
button_show_message.click += [&] {
dialog.message("Hello, World!");
label_dialog_result.text(strings::format("dialog_result = {}", dialog.show_sheet_dialog(*this)));
label_dialog_result.location({10, 45});
button button_show_message;
label label_dialog_result;
int main() {

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