#include <omgui/menuitems.h>
Inherits omgui::Object.
Inherited by omgui::Separator.
MenuItem labels can have a mnemonic character which is used to select the menu item when navigating the Menu with the keyboard. The mnemonic character within the label is identified by an & infront of that character. For example, in the label "&File", the 'F' character is the mnemonic. If you need to display a literal '&' within a label, using "&&File" which will not have a mnemonic and will display as "&File" on the menu item. If you want a '&' character to be a mnemonic, use three '&' characters. "&&&File" will create the menu item "&File" where '&' is the mnemonic character. Attempting to specify more than one mnemonic character within the label, like "&Fi&le", results in undefined behavior.
Mac OS does not support menu mnemonics in this fashion, so any '&' appearing in the menu name which would create a mnemonic will simply be ignored. The "&&" sequence still prints a literal '&'.
Public Types | |
| typedef omgui::api::MenuItem | api_type |
Public Member Functions | |
| void | add_ref () |
| void | disable () |
| void | enable (bool value=true) |
| bool | enabled () const |
| menu_id | get_id () const |
| api_type * | get_impl () const |
| string | get_label () const |
| void | release () |
| void | set_label (const string &label) |
| ~MenuItem () | |
Static Public Member Functions | |
| static MenuItem * | create (menu_id id, const string &label) |
| static MenuItem * | create (object_id obj_id, menu_id id, const string &label) |
Protected Member Functions | |
| MenuItem (object_id id, api_type *impl) | |
| MenuItem (object_id obj_id, menu_id id, const string &label) | |
Private Attributes | |
| api_type * | m_impl |
Reimplemented in omgui::Separator.
| omgui::MenuItem::~MenuItem | ( | ) |
| void omgui::MenuItem::add_ref | ( | ) | [inline, virtual] |
Implements omgui::RefCountable.
Creates a MenuItem with the given object_id, menu_id and label.
| void omgui::MenuItem::disable | ( | ) | [inline] |
Disables the menu item
| void omgui::MenuItem::enable | ( | bool | value = true |
) |
Enables or disables the menu item. Disabled menu items cannot be selected by the user.
| bool omgui::MenuItem::enabled | ( | ) | const |
| menu_id omgui::MenuItem::get_id | ( | ) | const |
| MenuItem::api_type * omgui::MenuItem::get_impl | ( | ) | const |
| string omgui::MenuItem::get_label | ( | ) | const |
| void omgui::MenuItem::release | ( | ) | [inline, virtual] |
Implements omgui::RefCountable.
| void omgui::MenuItem::set_label | ( | const string & | label | ) |
Sets the label for this menu item.
api_type* omgui::MenuItem::m_impl [private] |