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.
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.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| toolwidth | 16 | integer | The width of the tool bitmaps. |
| toolheight | 15 | integer | The height of the tool bitmaps. |
| backgroundrgb | The system default color | rgb | The background color for the toolbar. |
| error | .nul | integer |
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.
|
| 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. |
| backgroundrgb | rgb | Specifies the background color of the tool bar. |
| firsttool | wxtool | This property holds a reference to the first tool attached to the tool bar. |
| toolheight | integer | Specifies the height of the wxtool objects. |
| toolwidth | integer | Specifies the width of the wxtool objects. |
| type | type | Specifies the wxtoolbar type object. |
| window | wxwindow | This property holds a reference to the window where the tool bar is hosted. |
Inserts a tool into the tool bar. The wxtoolbar object itself is returned, to allow multiple insertions to be put into one expression.
wxtoolbarvar.insert (
wxbitmap ,
wxbitmap bitmap,
integer disabledbitmap,
boolean position,
string enabled,
string tooltip )
name
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| bitmap | None | wxbitmap | The wxbitmap object that will be shown on the tool. |
| disabledbitmap | .nul | wxbitmap | 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. |
| position | Current entry count plus one | integer | The place where the tool is to be inserted. By default, it will be appended to the end. |
| enabled | .true | boolean | Indicates whether the tool is enabled or disabled. |
| tooltip | .nul | string | The text to be used as the tooltip for the control. |
| name | .nul | string | 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. |
Inserts a form into the tool bar. The wxtoolbar object itself is returned, to allow multiple insertions to be put into one expression.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| form | None | wxform | The wxform object that will be hosted in the tool bar. |
| position | Current entry count plus one | integer | The place where the form is to be inserted. By default, it will be appended to the end. |
| name | .nul | string | 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. |
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.
| Parameter | Default value | Type name | Description |
|---|---|---|---|
| rgb | The current value of the backgroundrgb
property | integer | 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. |
| red | The current value of the
backgroundrgb.red property | integer | The red component in the new background color of the tool bar. This must be between 0 and 255 inclusive. |
| green | The current value of the
backgroundrgb.green property | integer | The green component in the new background color of the tool bar. This must be between 0 and 255 inclusive. |
| blue | The current value of the
backgroundrgb.blue property | integer | The blue component in the new background color of the tool bar. This must be between 0 and 255 inclusive. |
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.



