ProGuide Palettes and Split Buttons - Esri/arcgis-pro-sdk GitHub Wiki

Language:      C#
Subject:       Framework
Contributor:   ArcGIS Pro SDK Team <[email protected]>
Organization:  Esri, http://www.esri.com
Date:          10/06/2024
ArcGIS Pro:    3.4
Visual Studio: 2022

This ProGuide explains the step by step process on how to declare palettes and split buttons. However this is for reference only. The recommended approach is to run the palette and split button item templates.

In this topic

How to declare a tool palette
How to declare a button palette
How to declare a split button


How to declare a tool palette

Tool palettes are ostensibly menus, but designed specifically for grouping a set of related tools together. When a tool is selected from the palette of tools, it becomes the active tool and displays on the collapsed palette.

Tool palettes are defined at the same level as controls in the DAML file.

<groups>
   <group id="sdk_exampleToolPalette" caption="Example Tool Palette" >
      <toolPalette refID="exampleToolPalette" size="middle" />
   </group>
</groups>
<controls>
   <tool id="tool1" className="Tool1" caption="Tool 1" condition="esri_mapping_mapPane"/>
   <tool id="tool2" className="Tool2" caption="Tool 2" condition="esri_mapping_mapPane"/>
</controls>
<palettes>
   <toolPalette id="exampleToolPalette" caption="Example" showItemCaption="true" itemsInRow="1">
      <tool refID="tool1"/>
      <tool refID="tool2"/>
   </toolPalette>
</palettes> 

The first tool listed in the palette is the initial tool displayed in the panel.

How to declare a button palette

Similar to tool palettes, button palettes are designed for grouping a set of related buttons together. When a button is selected from the palette, it is executed and displays on the collapsed palette.

Button palettes are defined at the same level as controls in the DAML file.

<groups>
   <group id="esri_mapping_syncViewGroup" caption="Link">
      <buttonPalette refID="esri_mapping_syncViewExtentPalette" size="large" />
   </group>
</groups>
<controls>
   <button id="esri_mapping_syncCenterButton" className="Ribbon.SyncCenterButton" caption="Center" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/SyncCenter32.png" loadOnClick="false" condition="esri_mapping_mapPane">
      <tooltip heading="">Link all views with the active view by centering on the same point. Scale does not change in the linked views.<disabledText></disabledText></tooltip>
   </button>
   <button id="esri_mapping_syncCenterAndScaleButton" className="Ribbon.SyncCenterAndScaleButton" caption="Center And Scale" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/SyncExtent32.png" loadOnClick="false" condition="esri_mapping_mapPane">
      <tooltip heading="">Link all views with the active view by centering on the same point and displaying at the same scale. 

Rotation of the linked views dynamically changes to match the rotation of the active view.<disabledText></disabledText></tooltip>
   </button>
</controls>
<palettes>
   <buttonPalette id="esri_mapping_syncViewExtentPalette" caption="Link Views" extendedCaption="Open link views palette" keytip="LV" dropDown="false" menuStyle="false" itemsInRow="1" showItemCaption="false">
      <button refID="esri_mapping_syncCenterButton" />
      <button refID="esri_mapping_syncCenterAndScaleButton" />
   </buttonPalette>
</palettes> 

Set the menuStyle attribute to true, if you want your palette to appear as a menu. Set showItemCaption to true to show button captions.

How to declare a split button

Similar to button palettes, split buttons group related buttons together. The associated group displays when the arrow portion of the split button is clicked. Once a control is selected from the drop-down list, it becomes the active control in the split button. Split buttons can contain either basic button controls or galleries.

As per button and tool palettes, split buttons are defined at the same level as controls in the DAML file.

<groups>
  <group id="MyGroup" caption="Group 1" appearsOnAddInTab="true" >
    <splitButton refID="exampleSplitButton"/>
  </group>
</groups>
<controls>
  <button id="button1" caption="Button 1" className="Button1" loadOnClick="false" smallImage="Images\GenericButtonBlue16.png" largeImage="Images\GenericButtonBlue32.png" condition="esri_mapping_mapPane">
    <tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>
  </button>
</controls>

<galleries>
   <gallery id="gallery1" className="MyCustomGallery" caption="Gallery" itemsInRow="1" loadingMessage="Loading..." itemWidth="150" showItemCaption="true" resizable="true">
      <tooltip heading="">Filter<disabledText></disabledText></tooltip>
   </gallery>
</galleries>

<splitButtons>
   <splitButton id ="exampleSplitButton">
      <button refID="button1"/>
      <gallery refID="gallery1"/>
   </splitButton>
</splitButtons>
⚠️ **GitHub.com Fallback** ⚠️