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()
{
}
}
Solved! Go to Solution.
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.
Thanks for reporting this issue. I will post back as soon as I have more information on this issue.
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.
Thanks for investigating/confirming Uma!
Is there a bug number associated with this that I could follow? Thanks!
The bug number is BUG-000172868.