Arrange tools on Custom Ribbon

315
12
Jump to solution
11-28-2018 06:26 AM
Highlighted
Regular Contributor

Hi,

Just wondering what the best way would be to arrange tools on a Custom Ribbon.  There doesn't seem to be a way for the end-user to do it through the ArcPro GUI, so does this have to be done through DAML code??

Here is what I currently have;  one custom ribbon, divided into two groups.  The first group (Map Tools) I'd like to arrange alphabetically in ASC order.  The second group I would like to arrange in a specific order specified by the numbers in the pic.

For either group, tools will be added going forward, so I'd like the first group to remain alphabetic and then be able to squeeze tools into the right place for the second group as I create them.

I create each tool as a separate VS2015 project.  The toolbar is it's own project.  In each tool I create I have a DAML <dependancies> setup so that things get loaded onto the toolbar after the toolbar loads.

  <dependencies>
    <dependency name="{9466cc69-3fce-4774-8134-d94377460abd}" />
    <!-- id of "DSM_Toolbar_ArcPro" -->
  </dependencies>

Then I also have code to place each tool into the proper group.

    <updateModule refID="DSM_Toolbar_ArcPro_Module">
      <groups>
        <updateGroup refID="Editing_Tools_group">
          <insertButton refID="ToFromTool_ArcPro_btnToFromTool"></insertButton>
        </updateGroup>
      </groups>
    </updateModule>

I'm stuck at trying to figure out how to get the buttons in the order I desire.

Thanks,

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

Hi Brian,

"insertButton" has properties to specify order :

<menus>

   <updateMenu refID="exampleMenu">

      <insertButton refID="menuItem2a" placeWith="menuItem2" insert="after"/>

   </updateMenu>

</menus>

ProConcepts Framework · Esri/arcgis-pro-sdk Wiki · GitHub 

View solution in original post

12 Replies
Highlighted
Regular Contributor

Hi Brian,

"insertButton" has properties to specify order :

<menus>

   <updateMenu refID="exampleMenu">

      <insertButton refID="menuItem2a" placeWith="menuItem2" insert="after"/>

   </updateMenu>

</menus>

ProConcepts Framework · Esri/arcgis-pro-sdk Wiki · GitHub 

View solution in original post

Highlighted
Regular Contributor

Excellent....thanks!

0 Kudos
Highlighted
Regular Contributor

Also....do you know if there is a way for the end user to sort buttons on a ribbon??  With ArcMap this was possible by just dragging/dropping when in 'Customize' mode.

0 Kudos
Highlighted
Regular Contributor

Project->Options->Customize the Ribbon

0 Kudos
Highlighted
Regular Contributor

Hmmm.....ok.  I have tried to order things using that window, but I just realized now how to actually do it.  It's not very intuitive, but now that I think I have figured it out, it still isn't working.

So on the left are my tools, and on the right is the toolbar.  I have organized them as desired on the right, but after clicking on OK, my toolbar is totally messed up with tools not even showing up anymore.

Each time I do it, I seem to get different results.  

Are you aware of any issues with doing this??

0 Kudos
Highlighted
Regular Contributor

Things look to be really messed up now.  If I remove all of my Add-Ins via the 'Add-In Manager' and also delete anything in my documents\ArcGIS\AddIns\ArcGISPro folder, ArcPro opens without anything....as expected.

But, then when i go to re-add everything again I still cannot get the Add-Ins to show up in ArcPro.  Something permanent seems to have happened through the Options->Customize the Ribbon window that has messed things up.

Any advice on how to get things back??

0 Kudos
Highlighted
Regular Contributor

Add-In Manager uninstalls your *.esriAddinX files content. This means deletes content files from Add-ins folder. So you need to find in explorer where is located your original *.esriAddinX files and double click on them. Standalone Add-in manager will ask you to install Add-ins. *.esriAddinX is the zip file. You can examine content by renaming file extension to zip.

0 Kudos
Highlighted
Regular Contributor

Doesn't seem to matter.  Using 'Add-In Manager' to point to the files, or installing them locally by double clicking.  Either way they are not showing up properly in ArcPro anymore.

I've tested on another desktop, and they show up fine on that one.

Using the 'Customize the Ribbon' must have triggered something, and messed things up.  I will try an uninstall/reinstall of ArcPro and see if that clears things up.

My Add-Ins are installed:

But I cannot seem to control how they are displayed any more.  Add/Remove to the right side does not seem to work.

Rich Ruh‌:  Any ideas what might be happening here??

0 Kudos
Highlighted
Regular Contributor

When you use the "customize the ribbon (Options)" interface, re-ordering of sub-elements under existing tabs or groups is not supported. In other words if a tab or a group is defined in DAML (either out-of-box or through an Add-in / Configuration) the order cannot be customized, instead the order is dictated by the DAML.  If you add a new group or tab through the customize the ribbon (Options) interface then you can re-order those sub-elements.  This is done by using the up / down arrow buttons on the right side of the dialog (note that these buttons are only enabled if re-ordering is supported).  Using the customize the ribbon interface you can also Remove sub-elements as part of the customization, or you can Add new elements to an existing tab or group. 

You cannot delete a button on the top (order) of a group and then add the same button on the bottom of the same group since DAML is transactional and deletes are done last (for that group) and hence the button is deleted from the group.

Also to get back you to the original ribbon configuration (as defined in the DAML) you can use the 'Customization Reset' drop down to reset either all or a sub-selection of the ribbon. 

Not sure what happened on your screenshot, but the 'customization reset' should have cleared everything.