wex
v20.04.0
|
Offers a single menu item. More...
#include <wex/menu-item.h>
Public Types | |
enum | type_t { CHECK, EDIT, EDIT_INVERT, EXIT, HISTORY, MENU, PANES, PRINT, RADIO, SEPARATOR, SUBMENU, TOOLS, VCS } |
The item types supported. More... | |
Public Member Functions | |
menu_item (type_t=SEPARATOR) | |
Default constructor, for a SEPARATOR. | |
menu_item (int id, const std::string &name=std::string(), const std::string &help=std::string(), const wxArtID &art=std::string(), std::function< void(wxCommandEvent &)> action=nullptr, std::function< void(wxUpdateUIEvent &)> ui=nullptr) | |
Constructor for a normal MENU item. More... | |
menu_item (int id, const std::string &name, type_t type, std::function< void(wxCommandEvent &)> action=nullptr, std::function< void(wxUpdateUIEvent &)> ui=nullptr, const std::string &help=std::string()) | |
Constructor for a checkable item. More... | |
menu_item (menu *submenu, const std::string &name, const std::string &help=std::string(), int id=wxID_ANY) | |
Constructor for a SUBMENU item. More... | |
menu_item (const path &p, bool show_modal=true) | |
Constructor for a VCS submenu item. More... | |
menu_item (int id, file_history &history, std::function< void(wxUpdateUIEvent &)> ui=nullptr) | |
Constructor for HISTORY menu item. More... | |
menu_item (const managed_frame *frame) | |
Constructor for PANES menu items. More... | |
void | append (wex::menu *menu) const |
Appends this item(s) to menu. | |
auto | id () const |
Returns menu item id. | |
auto & | name () const |
Returns menu item name. | |
auto | type () const |
Returns menu item type. | |
Offers a single menu item.
The item types supported.
Enumerator | |
---|---|
CHECK | a check menu item |
EDIT | edit menu items |
EDIT_INVERT | edit invert menu items |
EXIT | exit menu item |
HISTORY | file_history menu items |
MENU | a normal menu item |
PANES | toggle panes from managaed frame menu items |
print menu items | |
RADIO | a radio menu item |
SEPARATOR | a separator menu item If previous item was a separator, it ignores this one. If no items have yet been appended, it ignores this one. |
SUBMENU | a submenu item |
TOOLS | tools menu items |
VCS | vcs menu items |
wex::menu_item::menu_item | ( | int | id, |
const std::string & | name = std::string() , |
||
const std::string & | help = std::string() , |
||
const wxArtID & | art = std::string() , |
||
std::function< void(wxCommandEvent &)> | action = nullptr , |
||
std::function< void(wxUpdateUIEvent &)> | ui = nullptr |
||
) |
Constructor for a normal MENU item.
id | menu item id |
name | menu name or text |
help | menu help text |
art | menu artid |
action | callback for menu action |
ui | callback for menu update action |
wex::menu_item::menu_item | ( | int | id, |
const std::string & | name, | ||
type_t | type, | ||
std::function< void(wxCommandEvent &)> | action = nullptr , |
||
std::function< void(wxUpdateUIEvent &)> | ui = nullptr , |
||
const std::string & | help = std::string() |
||
) |
Constructor for a checkable item.
id | menu item id |
name | menu name or text |
type | Constructor for a CHECK or RADIO item. |
action | callback for menu event action |
ui | callback for menu update action |
help | menu help text |
wex::menu_item::menu_item | ( | menu * | submenu, |
const std::string & | name, | ||
const std::string & | help = std::string() , |
||
int | id = wxID_ANY |
||
) |
Constructor for a SUBMENU item.
submenu | menu submenu |
name | menu name or text |
help | menu help text |
id | menu item id |
wex::menu_item::menu_item | ( | const path & | p, |
bool | show_modal = true |
||
) |
Constructor for a VCS submenu item.
p | if a filename is specified the menu is built as a submenu, otherwise as menu items. |
show_modal | shows modal dialog if necessary |
wex::menu_item::menu_item | ( | int | id, |
file_history & | history, | ||
std::function< void(wxUpdateUIEvent &)> | ui = nullptr |
||
) |
Constructor for HISTORY menu item.
id | menu item id |
history | object for maintaining / retrieving history |
ui | callback for menu update action |
wex::menu_item::menu_item | ( | const managed_frame * | frame | ) |
Constructor for PANES menu items.
frame | frame to supply toggled panes |