#include <xtd/xtd>
using namespace drawing;
namespace hello_world_xtd_example {
class main_form :
public form {
public:
main_form() {
text("Hello world (xtd)");
status.parent(*this);
status.text("Welcome to xtd!");
}
private:
void on_exit_menu_click(
object& sender,
const event_args& e) {
close();
}
void on_hello_menu_click(
object& sender,
const event_args& e) {
message_box::show("Hello world from xtd!");
}
void on_about_menu_click(
object& sender,
const event_args& e) {
about_box::show("This is a xtd Hello World example", "About Hello World");
}
menu_item hello_menu {
"&Hello...", {*
this, &main_form::on_hello_menu_click}, shortcut::ctrl_h};
menu_item exit_menu {texts::exit(), {*
this, &main_form::on_exit_menu_click}, shortcut::alt_f4};
menu_item about_menu {texts::about(), {*
this, &main_form::on_about_menu_click}};
menu_item file_menu_item {texts::file(), {hello_menu, separator_menu, exit_menu}};
menu_item help_menu_item {texts::help(), {about_menu}};
};
}
auto main() -> int {
application::run(hello_world_xtd_example::main_form {});
}
Represents the base class for classes that contain event data, and provides a value to use for events...
Definition event_args.h:18
Represents the menu structure of a form.
Definition main_menu.h:41
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10