wxMenuItem
generated from ../src/mod_gui/control/menuitem.cppA menu item represents an item in a popup menu. Note that the majority of this class is only implemented under Windows so far, but everything except fonts, colours and bitmaps can be achieved via wxMenu on all platforms.
Constants
Constructor
wxMenuItem
wxMenuItem(Menu,
Id = 0,
Text = "",
Help = "",
Checkable = false,
SubMenu = null)
| Name | Type | Default | Description |
|---|---|---|---|
| Menu | wxMenu | Menu that owns the item | |
| Id | Integer | 0 | Identifier for this item |
| Text | String | The text for the menu item | |
| Help | String | The help message shown in the statusbar | |
| Checkable | Boolean | false | Indicates if the menu item can be checked or not. |
| SubMenu | wxMenu | null | Indicates that the menu item is a submenu |
Constructs a new wxMenuItem object
Properties
| Name | Type | Description |
|---|---|---|
| accel | wxAcceleratorEntry | Get/Set the accelerator. |
| backgroundColour | wxColour | Get/Set the background colour of the item (Windows only) |
| bitmap | wxBitmap | Get/Set the checked bitmap. (Windows only) |
| check | Boolean | Check or uncheck the menu item. |
| checkable | Boolean | Returns true if the item is checkable. |
| enable | Boolean | Enables or disables the menu item. |
| font | wxFont | Get/Set the font. (Windows only) |
| help | String | Get/Set the helpstring shown in the statusbar. |
| id | Integer | Get/Set the id of the menu item |
label ![]() |
String | Gets the text associated with the menu item without any accelerator characters it might contain. |
| marginWidth | Integer | Get/Set the width of the menu item checkmark bitmap (Windows only). |
menu ![]() |
wxMenu | Gets the menu that owns this item. |
| separator | Boolean | Returns true if the item is a separator. |
subMenu ![]() |
wxMenu | Gets the submenu associated with the menu item |
| text | String | Get/Set the text associated with the menu item with any accelerator characters it may contain. |
| textColour | wxColour | Get/Set the text colour. (Windows Only) |
Methods
setBitmaps
setBitmaps(BitmapChecked,
BitmapUnchecked = null)
| Name | Type | Default | Description |
|---|---|---|---|
| BitmapChecked | wxBitmap | ||
| BitmapUnchecked | wxBitmap | null |
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.

© 2002 - 2007 Franky Braem.