A menu item represents an item in a menu. Note that you usually don't have to deal with it directly as wxMenu methods usually construct an object of this class for you.
Also please note that the methods related to fonts and bitmaps are currently only implemented for Windows and GTK+.
Derived from
wxOwnerDrawn (Windows only)
wxObject
Include files
<wx/menuitem.h>
See also
Constructs a wxMenuItem object.
Parameters
Destructor.
Checks or unchecks the menu item.
Note that this only works when the item is already appended to a menu.
Enables or disables the menu item.
wxColour& GetBackgroundColour(void) const
Returns the background colour associated with the menu item (Windows only).
wxBitmap& GetBitmap(bool checked = true) const
Returns the checked or unchecked bitmap (Windows only).
Returns the font associated with the menu item (Windows only).
Returns the help string associated with the menu item.
Returns the menu item identifier.
wxItemKind GetKind(void) const
Returns the item kind, one of wxITEM_SEPARATOR, wxITEM_NORMAL, wxITEM_CHECK or wxITEM_RADIO.
Returns the text associated with the menu item without any accelerator characters it might contain.
See also
Strips all accelerator characters and mnemonics from the given text. For example,
wxMenuItem::GetLabelFromText("&Hello\tCtrl-H");
will return just "Hello".
See also
int GetMarginWidth(void) const
Gets the width of the menu item checkmark bitmap (Windows only).
Returns the menu this menu item is in, or NULL if this menu item is not attached.
Returns the text associated with the menu item.
NB: this function is deprecated, please use GetText or GetLabel instead.
Returns the text associated with the menu item, such as it was passed to the wxMenuItem constructor, i.e. with any accelerator characters it may contain.
See also
wxMenu* GetSubMenu(void) const
Returns the submenu associated with the menu item, or NULL if there isn't one.
wxColour& GetTextColour(void) const
Returns the text colour associated with the menu item (Windows only).
Returns true if the item is checkable.
Returns true if the item is checked.
Returns true if the item is enabled.
Returns true if the item is a separator.
Returns true if the item is a submenu.
void SetBackgroundColour(const wxColour& colour) const
Sets the background colour associated with the menu item (Windows only).
Sets the bitmap for the menu item (Windows and GTK+ only). It is equivalent to SetBitmaps(bmp, wxNullBitmap).
Sets the checked/unchecked bitmaps for the menu item (Windows only). The first bitmap is also used as the single bitmap for uncheckable menu items.
Sets the font associated with the menu item (Windows only).
Sets the help string.
void SetMarginWidth(int width) const
Sets the width of the menu item checkmark bitmap (Windows only).
Sets the parent menu which will contain this menu item.
Sets the submenu of this menu item.
Sets the text associated with the menu item.
Sets the text colour associated with the menu item (Windows only).
ymasuda 平成17年11月19日