xtd 0.2.0
trace_message_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "message_dialog.h"
6 
8 namespace xtd {
10  namespace forms {
27  class forms_export_ trace_message_dialog final : public component {
28  struct data;
29 
30  public:
32 
37 
39 
44 
47  xtd::ustring message() const noexcept;
52  #if defined(TRACE)
53  dialog_.message(message);
54  #endif
55  return *this;
56  }
58 
60 
63  void reset();
64 
67  #if defined(TRACE)
68  xtd::diagnostics::trace::write_line(dialog_.message());
69  return dialog_.show_dialog();
70  #else
72  #endif
73  }
76  #if defined(TRACE)
77  xtd::diagnostics::trace::write_line(dialog_.message());
78  return dialog_.show_dialog(owner);
79  #else
81  #endif
82  }
84  void show_sheet(const iwin32_window& owner) {
85  #if defined(TRACE)
86  xtd::diagnostics::trace::write_line(dialog_.message());
87  dialog_.show_sheet(owner);
88  #endif
89  }
92  #if defined(TRACE)
93  xtd::diagnostics::trace::write_line(dialog_.message());
94  return dialog_.show_sheet_dialog(owner);
95  #else
97  #endif
98  }
100 
102 
108 
109  private:
113  virtual void on_dialog_closed(const dialog_closed_event_args& e);
114 
115  message_dialog dialog_;
116  };
117  }
118 }
xtd::forms::dialog_result show_dialog()
Runs message dialog box.
Definition: trace_message_dialog.h:66
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition: dialog_result.h:41
Nothing is returned from the dialog box. This means that the modal dialog continues running...
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
xtd::ustring message() const noexcept
Gets the text message.
Displays a message window and write debug, which presents a debug message to the user.
Definition: trace_message_dialog.h:27
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition: trace_message_dialog.h:91
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:21
void show_sheet(const iwin32_window &owner)
Runs message dialog box.
Definition: trace_message_dialog.h:84
Represents an event.
Definition: event.h:21
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition: trace.h:352
Displays a message window, also known as a dialog box, which presents a message to the user...
Definition: message_dialog.h:40
Contains xtd::forms::message_dialog dialog.
Implements a Windows message.
Definition: message.h:26
Provides data for a dialog closed event.
Definition: dialog_closed_event_args.h:20
trace_message_dialog & message(const xtd::ustring &message)
Sets the text message.
Definition: trace_message_dialog.h:51
event< trace_message_dialog, dialog_closed_event_handler > dialog_closed
Occurs when the user close a message dialog box with dialog close button or other dialog buttons...
Definition: trace_message_dialog.h:106
xtd::forms::dialog_result show_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition: trace_message_dialog.h:75
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23