Select to view content in your preferred language

ArcGIS 10: Add Group Separator to CommandBar

2628
3
06-27-2011 11:48 PM
BerndNierula
Emerging Contributor
Hi

I have a problem migrating code to version 10, which defines a custom commandbar where some group separators are placed using the "BeginGroup ();" command in the Commandbars class. Now custom commandbars are defined in XML, no code behind class available.

Please can You give me some directions how I can insert some group separators into a custom commandbar.

Thanks a lot in advance

Regards


Bernd Nierula
0 Kudos
3 Replies
DuncanHornby
MVP Notable Contributor
Bernd,

You create the separators in the XML section, see highlighted code below which I have copied out on an existing project of mine.

Duncan

<Menus>
<Menu id="GeoData_Institute_EMU_Side_Scan_Editing_Toolbar_Conversion" caption="Processing Tasks" isRootMenu="true">
<Items>
<Button refID="GeoData_Institute_EMUTool_btnCreatePoints" />
<Button refID="GeoData_Institute_EMUTool_btnCreatePolylines" />
<Button refID="GeoData_Institute_EMUTool_btnCreatePolygons" />
<Button refID="GeoData_Institute_EMUTool_btnNearestModel" separator="true" />
<Button refID="GeoData_Institute_EMUTool_btnMerge"/>
<Button refID="GeoData_Institute_EMUTool_btnSymbology" separator="true" />
<Button refID="GeoData_Institute_EMUTool_btnJoinTable" separator="true" />
<Button refID="GeoData_Institute_EMUTool_btnExport" separator="true" />
</Items>
</Menu>
</Menus>
<Toolbars>
<Toolbar id="GeoData_Institute_EMU_Side_Scan_Editing_Toolbar_EMU_Sidescan_Editing" caption="EMU Anomaly Editing Toolbar" showInitially="false">
<Items>
<Menu refID="GeoData_Institute_EMU_Side_Scan_Editing_Toolbar_Conversion" />
<Button refID="esriArcMapUI.SelectFeaturesTool" separator="true" />
<Button refID="esriControls.ControlsMapIdentifyTool" />
<Button refID="esriArcMapUI.HyperlinkTool" />
<Button refID="GeoData_Institute_EMUTool_btnGroupPoints" separator="true" />
<Button refID="GeoData_Institute_EMUTool_btnGroupPolylines" />
<Button refID="GeoData_Institute_EMUTool_btnGroupPolygons" />
<Button refID="GeoData_Institute_EMUTool_btnDelete" separator="true" />
<Button refID="GeoData_Institute_EMUTool_btnHelp" separator="true" />
</Items>
</Toolbar>
</Toolbars>
</ArcMap>
0 Kudos
BerndNierula
Emerging Contributor
Hi Duncan

Thank You for your reply.

Unfortunately I don't define the Toolbar in the XML, but I add Tools and commands programmatically using IcommandBar.Add (). Unfortunately at this level I cannot find any AddSeparator () command..

Do you have any advice on this?

Thanks a lot

Bernd
0 Kudos
DuncanHornby
MVP Notable Contributor
Bernd,

Looking at the help the Add method on IcommandBar is adding an object of type ICommandItem which has a property Group that creates the separator. I don't think you simply add a separator you say if the item is the start of a new group.

Duncan
0 Kudos