How to add a button to an existing custom tab

2384
2
03-28-2016 12:00 PM
Highlighted
New Contributor II

In a previous project, I created a custom tab that contains one button that opens a dockpane docked with esri_core_contentsDockPane. In a completely separate C# project, I want to create a new button and add it to the same custom tab. The goal is to have a custom tab for all of our organization's tools - we don't want them in the "Add-In" tab - and to be able to have different programmers add their tools to this custom tab.

Can someone explain the best way to do this with an example config.daml file if possible. Thanks!

0 Kudos
2 Replies
Highlighted
Esri Regular Contributor

Hi April,

Config.daml snippet from addIn one defines the Tab with a group:

... <tabs>

        <tab id="Custom_Tab" caption="My Tab">

          <group refID="TabModule_Group1" />

        </tab>

      </tabs>

      <groups>

        <group id="TabModule_Group1" caption="Group 1" appearsOnAddInTab="false">

          <!-- host controls within groups -->

          <button refID="TabModule_Dockpane1_ShowButton" size="large" />

        </group>

      </groups>...

Config.daml snippet from  addin two inserts a new button within the "Custom Tab" tab defined above:

...<controls>

        <!-- add your controls here -->

        <button id="NewAddin_Button1" caption="New Button" className="Button1" loadOnClick="true" smallImage="Images\GenericButtonBlue16.png" largeImage="Images\GenericButtonBlue32.png">

          <tooltip heading="Tooltip Heading">Tooltip text<disabledText /></tooltip>

        </button>

      </controls>

    </insertModule>

    <updateModule refID="TabModule_Module">

    <groups>

        <updateGroup refID="TabModule_Group1">

          <insertButton refID="NewAddin_Button1"/>

        </updateGroup>

    </groups>

    </updateModule>

  </modules>

</ArcGIS>

Note: Pro processes all the Add-in insertions (new elements) first, followed by modifications to existing elements and lastly the deletion of elements.  Within this, addins are processed alphabetically. So to ensure that your add-in with the tab element loads first, please ensure that it has the lowest id attribute assigned to it. ID attribute is found in the config.daml like this:

<AddInInfo id="{139c1cb5-59ec-4f3e-81ae-2820c15459f3}" version="1.0" desktopVersion="1.3.5536">

    <Name>TabModule</Name>

    <Description>TabModule description</Description>

    <Image>Images\AddinDesktop32.png</Image>

Uma Harano

Desktop SDK Team.

0 Kudos
Highlighted
New Contributor II

Thank you so much for your help Uma...your example worked perfectly!

April

0 Kudos