xtd 1.0.0
Loading...
Searching...
No Matches
debug_message_dialog.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "message_dialog.hpp"
6#include <xtd/diagnostics/debug>
7
9namespace xtd {
11 namespace forms {
31 struct data;
32
33 public:
35
40
42
46 [[nodiscard]] auto dialog_result() const noexcept -> xtd::forms::dialog_result;
47
50 [[nodiscard]] auto message() const noexcept -> xtd::string;
54 auto message(const xtd::string& message) -> debug_message_dialog& {
55 #if DEBUG
56 dialog_.message(message);
57 #endif
58 return *this;
59 }
60
61
63
66 auto reset() -> void;
67
70 #if DEBUG
71 xtd::diagnostics::debug::write_line(dialog_.message());
72 return dialog_.show_dialog();
73 #else
75 #endif
76 }
77
79 #if DEBUG
80 xtd::diagnostics::debug::write_line(dialog_.message());
81 return dialog_.show_dialog(owner);
82 #else
84 #endif
85 }
86
87 auto show_sheet(const xtd::forms::iwin32_window& owner) -> void {
88 #if DEBUG
89 xtd::diagnostics::debug::write_line(dialog_.message());
90 dialog_.show_sheet(owner);
91 #endif
92 }
93
95 #if DEBUG
96 xtd::diagnostics::debug::write_line(dialog_.message());
97 return dialog_.show_sheet_dialog(owner);
98 #else
100 #endif
101 }
102
103
105
111
112 private:
113 auto on_dialog_closed(const xtd::forms::dialog_closed_event_args& e) -> void;
114
115 message_dialog dialog_;
116 };
117 }
118}
static auto write_line() -> void
Writes a line terminator to the trace listeners in the listeners collection.
Definition debug.hpp:344
Represents an event.
Definition event.hpp:23
Provides the base implementation and enables object sharing between applications.
Definition component.hpp:26
auto show_sheet(const xtd::forms::iwin32_window &owner) -> void
Runs message dialog box.
Definition debug_message_dialog.hpp:87
auto show_dialog(const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Runs message dialog box.
Definition debug_message_dialog.hpp:78
debug_message_dialog()
Initializes a new instance of the debug_message_dialog class.
auto show_sheet_dialog(const xtd::forms::iwin32_window &owner) -> xtd::forms::dialog_result
Runs message dialog box.
Definition debug_message_dialog.hpp:94
auto dialog_result() const noexcept -> xtd::forms::dialog_result
Gets async dialog_result result after dialog box is closing.
auto reset() -> void
Resets all properties to empty string.
auto show_dialog() -> xtd::forms::dialog_result
Runs message dialog box.
Definition debug_message_dialog.hpp:69
auto message() const noexcept -> xtd::string
Gets the text message.
xtd::event< debug_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 debug_message_dialog.hpp:109
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
#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