xtd 0.2.0
debug_message_dialog.h
Go to the documentation of this file.
1 #pragma once
5 #include "message_dialog.h"
6 #include <xtd/diagnostics/debug>
7 
9 namespace xtd {
11  namespace forms {
28  class forms_export_ debug_message_dialog final : public component {
29  struct data;
30 
31  public:
33 
38 
40 
45 
48  xtd::ustring message() const noexcept;
53  #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
54  dialog_.message(message);
55  #endif
56  return *this;
57  }
59 
61 
64  void reset();
65 
68  #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
69  xtd::diagnostics::debug::write_line(dialog_.message());
70  return dialog_.show_dialog();
71  #else
73  #endif
74  }
77  #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
78  xtd::diagnostics::debug::write_line(dialog_.message());
79  return dialog_.show_dialog(owner);
80  #else
82  #endif
83  }
85  void show_sheet(const iwin32_window& owner) {
86  #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
87  xtd::diagnostics::debug::write_line(dialog_.message());
88  dialog_.show_sheet(owner);
89  #endif
90  }
93  #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
94  xtd::diagnostics::debug::write_line(dialog_.message());
95  return dialog_.show_sheet_dialog(owner);
96  #else
98  #endif
99  }
101 
103 
109 
110  private:
114  virtual void on_dialog_closed(const dialog_closed_event_args& e);
115 
116  message_dialog dialog_;
117  };
118  }
119 }
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...
Displays a message window and write debug, which presents a debug message to the user.
Definition: debug_message_dialog.h:28
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
xtd::ustring message() const noexcept
Gets the text message.
Provides an interface to expose Win32 HWND handles.
Definition: iwin32_window.h:21
Represents an event.
Definition: event.h:21
Displays a message window, also known as a dialog box, which presents a message to the user...
Definition: message_dialog.h:40
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition: debug_message_dialog.h:92
Contains xtd::forms::message_dialog dialog.
Implements a Windows message.
Definition: message.h:26
event< debug_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: debug_message_dialog.h:107
xtd::forms::dialog_result show_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition: debug_message_dialog.h:76
debug_message_dialog & message(const xtd::ustring &message)
Sets the text message.
Definition: debug_message_dialog.h:52
xtd::forms::dialog_result show_dialog()
Runs message dialog box.
Definition: debug_message_dialog.h:67
Provides data for a dialog closed event.
Definition: dialog_closed_event_args.h:20
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition: about_box.h:13
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition: debug.h:370
void show_sheet(const iwin32_window &owner)
Runs message dialog box.
Definition: debug_message_dialog.h:85
Provides the base implementation and enables object sharing between applications. ...
Definition: component.h:23