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
,
integer toolwidth
,
rgb toolheight
,
integer backgroundrgb
)
error
Parameters
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 .
|
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. |
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. |
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
,
wxbitmap bitmap
,
integer disabledbitmap
,
boolean position
,
string enabled
,
string tooltip
)
name
Parameters
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. |
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
,
integer form
,
string position
)
name
Parameters
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. |
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
,
integer rgb
,
integer red
,
integer green
)
blue
Parameters
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. |
setwindow()
Description
Creates the tool bar in the target window.
Prototype
wxtoolbarvar
.setwindow
(
wxwindow
)
window
Parameters
Parameter | Default value | Type name | Description |
---|---|---|---|
window | None | wxwindow | 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.