Custom toolbars

To present a group of tool buttons that represent built-in commands, user-defined commands, or a combination of both, use a custom toolbar. Custom toolbars can also contain drop-down tool buttons that support multiple commands. When the arrow on a drop-down tool button is clicked, the button displays a menu of additional tool buttons instead of launching a command. Clicking a tool button in the menu launches the button's command. The following screen shot shows a custom toolbar that contains a combination of user-defined commands, drop-down tool buttons, and built-in commands:

Screen shot of a custom toolbar.commands: Screen

Toolbars are represented by toolbar objects in the ArcPad object model and by TOOLBAR elements in ArcPad XML.

Attributes

The following toolbar attributes are set at design time in ArcPad Studio in the Toolbar dialog box. They cannot be changed at run time (some attributes have corresponding properties that can be accessed and changed at run time). Attributes are written to the customization file (.apa or arcpad.apx) in ArcPad XML format.

Events

Toolbars do not generate events.

Properties

Toolbar properties can be read and set at run time via scripts. The following toolbar properties are available:

Methods

Toolbar methods can be called at run time via scripts. The following toolbar method is available:

Reference a toolbar

You can reference any toolbar that is currently loaded, regardless of whether or not it is visible. You reference a toolbar via its name. For example, to reference a toolbar named "tlbTools", see the following sample code:

VBScript

Dim objToolbar
Set objToolbar = Application.Toolbars("tlbTools")

JScript

var objToolbar = Application.Toolbars("tlbTools");

Python

objToolbar = Application.Toolbars("tlbTools")
NoteNote:

The names of the default toolbars are as follows:

  • Main Toolbar (Main)
  • Browse Toolbar (Browse)
  • Edit/Draw Toolbar (Draw)
  • QuickCapture Toolbar (QuickCapture)
  • Navigation Toolbar (Navigation)
Your scripts can toggle the visibility of a default toolbar and click buttons on a default toolbar, but that's the extent of the interaction between scripts and the default toolbars.

Display or hide a toolbar

To display or hide a toolbar, reference the toolbar and set its Visible property to true or false, respectively. For example, to display a toolbar named "tlbTools", see the following sample code:

VBScript

Application.Toolbars("tlbTools").Visible = True

JScript

Application.Toolbars("tlbTools").Visible = true;

Python

Application.Toolbars("tlbTools").Visible = True

To hide the same toolbar, see the following sample code:

VBScript

Application.Toolbars("tlbTools").Visible = False

JScript

Application.Toolbars("tlbTools").Visible = false;

Python

Application.Toolbars("tlbTools").Visible = False

Change a toolbar's caption

To change a toolbar's caption, reference the toolbar and set its Caption property to the desired text string. For example, to change the caption of a toolbar named "tlbTools" to "New Caption", see the following sample code:

VBScript

Application.Toolbars("tlbTools").Caption = "New Caption"

JScript

Application.Toolbars("tlbTools").Caption = "New Caption";

Python

Application.Toolbars("tlbTools").Caption = "New Caption"

2/7/2013