2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: menuitem.h
|
2008-10-11 13:10:48 +00:00
|
|
|
// Purpose: interface of wxMenu, wxMenuItem
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
|
|
|
// RCS-ID: $Id$
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/**
|
|
|
|
@class wxMenuItem
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-10-11 13:10:48 +00:00
|
|
|
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.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Also please note that the methods related to fonts and bitmaps are currently
|
2008-11-20 23:15:09 +00:00
|
|
|
only implemented for Windows, Mac and GTK+.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-02-18 17:58:51 +00:00
|
|
|
@beginEventEmissionTable{wxCommandEvent,wxMenuEvent}
|
2008-12-08 23:22:41 +00:00
|
|
|
@event{EVT_MENU(id, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_MENU_SELECTED command, which is generated by a menu item.
|
|
|
|
This type of event is sent as wxCommandEvent.
|
|
|
|
@event{EVT_MENU_RANGE(id1, id2, func)}
|
|
|
|
Process a @c wxEVT_COMMAND_MENU_RANGE command, which is generated by a range of menu items.
|
|
|
|
This type of event is sent as wxCommandEvent.
|
|
|
|
@event{EVT_MENU_OPEN(func)}
|
|
|
|
A menu is about to be opened. On Windows, this is only sent once for each
|
|
|
|
navigation of the menubar (up until all menus have closed).
|
|
|
|
This type of event is sent as wxMenuEvent.
|
|
|
|
@event{EVT_MENU_CLOSE(func)}
|
|
|
|
A menu has been just closed.
|
|
|
|
This type of event is sent as wxMenuEvent.
|
|
|
|
@event{EVT_MENU_HIGHLIGHT(id, func)}
|
|
|
|
The menu item with the specified id has been highlighted: used to show
|
|
|
|
help prompts in the status bar by wxFrame
|
|
|
|
This type of event is sent as wxMenuEvent.
|
|
|
|
@event{EVT_MENU_HIGHLIGHT_ALL(func)}
|
|
|
|
A menu item has been highlighted, i.e. the currently selected menu item has changed.
|
|
|
|
This type of event is sent as wxMenuEvent.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
|
|
|
@category{menus}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxMenuBar, wxMenu
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxMenuItem : public wxObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Constructs a wxMenuItem object.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
|
|
|
Menu items can be standard, or "stock menu items", or custom.
|
|
|
|
For the standard menu items (such as commands to open a file, exit the
|
|
|
|
program and so on, see @ref page_stockitems for the full list) it is enough
|
|
|
|
to specify just the stock ID and leave @a text and @a helpString empty.
|
2010-05-16 12:31:57 +00:00
|
|
|
Some platforms (currently wxGTK only, and see the remark in SetBitmap()
|
|
|
|
documentation) will also show standard bitmaps for stock menu items.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2010-05-16 12:31:57 +00:00
|
|
|
Leaving at least @a text empty for the stock menu items is actually strongly
|
2008-03-08 13:52:38 +00:00
|
|
|
recommended as they will have appearance and keyboard interface (including
|
|
|
|
standard accelerators) familiar to the user.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
For the custom (non-stock) menu items, @a text must be specified and while
|
|
|
|
@a helpString may be left empty, it's recommended to pass the item
|
2008-10-11 13:10:48 +00:00
|
|
|
description (which is automatically shown by the library in the status bar
|
|
|
|
when the menu item is selected) in this parameter.
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
Finally note that you can e.g. use a stock menu label without using its stock
|
2008-10-11 13:10:48 +00:00
|
|
|
help string:
|
|
|
|
|
|
|
|
@code
|
|
|
|
// use all stock properties:
|
|
|
|
helpMenu->Append(wxID_ABOUT);
|
|
|
|
|
|
|
|
// use the stock label and the stock accelerator but not the stock help string:
|
2010-05-16 12:31:57 +00:00
|
|
|
helpMenu->Append(wxID_ABOUT, "", "My custom help string");
|
2008-10-11 13:10:48 +00:00
|
|
|
|
|
|
|
// use all stock properties except for the bitmap:
|
|
|
|
wxMenuItem *mymenu = new wxMenuItem(helpMenu, wxID_ABOUT);
|
|
|
|
mymenu->SetBitmap(wxArtProvider::GetBitmap(wxART_WARNING));
|
|
|
|
helpMenu->Append(mymenu);
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
that is, stock properties are set independently one from the other.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parentMenu
|
2008-06-22 14:47:40 +00:00
|
|
|
Menu that the menu item belongs to. Can be @NULL if the item is
|
|
|
|
going to be added to the menu later.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-06-22 14:47:40 +00:00
|
|
|
Identifier for this menu item. May be @c wxID_SEPARATOR, in which
|
|
|
|
case the given kind is ignored and taken to be @c wxITEM_SEPARATOR
|
|
|
|
instead.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param text
|
2009-12-20 14:24:42 +00:00
|
|
|
Text for the menu item, as shown on the menu.
|
|
|
|
See SetItemLabel() for more info.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param helpString
|
2008-03-09 12:33:59 +00:00
|
|
|
Optional help string that will be shown on the status bar.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param kind
|
2008-10-11 13:10:48 +00:00
|
|
|
May be @c wxITEM_SEPARATOR, @c wxITEM_NORMAL, @c wxITEM_CHECK or
|
2008-11-20 23:15:09 +00:00
|
|
|
@c wxITEM_RADIO.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param subMenu
|
2008-03-09 12:33:59 +00:00
|
|
|
If non-@NULL, indicates that the menu item is a submenu.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxMenuItem(wxMenu* parentMenu = NULL, int id = wxID_SEPARATOR,
|
2008-11-10 21:33:25 +00:00
|
|
|
const wxString& text = wxEmptyString,
|
|
|
|
const wxString& helpString = wxEmptyString,
|
2008-03-08 13:52:38 +00:00
|
|
|
wxItemKind kind = wxITEM_NORMAL,
|
2008-03-09 12:33:59 +00:00
|
|
|
wxMenu* subMenu = NULL);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual ~wxMenuItem();
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Checks or unchecks the menu item.
|
|
|
|
Note that this only works when the item is already appended to a menu.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void Check(bool check = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Enables or disables the menu item.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void Enable(bool enable = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
@deprecated This function is deprecated; please use GetLabelText() instead.
|
|
|
|
|
|
|
|
@see GetLabelText()
|
|
|
|
*/
|
|
|
|
static wxString GetLabelFromText(const wxString& text);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Strips all accelerator characters and mnemonics from the given @a text.
|
|
|
|
For example:
|
|
|
|
|
|
|
|
@code
|
|
|
|
wxMenuItem::GetLabelfromText("&Hello\tCtrl-h");
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
will return just @c "Hello".
|
|
|
|
|
|
|
|
@see GetItemLabelText(), GetItemLabel()
|
|
|
|
*/
|
|
|
|
static wxString GetLabelText(const wxString& text);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@name Getters
|
|
|
|
*/
|
|
|
|
//@{
|
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the background colour associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxColour GetBackgroundColour() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Returns the checked or unchecked bitmap.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
virtual const wxBitmap& GetBitmap() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Returns the font associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxFont GetFont() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the help string associated with the menu item.
|
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& GetHelp() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the menu item identifier.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
int GetId() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text associated with the menu item including any accelerator
|
2008-10-11 13:10:48 +00:00
|
|
|
characters that were passed to the constructor or SetItemLabel().
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see GetItemLabelText(), GetLabelText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxString GetItemLabel() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text associated with the menu item, without any accelerator
|
|
|
|
characters.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-03-09 12:33:59 +00:00
|
|
|
@see GetItemLabel(), GetLabelText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual wxString GetItemLabelText() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-03-08 14:43:31 +00:00
|
|
|
Returns the item kind, one of @c wxITEM_SEPARATOR, @c wxITEM_NORMAL,
|
2008-03-08 13:52:38 +00:00
|
|
|
@c wxITEM_CHECK or @c wxITEM_RADIO.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxItemKind GetKind() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text associated with the menu item without any accelerator
|
|
|
|
characters it might contain.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2008-06-13 00:05:15 +00:00
|
|
|
@deprecated This function is deprecated in favour of GetItemLabelText().
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2009-12-20 14:24:42 +00:00
|
|
|
@see GetItemLabelText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetLabel() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Gets the width of the menu item checkmark bitmap.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
int GetMarginWidth() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the menu this menu item is in, or @NULL if this menu item is not
|
|
|
|
attached.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxMenu* GetMenu() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the text associated with the menu item.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2009-12-20 14:24:42 +00:00
|
|
|
@deprecated This function is deprecated. Please use GetItemLabel() or GetItemLabelText() instead.
|
|
|
|
|
|
|
|
@see GetItemLabel(), GetItemLabelText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetName() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the submenu associated with the menu item, or @NULL if there isn't one.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxMenu* GetSubMenu() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2008-06-13 00:05:15 +00:00
|
|
|
@deprecated This function is deprecated in favour of GetItemLabel().
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2009-12-20 14:24:42 +00:00
|
|
|
@see GetLabelFromText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& GetText() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Returns the text colour associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxColour GetTextColour() const;
|
2009-12-20 14:24:42 +00:00
|
|
|
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@name Checkers
|
|
|
|
*/
|
|
|
|
//@{
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the item is checkable.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsCheckable() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the item is checked.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual bool IsChecked() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the item is enabled.
|
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual bool IsEnabled() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the item is a separator.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsSeparator() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns @true if the item is a submenu.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
bool IsSubMenu() const;
|
2009-12-20 14:24:42 +00:00
|
|
|
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@name Setters
|
|
|
|
*/
|
|
|
|
//@{
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Sets the background colour associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
void SetBackgroundColour(const wxColour& colour) const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-11-20 23:15:09 +00:00
|
|
|
Sets the bitmap for the menu item.
|
2009-03-23 12:07:42 +00:00
|
|
|
|
2009-12-20 14:24:42 +00:00
|
|
|
It is equivalent to wxMenuItem::SetBitmaps(bmp, wxNullBitmap) if
|
|
|
|
@a checked is @true (default value) or SetBitmaps(wxNullBitmap, bmp)
|
2009-03-23 12:07:42 +00:00
|
|
|
otherwise.
|
2008-11-20 23:15:09 +00:00
|
|
|
|
2010-03-03 01:08:19 +00:00
|
|
|
Notice that GTK+ uses a global setting called @c gtk-menu-images to
|
|
|
|
determine if the images should be shown in the menus at all. If it is
|
|
|
|
off (which is the case in e.g. Gnome 2.28 by default), no images will
|
|
|
|
be shown, consistently with the native behaviour.
|
|
|
|
|
2009-03-15 01:19:09 +00:00
|
|
|
@onlyfor{wxmsw,wxosx,wxgtk}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2009-03-23 12:07:42 +00:00
|
|
|
virtual void SetBitmap(const wxBitmap& bmp, bool checked = true);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-11-20 23:15:09 +00:00
|
|
|
Sets the checked/unchecked bitmaps for the menu item.
|
2008-10-11 13:10:48 +00:00
|
|
|
The first bitmap is also used as the single bitmap for uncheckable menu items.
|
2008-11-20 23:15:09 +00:00
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetBitmaps(const wxBitmap& checked,
|
|
|
|
const wxBitmap& unchecked = wxNullBitmap);
|
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Sets the font associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetFont(const wxFont& font);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the help string.
|
|
|
|
*/
|
|
|
|
void SetHelp(const wxString& helpString);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the label associated with the menu item.
|
2009-12-20 14:24:42 +00:00
|
|
|
|
|
|
|
Note that if the ID of this menu item corrisponds to a stock ID, then it is
|
|
|
|
not necessary to specify a label: wxWidgets will automatically use the stock
|
|
|
|
item label associated with that ID. See the @ref wxMenuItem::wxMenuItem "constructor"
|
|
|
|
for more info.
|
|
|
|
|
|
|
|
The label string for the normal menu items (not separators) may include the
|
|
|
|
accelerator which can be used to activate the menu item from keyboard.
|
|
|
|
An accelerator key can be specified using the ampersand <tt>&</tt> character.
|
|
|
|
In order to embed an ampersand character in the menu item text, the ampersand
|
|
|
|
must be doubled.
|
|
|
|
|
|
|
|
Optionally you can specify also an accelerator string appending a tab character
|
|
|
|
<tt>\\t</tt> followed by a valid key combination (e.g. <tt>CTRL+V</tt>).
|
|
|
|
Its general syntax is any combination of @c "CTRL", @c "ALT" and @c "SHIFT" strings
|
|
|
|
(case doesn't matter) separated by either @c '-' or @c '+' characters and followed
|
|
|
|
by the accelerator itself.
|
|
|
|
The accelerator may be any alphanumeric character, any function key
|
|
|
|
(from F1 to F12) or one of the special characters listed in the table
|
|
|
|
below (again, case doesn't matter):
|
|
|
|
- @c DEL or @c DELETE: Delete key
|
|
|
|
- @c INS or @c INSERT: Insert key
|
|
|
|
- @c ENTER or @c RETURN: Enter key
|
|
|
|
- @c PGUP: PageUp key
|
|
|
|
- @c PGDN: PageDown key
|
|
|
|
- @c LEFT: Left cursor arrow key
|
|
|
|
- @c RIGHT: Right cursor arrow key
|
|
|
|
- @c UP: Up cursor arrow key
|
|
|
|
- @c DOWN: Down cursor arrow key
|
|
|
|
- @c HOME: Home key
|
|
|
|
- @c END: End key
|
|
|
|
- @c SPACE: Space
|
|
|
|
- @c TAB: Tab key
|
|
|
|
- @c ESC or @c ESCAPE: Escape key (Windows only)
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
@code
|
|
|
|
m_pMyMenuItem->SetItemLabel("My &item\tCTRL+I");
|
|
|
|
m_pMyMenuItem2->SetItemLabel("Clean && build\tF7");
|
|
|
|
m_pMyMenuItem3->SetItemLabel("Simple item");
|
|
|
|
m_pMyMenuItem4->SetItemLabel("Item with &accelerator");
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see GetItemLabel(), GetItemLabelText()
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetItemLabel(const wxString& label);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Sets the width of the menu item checkmark bitmap.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
void SetMarginWidth(int width) const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the parent menu which will contain this menu item.
|
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
void SetMenu(wxMenu* menu);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the submenu of this menu item.
|
|
|
|
*/
|
2008-10-28 15:36:26 +00:00
|
|
|
void SetSubMenu(wxMenu* menu);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Sets the text associated with the menu item.
|
2008-10-11 13:10:48 +00:00
|
|
|
|
2008-06-13 00:05:15 +00:00
|
|
|
@deprecated This function is deprecated in favour of SetItemLabel().
|
2009-12-20 14:24:42 +00:00
|
|
|
|
|
|
|
@see SetItemLabel().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-09-27 11:21:10 +00:00
|
|
|
virtual void SetText(const wxString& text);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2009-12-20 14:24:42 +00:00
|
|
|
Sets the text colour associated with the menu item.
|
|
|
|
|
|
|
|
@onlyfor{wxmsw}
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
void SetTextColour(const wxColour& colour);
|
2009-12-20 14:24:42 +00:00
|
|
|
|
|
|
|
//@}
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|