Name: | ToolBar |
Version: | 1.0 |
ID: | ID_TOOLBAR |
Status: | Beta |
Category: | GUI |
Date: | November 2003 |
Author: | Rocklyte Systems |
Copyright: | Rocklyte Systems, 2003. All rights reserved. |
Short: | The ToolBar class is used to create and manage groups of toolbars. |
The ToolBar class creates and manages the use of toolbars in application interfaces. A toolbar is a horizontal or vertical strip of items, each of which performs a specific function. Each item is presented as a button that contain an icon image, text string or combination of both.
The definitions for the toolbar are loaded by default from the environment file "templates:toolbardef.xml". You can change the template file prior to initialisation by setting the Template field. Note that any values set in the template will override your original field settings for the toolbar.
Items can be added to the toolbar using XML (recommended for scripting) or the AddToolItem method. Once you have built the toolbar structure, it will become functional as soon as you display it. The following example illustrates how you might create a toolbar using DML code:
<toolbar x="[owner.leftmargin]" y="[owner.topmargin]" xoffset="[owner.rightmargin]" height="24"> <xml-translate> <item text="Cut" tip="Cut" icon="tools/cut"> <action object="[fileview]" method="cutfiles"/> </item> <item text="Copy" tip="Copy" icon="tools/copy"> <action object="[fileview]" method="copyfiles"/> </item> <item text="Paste" tip="Paste" icon="tools/paste"> <action object="[fileview]" method="pastefiles"/> </item> </xml-translate> </toolbar>
The ToolBar class supports the following actions:
Activate Activates the currently selected item in the toolbar. Disable Turns the entire toolbar off. Enable Turns the toolbar on if it has been disabled. Focus Sets the focus on the toolbar and activates keyboard monitoring. Hide Removes the toolbar from the display. LostFocus Removes the focus from the toolbar and disables key monitoring. MoveToBack Moves the toolbar to the back of the display area. MoveToFront Moves the toolbar to the front of the display area. Redimension Changes the size and position of the toolbar. Resize Alters the size of the toolbar. Show Puts the toolbar on display. UserClick Emulates a user click on the toolbar. UserClickRelease Emulates a user click-release on the toolbar. UserMovement Emulates user movement over the toolbar.
The ToolBar class implements the following methods:
AddToolItem Adds a new item to the toolbar. DisableItem Disables a toolbar item. EnableItem Enables a toolbar item that has been earlier disabled. RemoveItem Removes an item from the toolbar.
The ToolBar object consists of the following public fields:
Bottom The bottom coordinate of the toolbar. Drawable The drawable that will contain the toolbar graphic. Flags Optional flags may be set here. Height Defines the height of a toolbar. Highlight String-based field for setting the toolbar highlight. HighlightRGB Defines border highlight of the toolbar, in RGB format. Right The right coordinate of the toolbar. Shadow String-based field for setting the toolbar shadow. ShadowRGB Defines border shadow of the toolbar, in RGB format. TabFocus Setting this field to a valid TabFocus object will cause the toolbar to add itself to the tab list. Template Defines the makeup of the toolbar using a pre-defined template. Thickness The thickness of the toolbar border. Width Defines the width of a toolbar. XCoord The horizontal position of a toolbar. XOffset The horizontal offset of a toolbar. YCoord The vertical position of a toolbar. YOffset The vertical offset of a toolbar.
Method: | DisableItem() | |||||||
Short: | Disables a toolbar item. | |||||||
Arguments: |
| |||||||
|
Method: | EnableItem() | |||||||
Short: | Enables a toolbar item that has been earlier disabled. | |||||||
Arguments: |
| |||||||
|
Method: | RemoveItem() | |||||||
Short: | Removes an item from the toolbar. | |||||||
Arguments: |
| |||||||
|
Field: | Bottom | |
Short: | The bottom coordinate of the toolbar. | |
Type: | LONG | |
Status: | Get | |
|
Field: | Drawable | |
Short: | The drawable that will contain the toolbar graphic. | |
Type: | OBJECTID | |
Status: | Read/Init | |
|
Field: | Flags | |||||||||
Short: | Optional flags may be set here. | |||||||||
Type: | LONG | |||||||||
Status: | Read/Init | |||||||||
|
Field: | Height | |
Short: | Defines the height of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | Highlight | |
Short: | String-based field for setting the toolbar highlight. | |
Type: | STRING | |
Status: | Set | |
|
Field: | HighlightRGB | |
Short: | Defines border highlight of the toolbar, in RGB format. | |
Type: | RGB | |
Status: | Read | |
|
Field: | Right | |
Short: | The right coordinate of the toolbar. | |
Type: | LONG | |
Status: | Get | |
|
Field: | Shadow | |
Short: | String-based field for setting the toolbar shadow. | |
Type: | STRING | |
Status: | Set | |
|
Field: | ShadowRGB | |
Short: | Defines border shadow of the toolbar, in RGB format. | |
Type: | RGB | |
Status: | Read | |
|
Field: | TabFocus | |
Short: | Setting this field to a valid TabFocus object will cause the toolbar to add itself to the tab list. | |
Type: | OBJECTID | |
Status: | Set | |
|
Field: | Template | |
Short: | Defines the makeup of the toolbar using a pre-defined template. | |
Type: | STRING | |
Status: | Init | |
|
Field: | Thickness | |
Short: | The thickness of the toolbar border. | |
Type: | LONG | |
Status: | Read/Write | |
|
Field: | Width | |
Short: | Defines the width of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | XCoord | |
Short: | The horizontal position of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | XOffset | |
Short: | The horizontal offset of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | YCoord | |
Short: | The vertical position of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|
Field: | YOffset | |
Short: | The vertical offset of a toolbar. | |
Type: | DOUBLE/PERCENTAGE | |
Status: | Get/Set | |
|