Product Availability: ArcFM Viewer for ArcGIS Engine, Responder
You may add tools to existing toolbars to the user interface by adding a <Command> tag to a <CommandBar> collection tag.
The following XML is required in the Custom Layout file to add a command to a toolbar (or commandbar). Each command requires a <Command> tag. You may need to add the <CommandBar> tag if it doesn't already exist.
XML Snippet |
Copy Code
|
<CommandManager mdiWindowMenuKey="" dockWindowMenuKey="" showFullMenusDelay="0"
showToolTips="true">
<CommandBars>
<CommandBar key="ArcFMViewer" type="Miner.Windows.ArcGIS.CommandBarArcFmViewer, Miner.Windows.ArcGIS,
Version=9.1.0.0, Culture=neutral, PublicKeyToken=0bbf99e30d318f01" dockedRow="1" dockedColumn="1" dockedPosition="Top" targetPosition="0" floatingLocationX="354" floatingLocationY="362" floatingWidth="233" floatingHeight="24">
<CommandItems>
<CommandItem key="DevMapZoomControl" firstInGroup="false" recentlyUsed="true" visible="true" />
<CommandItem key="DevMapRefreshCommand" firstInGroup="true" recentlyUsed="true" visible="true" />
</CommandItems>
</CommandBar>
</CommandBars>
</CommandManager>
|
- If the <CommandManager> tag doesn't exist, it must be created. See Custom Commands and Controls for attribute information (Engine).
- The <CommandBars> tag contains the toolbars that are visible in the user interface. If this tag doesn't exist, it must be created (see XML code sample below).
- If you are adding a toolbar to the user interface or adding a tool to an existing toolbar, the toolbar's corresponding <CommandBar> tag must exist in the XML. The <CommandBar> tag contains the following attribute values relating to the toolbar:
- Key: A unique identifier for the toolbar. This name is used internally.
- Type: This is the qualified path to the class followed by the assembly name. These two values are separated by a comma.
- Version: The strongly named assembly information. This information is not required for customization.
- Culture: The strongly named assembly information. This information is not required for customization.
- PublicKeyToken: The strongly named assembly information. This information is not required for customization.
- DockedRow: This value determines where in the user interface the toolbar appears.
- DockedColumn: This value determines where in the user interface the toolbar appears.
- DockedPosition: This value determines where in the user interface the toolbar is docked.
- TargetPosition: This value determines the position of the toolbar in relation to its default position.
- FloatingLocationX: This value is the X coordinate for the undocked toolbar.
- FloatingLocationY: This value is the Y coordinate for the undocked toolbar.
- FloatingWidth: This value determines the width of the toolbar while it is floating.
- FloatingHeight: This value determines the height of the toolbar while it is floating.
- Between the <Commands> tags, are <Command> tags for the buttons that will appear on the toolbar. For each button, you will need to add an <Command> tag (highlighted in yellow). This tag holds the following attribute values relating to the buttons (or tools):
- Key: The name of the tool in the Commands collection.
-
FirstInGroup: If this attribute is set to True a group separator is placed before the menu item or tool.
- RecentlyUsed: This value determines whether the command is displayed or hidden. If this field is set to False, the tool will be hidden. If this field is set to True, the command will be displayed.
- Visible: Determines whether the tool is visible.
- Once you have modified the XML file, save and close it.