Maptitude GISDK Help |
A toolbar is a series of controls, defined from left to right or top to bottom. A toolbar can be docked along the top, bottom, or either side of the frame window, or can be undocked, resized and reoriented. Toolbars can be used for shortcut buttons for menu items, or can be used like toolboxes.
Only one toolbar can be used at a time, but several toolbars can be active and alternately shown and hidden using the ShowDbox() and HideDbox(). Toolbars are displayed automatically when they are attached to a window, as described in Attaching Menus and Toolbars. The definition of a toolbar is:
{static} Toolbar "toolbar name" {(arg1, arg2...)}
<dialog box items go here>
endToolbar
If you declare a toolbar static it can only be called from resources within the same resource file in which the toolbar is defined.
In addition to the Title, Help, and Location options allowed in the definition of a dialog box, a toolbar definition can also include the Docked option.
Option |
Description |
Docked: location |
The initial docked position: top, bottom, left, right, or a variable (1, 2, 4, 8) |
You can indicate the initial docked position with the Docked option. For example, to initially dock the toolbox on the bottom, use:
Docked: bottom
You can also use a variable to indicate the position, where 1=top, 2=bottom, 4=left, and 8=right. With a variable, you can both determine and change the position. You can initialize the variable in the Init macro, and you can make the variable a local variable to retain its value.
Toolbars can only have these controls:
Controls in a toolbar are not specified with horizontal or vertical positions. They are automatically arranged from left to right or top to bottom, in the order they appear in the toolbar definition. The position information for a dialog box item defined as part of a toolbar is:
{width {, height}}
A toolbar can use the keyword Separator to indicate a vertical line through the toolbar separating groups of items. This causes the items to be treated as a group during live resizing when the toolbar is undocked.
In all other respects the definition of an item is the same as for a dialog box. For example:
// Here is a File Open push button
Button "File Open" icon:fileopen.bmp do
RunMacro ("Open a File")
endItem
// Here is a popdown menu 20 characters wide
Popdown Menu 20 List: choices Variable: user_choice
In addition to the GISDK functions available for dialog boxes and toolboxes, a default toolbar can also be set with SetDefaults().
GISDK Function |
Summary |
Sets default menus, toolbars, and GISDK macros |
©2025 Caliper Corporation | www.caliper.com |