POST
|
This seems to be a bug, so I've opted for a workaround. I was able to get the behavior I needed by using ESRI.ArcGIS.ArcMapUI.IDocumentEvents_OpenDocumentEventHandler. Still, I prefer the OnUpdate() method since it was cleaner. Thanks for the help. -Josh
... View more
03-31-2011
12:17 PM
|
0
|
0
|
314
|
POST
|
The menu does not have an "ondemand" property. The menu is basically just xml tags that ArcMap uses to organize add-in controls on the toolbar. As far as I know the menu is not an object that can be extended or accessed with ArcObjects. Here is a generic example of my Config.esriaddinx code:
<Commands>
<Button id="Setup" class="SetupButton" message="Creates a copy of an mxd and opens opens it" caption="none" image="Images\SetupButton.png" onDemand="false"/>
</Commands>
<Menus>
<Menu id="Data_Prep" caption="Data Prep" isRootMenu="true">
<Items>
<!-- OnUpdate() is NOT called periodically on this Setup button -->
<Button refID="Setup" />
<Button refID="PrepData" />
<Button refID="Load_Data1" />
<Button refID="Load_Data2" />
<Button refID="DeleteData" />
</Items>
</Menu>
</Menus>
<Toolbars>
<Toolbar id="Toolbar" caption="Toolbar" showInitially="false" >
<Items>
<Menu refID="Data_Prep" />
<!-- OnUpdate() is called periodically on this Setup button -->
<Button refID="Setup" />
</Items>
</Toolbar>
</Toolbars>
Thanks, -Josh
... View more
03-31-2011
10:29 AM
|
0
|
0
|
314
|
POST
|
Thanks for the response. I set the ondemaned property to false, but the behavior is the same. The problem is happening after the user clicks the button, so it seems preloading the button shouldn't make a difference. From debugging I can see the OnUpdate() function is only being called when the mouse is clicking or hovering on the drop down menu. The Button's OnUpdate() function is not called when the it is not visible because the dropdown menu is collapsed. Is this expected behavior, a bug? Is there a similar method I can use to periodically check if the mxd has finished opening? Thanks, Josh
... View more
03-31-2011
08:58 AM
|
0
|
0
|
314
|
POST
|
Hello, I created a simple add-in Button that opens a mxd document. The button uses the OnUpdate() event to check when the document is finished opening and then runs some additional code. The Button worked as expected until I moved it's Config.esriaddinx entry from <Toolbar></Toolbar> to a <Menu></Menu> (drop-down menu). Since moving the Button to a drop-down menu, the OnUpdate() function does not get called. However, the OnUpdate() function is eventually called when I click the drop down menu that contains the button. Is this expected behavior for the OnUpdate() event? I'd like to know why the Button's OnUpdate() behavior is different between toolbar UI styles. Thanks, Josh
... View more
03-31-2011
07:07 AM
|
0
|
5
|
2482
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|