Select to view content in your preferred language

Inline dynamic menu fails to open or causes crash in ArcGIS Pro 3.4

197
4
Jump to solution
11-19-2024 01:41 PM
Justin_ODell
Occasional Contributor

In ArcGIS Pro 3.4, adding an inline dynamic menu, below another menu item, to an existing menu causes errors (It works fine the first time it's parent menu is opened, but either it prevents the menu from opening when clicked a second time, or it crashes pro).

It seemed to work without problems in Pro 3.3 (and earlier). It also appears to work if the dynamic menu is not inline (ie. a pull right menu).  The dynamic menu seems to work fine if it's directly in the ribbon group too.
 

Has anyone else experienced this issue?  Any idea why it happens?  Suggestions for workarounds?  Is it something that will be fixed in a future release?


Thanks much!

Here's the .daml and .cs code from my sample.
.daml:

 

  <modules>
    <insertModule id="ProAppModule4_dynamicMenu_Module" className="Module1" autoLoad="false" caption="Module1">
      <groups>
        <group id="ProAppModule4_dynamicMenu_Group1" caption="Group 1" appearsOnAddInTab="true">
          <menu refID="ProAppModule4_parent_Menu1" size="middle" />
          <dynamicMenu refID="ProAppModule4_DynMenu1" separator="true" />
        </group>
      </groups>
      <controls>
        <dynamicMenu id="ProAppModule4_DynMenu1" caption="Menu Items" className="DynMenu1"  smallImage="GenericButtonGreen16" largeImage="GenericButtonGreen32">
        </dynamicMenu>
        <button id="ProAppModule4_Button1" caption="Menu Button 1" className="Menu1_button1" loadOnClick="true" smallImage="GenericButtonGreen16" largeImage="GenericButtonGreen32">
          <tooltip heading="Menu Button 1">ToolTip<disabledText /></tooltip>
        </button>
      </controls>
      <menus>
        <menu id="ProAppModule4_parent_Menu1" caption="Inline Menu 1" smallImage="GenericButtonGreen16" largeImage="GenericButtonGreen32">
          <button refID="ProAppModule4_Button1" />
          <dynamicMenu refID="ProAppModule4_DynMenu1" separator="true" inline="true" />
        </menu>
      </menus>
    </insertModule>
  </modules>

 


.cs:

 

    internal class DynMenu1 : DynamicMenu
    {
        protected override void OnPopup()
        {
            for (int i = 0; i < 3; i++)
            {
                this.Add(i + " item");
            }
        }

        protected override void OnClick(int index)
        {
            MessageBox.Show($"Button {index} Clicked!");
        }
    }

    internal class Menu1_button1 : Button
    {
        protected override void OnClick()
        {
        }
    }

 

 

0 Kudos
1 Solution

Accepted Solutions
UmaHarano
Esri Regular Contributor

This is a bug. It will be addressed in 3.5 and also in a service pack for 3.4.

In the meantime, as a workaround, you can remove the separators. The separators are causing the crash.

Thanks again for reporting this issue.

View solution in original post

0 Kudos
4 Replies
UmaHarano
Esri Regular Contributor

@Justin_ODell 

Thanks for reporting this issue. I will post back as soon as I have more information on this issue.

0 Kudos
UmaHarano
Esri Regular Contributor

This is a bug. It will be addressed in 3.5 and also in a service pack for 3.4.

In the meantime, as a workaround, you can remove the separators. The separators are causing the crash.

Thanks again for reporting this issue.

0 Kudos
Justin_ODell
Occasional Contributor

Thanks for investigating/confirming Uma!

Is there a bug number associated with this that I could follow? Thanks!

0 Kudos
UmaHarano
Esri Regular Contributor

The bug number is BUG-000172868.

 

0 Kudos