#include <xtd/xtd>
namespace examples {
class form1 : public form {
public:
form1() {
text("Main menu example");
{"-"},
{"Open recen", {
{"Path/File1", {*this, &form1::on_menu_click}},
{"Path/File2", {*this, &form1::on_menu_click}},
{"Path/File3", {*this, &form1::on_menu_click}},
{"Path/File4", {*this, &form1::on_menu_click}},
{"Path/File5", {*this, &form1::on_menu_click}},
}},
{"-"},
{"-"},
{"Page &Seup...", {*this, &form1::on_menu_click}},
{"-"},
}},
{"-"},
{"-"},
{"-"},
}},
{"-"},
{"Show", {*this, &form1::on_menu_click}},
{"Hide", {*this, &form1::on_menu_click}},
}},
{"-"},
{"-"},
}},
}},
});
list_box1.parent(*this);
}
void on_menu_click(object& sender, const event_args& e) {
list_box1.items().push_back(
ustring::format(
"{} clicked", as<menu_item&>(sender).text()));
list_box1.selected_index(list_box1.items().size() - 1);
}
private:
list_box list_box1;
};
}
int main() {
}
static xtd::ustring file()
Gets a system-defined text that has a string value of "&File". This field is constant.
static xtd::ustring options()
Gets a system-defined text that has a string value of "&Options". This field is constant.
static xtd::ustring print_preview()
Gets a system-defined text that has a string value of "Print Re&view". This field is constant.
static xtd::ustring undo()
Gets a system-defined text that has a string value of "&Undo". This field is constant.
static xtd::ustring help()
Gets a system-defined text that has a string value of "&Help". This field is constant.
static xtd::ustring select_all()
Gets a system-defined text that has a string value of "Select &All". This field is constant.
static xtd::ustring save()
Gets a system-defined text that has a string value of "&Save". This field is constant.
static xtd::ustring new_()
Gets a system-defined text that has a string value of "&New". This field is constant.
static xtd::ustring forward()
Gets a system-defined text that has a string value of "&Forward". This field is constant.
static xtd::ustring back()
Gets a system-defined text that has a string value of "&Back". This field is constant.
static xtd::ustring paste()
Gets a system-defined text that has a string value of "&Paste". This field is constant.
static xtd::ustring save_as()
Gets a system-defined text that has a string value of "Save &As...". This field is constant.
static xtd::ustring print()
Gets a system-defined text that has a string value of "&Print...". This field is constant.
static xtd::ustring view()
Gets a system-defined text that has a string value of "&View". This field is constant.
static xtd::ustring copy()
Gets a system-defined text that has a string value of "&Copy". This field is constant.
static xtd::ustring edit()
Gets a system-defined text that has a string value of "&Edit". This field is constant.
static xtd::ustring redo()
Gets a system-defined text that has a string value of "&Redo". This field is constant.
static xtd::ustring open()
Gets a system-defined text that has a string value of "&Open...". This field is constant.
static xtd::ustring exit()
Gets a system-defined text that has a string value of "E&xit". This field is constant.
static xtd::ustring about()
Gets a system-defined text that has a string value of "&About". This field is constant.
static xtd::ustring cut()
Gets a system-defined text that has a string value of "Cu&t". This field is constant.
static xtd::ustring close()
Gets a system-defined text that has a string value of "&Close". This field is constant.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17