SIMPOL Documentation

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

PropertyTypeDescription
_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.
checkedboolean Specifies whether or not the menu item is checked or in the case of a radio item, if it is selected.
enabledboolean Specifies whether or not the menu item is enabled.
itemtypestring This property contains the string that describes the type of menu item: separator, checkable, radio, or empty (for normal menu items).
labelstring 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.
menuwxmenu This property holds a reference to the menu that contains the menu item.
namestring The name of the menu item, to allow it to be referenced using the member operator (!).
nextwxmenuitem This property holds a reference to the next menu item. All menu items for a given menu are in a ring.
onselectevent An event that is triggered every time the user selects the menu item.
submenuwxmenu This property holds a reference to a submenu (if any) that is associated with the menu item.
typetype 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
ParameterDefault valueType nameDescription
checkedNoneboolean 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
ParameterDefault valueType nameDescription
enabledNoneboolean The desired enabled state for the menu item.