com.esri.arcgis.systemUI
Interface IToolBarDef

All Superinterfaces:
Serializable
All Known Implementing Classes:
ControlsEditingToolbar, ControlsFeatureSelectionToolbar, ControlsGlobeGlobeToolbar, ControlsGlobeRotateToolbar, ControlsGraphicElementToolbar, ControlsInkToolbar, ControlsMapNavigationToolbar, ControlsNetworkAnalystToolbar, ControlsPageLayoutToolbar, ControlsSceneSceneToolbar

public interface IToolBarDef
extends Serializable

Provides access to members that define a toolbar.

Remarks

The command bars collection uses command bar definitions (either ToolBarDef or MenuDef) to create command bars. For example, a class that implements IToolbarDef is only a definition for a toolbar; it is not actually a toolbar object. Once this class is registered in one of the command bar component categories, the command bars collection uses the definition of the toolbar in your class to create the actual command bar.

When an end user installs your custom toolbar, you may want this toolbar immediately available in the application so that the user doesn't have to manually display that toolbar before using it. You can add a registry setting to make this toolbar automatically appear the first time the application is run after the installation of your toolbar. In the setup program for your toolbar, you can create a new key under:

HKEY_CURRENT_USER\Software\ESRI\ArcMap\Settings\PremierToolbars

The key name should be the CLSID of the toolbar. You don't have to set a value for this key.

This graphic shows that a custom toolbar has been added to PremierToolbars in the registry.

The PremierToolbars setting is only used the first time the application is started; if the user subsequently hides the toolbar, no further attempts will be made to show the toolbar on application startup. After the application is started once the value of your PremierToolbars key is set to 1 and is then ignored by the application.

If you are working in Visual Basic you can use the ESRI Compile and Register Add-in to set up this registry key.

When To Use

The IToolbarDef interface is used to define the properties of a custom toolbar. When creating your own toolbar, you would implement the IToolBarDef interface in your class code. You can set the caption and name of the toolbar and specify what commanditems are on the toolbar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux


Method Summary
 String getCaption()
          The caption of this toolbar.
 int getItemCount()
          The number of items in this toolbar.
 void getItemInfo(int pos, IItemDef itemDef)
          The CLSID for the item on this toolbar at the specified index.
 String getName()
          The name of this toolbar.
 

Method Detail

getItemCount

int getItemCount()
                 throws IOException,
                        AutomationException
The number of items in this toolbar.

Remarks

When implementing IToolBarDef to create a custom toolbar, use the ItemCount property to specify how many items will be on this toolbar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The numItems
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getItemInfo

void getItemInfo(int pos,
                 IItemDef itemDef)
                 throws IOException,
                        AutomationException
The CLSID for the item on this toolbar at the specified index.

Description

pos represents the locational index number of this item on the toolbar.

itemDef is an IItemDef object that defines the item at this position of the toolbar.

Remarks

When implementing IToolBarDef to create a custom toolbar, use the GetItemInfo method to define what items are on this toolbar. To find the CLSID, ProgID, and subtype of a built-in command or menu in ArcMap or ArcCatalog, refer to the following technical documents:

ArcObjects Developer Help > Technical Documents > ArcMap: Names and IDs of commands and commandbars

ArcObjects Developer Help > Technical Documents > ArcCatalog: Names and IDs of commands and commandbars

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Parameters:
pos - The pos (in)
itemDef - A reference to a com.esri.arcgis.systemUI.IItemDef (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.
See Also:
IItemDef

getName

String getName()
               throws IOException,
                      AutomationException
The name of this toolbar.

Remarks

When implementing IToolBarDef to create a custom toolbar, use the Name property to set the name of this toolbar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCaption

String getCaption()
                  throws IOException,
                         AutomationException
The caption of this toolbar.

Remarks

The Caption property of a toolbar is the string that appears as the toolbar title when the toolbar is in a floating state.

When implementing IToolBarDef to create a custom toolbar, use the Caption property to set the caption of this toolbar.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.