SIMPOL Documentation

wxtoolbar

Description

A wxtoolbar object provides the tool (icon) bar where the various tools (icons) are located that are associated with a given window. A tool bar object can only be associated with one window at a time. It can also exist independently of being hosted within a window. The toolbar can also host one or more forms as if they were tools, where each form can contain one or more form controls.

Type Tags

None

Object Value

wxtoolbar.new()

Description

Creates a new wxtoolbar object. The size of the toolbar tools can be controlled by setting the desired size in pixels in the new() method.

Prototype

wxtoolbar.new ( integer toolwidth, integer toolheight, rgb backgroundrgb, integer error )

Parameters

ParameterDefault valueType nameDescription
toolwidth16integer The width of the tool bitmaps.
toolheight15integer The height of the tool bitmaps.
backgroundrgbThe system default colorrgb The background color for the toolbar.
error.nulinteger Specifies an object which is used to output any error code generated during creation of the wxtoolbar object. If error is not specified or is .nul then any error which occurs during object creation will halt the program. If an error object is specified and an error occurs during object creation then the error code is output into that object and the new methods returns .nul.

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.
backgroundrgbrgb Specifies the background color of the tool bar.
firsttoolwxtool This property holds a reference to the first tool attached to the tool bar.
toolheightinteger Specifies the height of the wxtool objects.
toolwidthinteger Specifies the width of the wxtool objects.
typetype Specifies the wxtoolbar type object.
windowwxwindow This property holds a reference to the window where the tool bar is hosted.

Methods

insert()

Description

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

Prototype

wxtoolbarvar.insert ( wxbitmap bitmap, wxbitmap disabledbitmap, integer position, boolean enabled, string tooltip, string name )

Parameters
ParameterDefault valueType nameDescription
bitmapNonewxbitmap The wxbitmap object that will be shown on the tool.
disabledbitmap.nulwxbitmap The wxbitmap object that will be shown on the tool if it is disabled. If this is not supplied it will not be evident that the tool is disabled.
positionCurrent entry count plus oneinteger The place where the tool is to be inserted. By default, it will be appended to the end.
enabled.trueboolean Indicates whether the tool is enabled or disabled.
tooltip.nulstring The text to be used as the tooltip for the control.
name.nulstring This is the name of the tool. It is not required, but can be useful if the tool is to be manipulated using the member (!) operator.

insertform()

Description

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

Prototype

wxtoolbarvar.insertform ( wxform form, integer position, string name )

Parameters
ParameterDefault valueType nameDescription
formNonewxform The wxform object that will be hosted in the tool bar.
positionCurrent entry count plus oneinteger The place where the form is to be inserted. By default, it will be appended to the end.
name.nulstring This is the name of the form tool. It is not required, but it is the only to access the form from the tool bar object; via the member (!) operator and this name.

setbackgroundrgb()

Description

Sets the background color of the tool bar. The wxtoolbar object itself is returned, to allow multiple setting methods to be put into one expression. It is an error to specify both the rgb argument and one or more of the red, green or blue arguments.

Prototype

wxtoolbarvar.setbackgroundrgb ( integer rgb, integer red, integer green, integer blue )

Parameters
ParameterDefault valueType nameDescription
rgbThe current value of the backgroundrgb propertyinteger The new background color of the tool bar. It is inadvisable to specify any value for this argument that is not the value of an existing rgb object.
redThe current value of the backgroundrgb.red propertyinteger The red component in the new background color of the tool bar. This must be between 0 and 255 inclusive.
greenThe current value of the backgroundrgb.green propertyinteger The green component in the new background color of the tool bar. This must be between 0 and 255 inclusive.
blueThe current value of the backgroundrgb.blue propertyinteger The blue component in the new background color of the tool bar. This must be between 0 and 255 inclusive.

setwindow()

Description

Creates the tool bar in the target window.

Prototype

wxtoolbarvar.setwindow ( wxwindow window )

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

wxtoolbar[]

Get

Subscripts

A numeric value giving the 1-based index of an item in the list.

Description

Retrieves the specified item from the wxtoolbar object. The variable that is receiving the object should be declared as type(*), since if not and the tooolbar contains embedded wxform objects, an error will occur when the object is assigned. By checking the type property the type of the object that was returned can be tested. If there is no item at that index position, then .nul will be returned. Once the value .nul has been returned, there are no more items remaining in the toolbar. This is the only way of reliably retrieving all of the elements of a toolbar, since embedded forms only show up in this way, they are not part of the ring of wxtool objects.

Set

Attempting to set the value is not supported.

Set Reference

Attempting to set a reference to an object is not supported.

wxtoolbar!

Get

The member operator followed by the name of a form tool returns a reference to the wxform object. 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 wxtoolbar object using the ! operator is not supported.