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+.
+ only implemented for Windows, Mac and GTK+.
@library{wxcore}
@category{menus}
Optional help string that will be shown on the status bar.
@param kind
May be @c wxITEM_SEPARATOR, @c wxITEM_NORMAL, @c wxITEM_CHECK or
- @c wxITEM_RADIO
+ @c wxITEM_RADIO.
@param subMenu
If non-@NULL, indicates that the menu item is a submenu.
*/
wxMenuItem(wxMenu* parentMenu = NULL, int id = wxID_SEPARATOR,
- const wxString& text = "",
- const wxString& helpString = "",
+ const wxString& text = wxEmptyString,
+ const wxString& helpString = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL,
wxMenu* subMenu = NULL);
/**
Returns the checked or unchecked bitmap (Windows only).
*/
- wxBitmap GetBitmap(bool checked = true) const;
+ virtual const wxBitmap& GetBitmap() const;
/**
Returns the font associated with the menu item (Windows only).
/**
Returns the help string associated with the menu item.
*/
- wxString GetHelp() const;
+ const wxString& GetHelp() const;
/**
Returns the menu item identifier.
@see GetLabel(), GetLabelFromText()
*/
- wxString GetText() const;
+ const wxString& GetText() const;
/**
Returns the text colour associated with the menu item (Windows only).
void SetBackgroundColour(const wxColour& colour) const;
/**
- Sets the bitmap for the menu item (Windows and GTK+ only).
+ Sets the bitmap for the menu item.
It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap).
+
+ @onlyfor{wxmsw,wxmac,wxgtk}
*/
virtual void SetBitmap(const wxBitmap& bmp);
/**
- Sets the checked/unchecked bitmaps for the menu item (Windows only).
+ Sets the checked/unchecked bitmaps for the menu item.
The first bitmap is also used as the single bitmap for uncheckable menu items.
+
+ @onlyfor{wxmsw}
*/
void SetBitmaps(const wxBitmap& checked,
const wxBitmap& unchecked = wxNullBitmap);
/**
Sets the parent menu which will contain this menu item.
*/
- void SetMenu(const wxMenu* menu);
+ void SetMenu(wxMenu* menu);
/**
Sets the submenu of this menu item.
*/
- void SetSubMenu(const wxMenu* menu);
+ void SetSubMenu(wxMenu* menu);
/**
Sets the text associated with the menu item.