xtd 0.2.0
Loading...
Searching...
No Matches
trace_message_dialog.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "message_dialog.hpp"
6#include <xtd/diagnostics/trace>
7
9namespace xtd {
11 namespace forms {
37 struct data;
38
39 public:
41
46
48
53
56 xtd::string message() const noexcept;
61 #if DEBUG || TRACE
62 dialog_.message(message);
63 #endif
64 return *this;
65 }
66
67
69
72 void reset();
73
76 #if DEBUG || TRACE
77 xtd::diagnostics::trace::write_line(dialog_.message());
78 return dialog_.show_dialog();
79 #else
81 #endif
82 }
83
85 #if DEBUG || TRACE
86 xtd::diagnostics::trace::write_line(dialog_.message());
87 return dialog_.show_dialog(owner);
88 #else
90 #endif
91 }
92
93 void show_sheet(const iwin32_window& owner) {
94 #if DEBUG || TRACE
95 xtd::diagnostics::trace::write_line(dialog_.message());
96 dialog_.show_sheet(owner);
97 #endif
98 }
99
101 #if DEBUG || TRACE
102 xtd::diagnostics::trace::write_line(dialog_.message());
103 return dialog_.show_sheet_dialog(owner);
104 #else
106 #endif
107 }
108
109
111
117
118 private:
122 virtual void on_dialog_closed(const dialog_closed_event_args& e);
123
124 message_dialog dialog_;
125 };
126 }
127}
static void write_line()
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:326
Represents an event.
Definition event.hpp:21
component()
Initialises a new instance of the component class.
Provides data for a dialog closed event.
Definition dialog_closed_event_args.hpp:22
Provides an interface to expose Win32 HWND handles.
Definition iwin32_window.hpp:23
Displays a message window, also known as a dialog box, which presents a message to the user....
Definition message_dialog.hpp:42
void show_sheet(const iwin32_window &owner)
Runs message dialog box.
Definition trace_message_dialog.hpp:93
xtd::forms::dialog_result show_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition trace_message_dialog.hpp:84
void reset()
Resets all properties to empty string.
xtd::string message() const noexcept
Gets the text message.
xtd::forms::dialog_result show_dialog()
Runs message dialog box.
Definition trace_message_dialog.hpp:75
trace_message_dialog()
Initializes a new instance of the trace_message_dialog class.
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs message dialog box.
Definition trace_message_dialog.hpp:100
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.hpp:115
xtd::forms::dialog_result dialog_result() const noexcept
Gets async dialog_result result after dialog box is closing.
#define forms_export_
Define shared library export.
Definition forms_export.hpp:13
dialog_result
Specifies identifiers to indicate the return value of a dialog box.
Definition dialog_result.hpp:43
@ e
The E key.
Definition keys.hpp:207
@ none
Nothing is returned from the dialog box. This means that the modal dialog continues running.
Definition dialog_result.hpp:45
Contains xtd::forms::message_dialog dialog.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition texts.hpp:219
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr const_pointer data() const noexcept
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:201