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.
trace_message_box.h
Go to the documentation of this file.
1 #pragma once
5 #include "application.h"
6 #include "message_box.h"
7 
8 
10 namespace xtd {
12  namespace forms {
20  public:
24 
29 
30  private:
31  static xtd::forms::dialog_result show_message_dialog(const xtd::forms::iwin32_window* owner, const xtd::ustring& text = "", const xtd::ustring& caption = "", xtd::forms::message_box_buttons buttons = xtd::forms::message_box_buttons::ok, xtd::forms::message_box_icon icon = xtd::forms::message_box_icon::none, xtd::forms::message_box_default_button default_button = xtd::forms::message_box_default_button::button1, xtd::forms::message_box_options options = static_cast<xtd::forms::message_box_options>(0), bool display_help_button = false) {
32 #if defined(TRACE)
34  message_dialog dialog;
35  dialog.buttons(buttons);
36  dialog.default_button(default_button);
37  dialog.display_help_button(display_help_button);
38  dialog.icon(icon);
39  dialog.message(text);
40  dialog.options(options);
41  dialog.text(caption);
42  return owner ? dialog.show_sheet_dialog(*owner) : dialog.show_dialog();
43 #else
45 #endif
46  }
47  };
48  }
49 }
The first button on the message box is the default button.
message_dialog_default_button
Specifies constants defining the default button on a message_box.
Definition: message_dialog_default_button.h:18
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition: dialog_result.h:39
Nothing is returned from the dialog box. This means that the modal dialog continues running...
static xtd::ustring product_name()
Gets the product name associated with this application.
Contains xtd::forms::application class.
#define static_
This keyword is use to represent a static object. A static object can&#39;t be instantiated (constructors...
Definition: static.h:38
message_dialog_icon
Specifies constants defining which information to display.
Definition: message_dialog_icon.h:18
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs message dialog box.
xtd::forms::message_dialog_icon icon() const
Gets icon to display in the message dialog.
Definition: message_dialog.h:93
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
message_dialog_options
Specifies options on a message_box.
Definition: message_dialog_options.h:20
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Displays a dialog box and write trace.
Definition: trace_message_box.h:19
message_dialog_buttons
Specifies constants defining which buttons to display on a message_box.
Definition: message_dialog_buttons.h:18
xtd::forms::message_dialog_buttons buttons() const
Gets buttons to display in the message dialog.
Definition: message_dialog.h:41
static dialog_result show(const iwin32_window &owner, const xtd::ustring &text)
Displays a message box in front of the specified window and write trace with specified text...
Definition: trace_message_box.h:28
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:19
The message box contains an OK button.
The message box contains a symbol consisting of white X in a circle with a red background.
xtd::ustring text() const
Gets the dialog caption text.
Definition: message_dialog.h:129
xtd::forms::message_dialog_options options() const
Gets options will be used for the message box.
Definition: message_dialog.h:105
Displays a message window, also known as a dialog box, which presents a message to the user...
Definition: message_dialog.h:34
xtd::forms::message_dialog_default_button default_button() const
Gets default button for the message dialog.
Definition: message_dialog.h:53
Provides a collection of button objects for use by a Windows Forms application.
Definition: buttons.h:21
The message box contain no symbols.
bool display_help_button() const
Gets a value indicate if help button is shown.
Definition: message_dialog.h:65
xtd::ustring message() const
Gets the text message.
Definition: message_dialog.h:117
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Contains xtd::forms::message_box dialog.
static xtd::forms::dialog_result show(const xtd::ustring &text)
Displays a message box and write trace with specified text.
Definition: trace_message_box.h:23
xtd::forms::dialog_result show_dialog()
Runs message dialog box.
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition: debug.h:352