Select to view content in your preferred language

2 Buttons and a Ribbon

982
2
Jump to solution
08-18-2017 11:46 AM
BrianBulla
Honored Contributor

So I'm trying to get a MapTool and a Button (compiled in different projects) onto the same Ribbon (not the generic 'Add-In' ribbon.  I have read through the post here, but still need some guidance.  I seem to be able to create either tool on it's own ribbon, but to have both appear on the same one is more challenging.  Here is my Config.daml code for each one.

First One:

<ArcGIS defaultAssembly="StreetView_ArcPro.dll" defaultNamespace="StreetView_ArcPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">

  <AddInInfo id="{5c21165c-68de-45d3-ab9d-ee7174380d4f}" version="1.0" desktopVersion="2.0.8933">

    <Name>StreetView_ArcPro</Name>

    <Description>StreetView_ArcPro description</Description>

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

    <Author>bulla_b</Author>

    <Company>Region of Durham</Company>

    <Date>31/7/2017 9:43:01 AM, 2017</Date>

    <Subject>Framework</Subject>

    <!-- Note subject can be one or more of these topics:

                    Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration -->

  </AddInInfo>

  <modules>

    <insertModule id="StreetView_ArcPro_Module" className="Module1" autoLoad="false" caption="Module1">

      <!-- uncomment to have the control hosted on a separate tab-->

      <tabs>

        <tab id="StreetView_ArcPro_Tab1" caption="Google Street View" keytip="T1">

          <group refID="Google_Streetview_Group" />

        </tab>

      </tabs>

      <groups>

        <!-- comment this out if you have no controls on the Addin tab to avoid

              an empty group-->

        <group id="Google_Streetview_Group" caption="Google Street View" keytip="G1">

          <!-- host controls within groups -->

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

          <tool refID="StreetView_ArcPro_StreetView_Tool" size="large" />         

        </group>

      </groups>

      <controls>

        <!-- add your controls here -->

        <tool id="StreetView_ArcPro_StreetView_Tool" caption="Google Street View" className="StreetView_Tool" loadOnClick="true" smallImage="Images\Google-Earth-icon 16.png" largeImage="Images\Google-Earth-icon 32.png" condition="esri_mapping_mapPane" keytip="B1">

          <tooltip heading="Google Street View Tool">Click on map to show Google Street View location in side panel.<disabledText /></tooltip>

        </tool>

        <button id="StreetView_ArcPro_Dockpane_ShowButton" caption="Open Street View Pane" className="Dockpane_ShowButton" loadOnClick="true" smallImage="Images\open_in_new_window.png" largeImage="Images\open_in_new_window.png" keytip="B2">

          <tooltip heading="Show Side Panel">Click to open/activate Google Street View side panel.<disabledText /></tooltip>

        </button>

      </controls>

      <dockPanes>

        <dockPane id="StreetView_ArcPro_Dockpane" caption="Google Street View" className="DockpaneViewModel" dock="group" dockWith="esri_core_contentsDockPane">

          <content className="DockpaneView" />

        </dockPane>

      </dockPanes>

    </insertModule>

  </modules>

</ArcGIS>

and the Second One:

<ArcGIS defaultAssembly="CardIndex_ArcPro.dll" defaultNamespace="CardIndex_ArcPro" xmlns="http://schemas.esri.com/DADF/Registry" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.esri.com/DADF/Registry file:///C:/Program%20Files/ArcGIS/Pro/bin/ArcGIS.Desktop.Framework.xsd">

  <AddInInfo id="{30619449-054e-498f-9d2f-4bdb06959d30}" version="1.0" desktopVersion="2.0.8933">

    <Name>CardIndex_ArcPro</Name>

    <Description>CardIndex_ArcPro description</Description>

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

    <Author>bulla_b</Author>

    <Company>Region of Durham</Company>

    <Date>17/8/2017 1:24:34 PM, 2017</Date>

    <Subject>Framework</Subject>

    <!-- Note subject can be one or more of these topics:

                    Content, Framework, Editing, Geodatabase, Geometry, Geoprocessing, Layouts, Map Authoring, Map Exploration -->

  </AddInInfo>

  <modules>

    <insertModule id="CardIndex_ArcPro_Module" className="Module1" autoLoad="false" caption="Module1">

      <!-- uncomment to have the control hosted on a separate tab-->

      <tabs>

        <!--<tab id="CardIndex_ArcPro_Tab1" caption="New Tab">

          <group refID="CardIndex_ArcPro_Group1"/>

        </tab>-->

      </tabs>

      <groups>

        <!-- comment this out if you have no controls on the Addin tab to avoid

              an empty group  ***  CardIndex_ArcPro_Group1-->

        <group id="CardIndex_ArcPro_Group1" caption="Map Tools" appearsOnAddInTab="true">

          <!-- host controls within groups -->

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

        </group>

      </groups>

      <controls>

        <!-- add your controls here -->

        <button id="CardIndex_ArcPro_CardIndex_Button" caption="Card Index" className="CardIndex_Button" loadOnClick="true" smallImage="Images\ace-logo2.png" largeImage="Images\ace-logo2.png">

          <tooltip heading="Card Index Tool:">Opens scanned drawing for selected WaterMain and Sewer Pipes.<disabledText /></tooltip>

        </button>

      </controls>

    </insertModule>

  </modules>

</ArcGIS>

I don't really care if the first one goes on the second one, or the second one goes on the first one.  If someone could please explain the logic behind this is supposed to work, and some code hints/fixes I would appreciate it.


Thanks!

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

Hi Brian

You can use the "dependencies" tag in daml to accomplish what you need.  You can read about this on this wiki: ProConcepts Advanced Topics: Control Order of loading using DAML 

Also-

To update one of your "Groups" (defined in one add-in) with a button from another add-in you will have to use the "UpdateModule" tag.  There is a sample WorkingWithDaml that does this. 

A little more info about "UpdateModule" from ProConcepts: Framework:

Note: DAML elements within one file can alter or remove elements in other files. For example, an add-in may simply inject a single button into a ribbon group defined by another add-in. The following example shows a button being added to an existing tab beside a specific control:

<updateModule refID="esri_mapping">   
   <groups>     
      <updateGroup refID="esri_mapping_navigateGroup">       
         <insertButton refID="acme_FullExtent" insert="before" placeWith="esri_mapping_zoomFullButton" separator="true"/>    
      </updateGroup>   
   </groups> 
</updateModule>

Thanks

Uma

View solution in original post

2 Replies
UmaHarano
Esri Regular Contributor

Hi Brian

You can use the "dependencies" tag in daml to accomplish what you need.  You can read about this on this wiki: ProConcepts Advanced Topics: Control Order of loading using DAML 

Also-

To update one of your "Groups" (defined in one add-in) with a button from another add-in you will have to use the "UpdateModule" tag.  There is a sample WorkingWithDaml that does this. 

A little more info about "UpdateModule" from ProConcepts: Framework:

Note: DAML elements within one file can alter or remove elements in other files. For example, an add-in may simply inject a single button into a ribbon group defined by another add-in. The following example shows a button being added to an existing tab beside a specific control:

<updateModule refID="esri_mapping">   
   <groups>     
      <updateGroup refID="esri_mapping_navigateGroup">       
         <insertButton refID="acme_FullExtent" insert="before" placeWith="esri_mapping_zoomFullButton" separator="true"/>    
      </updateGroup>   
   </groups> 
</updateModule>

Thanks

Uma

BrianBulla
Honored Contributor

Hi Uma,

Thanks so much!!  After reading through the articles, I now understand how things are working and was able to get it fixed.

0 Kudos