.\" This is a wxWidgets manpage page generated from the XML docs .TH wxMenuItem 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxMenuItem \- Represents a single menu item .SH DESCRIPTION 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+. .SH "PARENTS" wxObject .SH "INCLUDE FILES" wx/menuitem.h .SH MEMBERS .SS wxMenuItem (wxMenu* parentMenu = NULLint id = wxID_SEPARATORconst wxString& text = ""const wxString& helpString = ""wxItemKind kind = wxITEM_NORMALwxMenu* subMenu = NULL) Constructs a wxMenuItem object. .SS ~wxMenuItem () Destructor. .SS void Check (bool check = true) Checks or unchecks the menu item. Note that this only works when the item is already appended to a menu. .SS void Enable (bool enable = true) Enables or disables the menu item. .SS wxColour& GetBackgroundColour () Returns the background colour associated with the menu item (Windows only). .SS wxBitmap& GetBitmap (bool checked = true) Returns the checked or unchecked bitmap (Windows only). .SS wxFont& GetFont () Returns the font associated with the menu item (Windows only). .SS wxString GetHelp () Returns the help string associated with the menu item. .SS int GetId () Returns the menu item identifier. .SS wxItemKind GetKind () Returns the item kind, one of wxITEM_SEPARATOR , wxITEM_NORMAL , wxITEM_CHECK or wxITEM_RADIO . .SS wxString GetLabel () .SS static wxString GetLabelFromText (const wxString& text) .SS int GetMarginWidth () Gets the width of the menu item checkmark bitmap (Windows only). .SS wxMenu* GetMenu () Returns the menu this menu item is in, or NULL if this menu item is not attached. .SS wxString GetName () Returns the text associated with the menu item. NB: this function is deprecated, please use GetText or GetLabel instead. .SS wxString GetText () .SS wxMenu* GetSubMenu () Returns the submenu associated with the menu item, or NULL if there isn't one. .SS wxColour& GetTextColour () Returns the text colour associated with the menu item (Windows only). .SS bool IsCheckable () Returns true if the item is checkable. .SS bool IsChecked () Returns true if the item is checked. .SS bool IsEnabled () Returns true if the item is enabled. .SS bool IsSeparator () Returns true if the item is a separator. .SS bool IsSubMenu () Returns true if the item is a submenu. .SS void SetBackgroundColour (const wxColour& colour) Sets the background colour associated with the menu item (Windows only). .SS void SetBitmap (const wxBitmap& bmp) Sets the bitmap for the menu item (Windows and GTK+ only). It is equivalent to SetBitmaps (bmp, wxNullBitmap). .SS void SetBitmaps (const wxBitmap& checkedconst wxBitmap& unchecked = 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. .SS void SetFont (const wxFont& font) Sets the font associated with the menu item (Windows only). .SS void SetHelp (const wxString& helpString) Sets the help string. .SS void SetMarginWidth (int width) Sets the width of the menu item checkmark bitmap (Windows only). .SS void SetMenu (const wxMenu*menu) Sets the parent menu which will contain this menu item. .SS void SetSubMenu (const wxMenu*menu) Sets the submenu of this menu item. .SS void SetText (const wxString& text) Sets the text associated with the menu item. .SS void SetTextColour (const wxColour& colour) Sets the text colour associated with the menu item (Windows only). .SH "SEE ALSO" wxObject wxMenuBar wxMenu .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.