xtd - Reference Guide  0.1.2
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
message_dialog.cpp

The following code example demonstrate the use of message_dialog dialog.

Windows

macOS

Gnome

#include <xtd/xtd>
using namespace xtd;
using namespace xtd::forms;
class form1 : public form {
public:
form1() {
controls().push_back_range({button_show_message, label_dialog_result});
location({400, 200});
start_position(form_start_position::manual);
text("Message dialog exemple");
button_show_message.location({10, 10});
button_show_message.text("Message...");
button_show_message.width(100);
button_show_message.click += [&] {
dialog.buttons(message_dialog_buttons::ok_cancel);
dialog.icon(message_dialog_icon::warning);
dialog.message("Hello, World!");
dialog.text("Message");
label_dialog_result.text(ustring::format("dialog_result = {}", dialog.show_sheet_dialog(*this)));
};
label_dialog_result.location({10, 45});
label_dialog_result.width(200);
}
private:
button button_show_message;
label label_dialog_result;
};
int main() {
application::run(form1());
}
Represents a Windows button control.
Definition button.h:54
Represents a window or dialog box that makes up an application's user interface.
Definition form.h:40
Represents a standard Windows label.
Definition label.h:26
Displays a message window, also known as a dialog box, which presents a message to the user....
Definition message_dialog.h:34
xtd::forms::message_dialog_buttons buttons() const
Gets buttons to display in the message dialog.
Definition message_dialog.h:41
xtd::forms::message_dialog_icon icon() const
Gets icon to display in the message dialog.
Definition message_dialog.h:93
xtd::ustring text() const
Gets the dialog caption text.
Definition message_dialog.h:129
xtd::ustring message() const
Gets the text message.
Definition message_dialog.h:117
xtd::forms::dialog_result show_sheet_dialog(const iwin32_window &owner)
Runs message dialog box.
The xtd::forms namespace contains classes for creating Windows-based applications that take full adva...
Definition about_box.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17