wxmenuitem
Description
A wxmenuitem object represents an entry on a menu and when selected will normally cause an event to occur in the program. Menu items can be of various types, including separators, check items, and radio items.
Type Tags
None
Object Value
Properties
Property | Type | Description |
---|---|---|
_ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. |
__ | type(*) | This property is provided for use by the user to attach any object of any type to the type in which this property is provided. It has the additional feature of being marked with the resolve keyword, so that object resolution can continue down this property. |
checked | boolean | Specifies whether or not the menu item is checked or in the case of a radio item, if it is selected. |
enabled | boolean | Specifies whether or not the menu item is enabled. |
itemtype | string | This property contains the string that describes the type of menu item: separator, checkable, radio, or empty (for normal menu items). |
label | string |
The label that is shown representing the menu item on the menu. Using the
& character before another character will make the following
character an accelerator. Also, hotkey accelerators can be created by
inserting a tab character (0x09)followed by the accelerator, such as:
Ctrl+P for the print menu item.
|
menu | wxmenu | This property holds a reference to the menu that contains the menu item. |
name | string | The name of the menu item, to allow it to be referenced using the member operator (!). |
next | wxmenuitem | This property holds a reference to the next menu item. All menu items for a given menu are in a ring. |
onselect | event | An event that is triggered every time the user selects the menu item. |
submenu | wxmenu | This property holds a reference to a submenu (if any) that is associated with the menu item. |
type | type | Specifies the wxmenuitem type object. |
Methods
setchecked()
Description
Sets the state of the menu item, i.e. whether or not it has the appearance of being 'checked' or selected if it is a radio type of menu item. The wxmenuitem object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxmenuitemvar
.setchecked
(
boolean
)
checked
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
checked | None | boolean |
The new state for the menu item. If the argument is .true
then the menu item is checked, if it is .false
then the menu item is not checked. If this is a radio type of
menu item, then this will select an item in a group of items if
the argument is .true .
|
setenabled()
Description
Sets the enabled state of the menu item. The wxmenuitem object itself is returned, to allow multiple setting methods to be put into one expression.
Prototype
wxmenuitemvar
.setenabled
(
boolean
)
enabled
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
enabled | None | boolean | The desired enabled state for the menu item. |