SIMPOL Documentation

wxmenubar

Description

A wxmenubar object provides the menu bar where the various menus are located that are associated with a given window. A menu bar object can only be associated with one window at a time. It can also exist independently of being hosted within a window.

Type Tags

None

Object Value

wxmenubar.new()

Description

Creates a new wxmenubar object.

Prototype

wxmenubar.new ()

Parameters

None

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.
firstentrywxmenubarentry This property holds a reference to the first menu attached to the menu bar.
typetype Specifies the wxmenubar type object.
windowwxwindow This property holds a reference to the window where the menu bar is hosted.

Methods

delete()

Description

Deletes a menu from the menu bar.

Prototype

wxmenubarvar.delete ( wxmenu menu )

Parameters
ParameterDefault valueType nameDescription
menuNonewxmenu The menu that is to be deleted from the menu bar.

deleteall()

Description

Deletes all menues from the menu bar.

Prototype

wxmenubarvar.deleteall ()

Parameters

None

insert()

Description

Inserts a menu into the menu bar. The wxmenubar object itself is returned, to allow multiple insertions to be put into one expression.

Prototype

wxmenubarvar.insert ( wxmenu menu, string label, integer position, boolean enabled, string name )

Parameters
ParameterDefault valueType nameDescription
menuNonewxmenu The wxmenu object that is being inserted.
label""string The label for the menu.
positionCurrent entry count plus oneinteger The place where the menu is to be inserted. By default, it will be appended to the end.
enabled.trueboolean Indicates whether the menu is enabled or disabled.
name.nulstring This is the name of the menu. It is not required, but can be useful if the menu is to be manipulated using the member (!) operator.

setwindow()

Description

Creates the menu bar in the target window.

Prototype

wxmenubarvar.setwindow ( wxwindow window )

Parameters
ParameterDefault valueType nameDescription
windowNonewxwindow The window that will host the menu bar.

wxmenubar!

Get

The member operator followed by the name of a menu bar entry returns a reference to the wxmenubarentry object. To access a menu associated with a menu bar entry using only the menu bar object, the code would look like this: mb!file.menu where mb is the menu bar object and file is the name that was assigned when the menu was inserted. If the name provided is not correct (including case-sensitivity), then an error will occur.

Set

Attempting to assign a reference or a value to a wxmenubar object using the ! operator is not supported.