xtd 1.0.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
52 [[nodiscard]] auto dialog_result() const noexcept -> xtd::forms::dialog_result;
53
56 [[nodiscard]] auto message() const noexcept -> xtd::string;
60 auto message(const xtd::string& message) -> trace_message_dialog& {
61 #if DEBUG || TRACE
62 dialog_.message(message);
63 #endif
64 return *this;
65 }
66
67
69
72 auto reset() -> void;
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 auto show_sheet(const xtd::forms::iwin32_window& owner) -> void {
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:
119 auto on_dialog_closed(const xtd::forms::dialog_closed_event_args& e) -> void;
120
121 message_dialog dialog_;
122 };
123 }
124}
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition trace.hpp:326
Represents an event.
Definition event.hpp:23
Provides the base implementation and enables object sharing between applications.
Definition component.hpp:26
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
auto reset() -> void
Resets all properties to empty string.
auto show_dialog(const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Runs message dialog box.
Definition trace_message_dialog.hpp:84
auto show_sheet_dialog(const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Runs message dialog box.
Definition trace_message_dialog.hpp:100
auto show_dialog() -> xtd::forms::dialog_result
Runs message dialog box.
Definition trace_message_dialog.hpp:75
auto dialog_result() const noexcept -> xtd::forms::dialog_result
Gets async dialog_result result after dialog box is closing.
trace_message_dialog()
Initializes a new instance of the trace_message_dialog class.
auto message() const noexcept -> xtd::string
Gets the text message.
auto show_sheet(const xtd::forms::iwin32_window &owner) -> void
Runs message dialog box.
Definition trace_message_dialog.hpp:93
xtd::event< trace_message_dialog, xtd::forms::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
#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
@ 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 auto data() const noexcept -> const_pointer
Gets direct access to the underlying contiguous storage.
Definition read_only_span.hpp:197