POST
|
Bump I don't know what could be causing ArcMap not to have the current DataWindows and I can't seem to find any way to get them besides the above described method. Any help would be valuable.
... View more
04-19-2012
10:04 AM
|
0
|
0
|
2
|
POST
|
I have implemented a context menu option which, when clicked, tries to find the current ITableWindow which is being shown to the user. An accepted way of doing this in an addin is to call: //to get a reference to the application IApplicationWindows pApplicationWindows= (IApplicationWindows)ArcMap.Application; //to get the set of data windows ISet pDataWindows = pApplicationWindows.DataWindows; and then you can iterate over the set to check each IDataWindow to see if it has what you want. Below is a link which takes the same approach of iterating over the data windows, checking each one for a particular characteristic (see method FindGraphWindow): http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000081w000000 The problem I'm having is that since I have started using ArcMap 10, the call to pApplicationWindows.DataWindows always returns an empty set. I have tested my ArcMap extension which was migrated to ArcMap 10 and the same issue (via IHookHelper) exists for it. This is working in ArcMap 9.x. Does anyone know why this might be causing this issue in ArcMap 10 and not in ArcMap 9? Any help would be much appreciated.
... View more
04-17-2012
01:12 PM
|
0
|
2
|
538
|
POST
|
Thanks you very much Dubravko. I was able to get this working from the notes you provided. I ended up going with two classes since I did not need a complete form, only a tool I can add to my BaseToolbar: //first class is a Label class containing all of the event handlers I used to have in my ICommand class //second class is: public sealed class ControlAdapter : BaseTool, IToolControl{ private static Label myLabel; public override void OnCreate(object hook){ //init label here } public int hWnd { get { return myLabel.Handle.ToInt32(); } } //all of the events I wanted to handle which are passed to myLabel ... } Basically all I needed was an adapter class to have ArcObjects use a simple windows control. Thank you very much for your help!
... View more
08-22-2011
06:58 AM
|
0
|
0
|
4
|
POST
|
I am Bumping this thread since I have tried to call Refresh and Reset on the ICommandItem that contains the ICommand whose caption has been changed. Neither method will update the gui to the newly set value of the caption (i.e. a call to ICommand.Caption returns a different value). Has anyone had any experience with changing the caption of a command dynamically based on user actions on other commands (e.g. mouse click)? Thanks, Robin
... View more
08-17-2011
10:26 AM
|
0
|
0
|
4
|
POST
|
After changing the ICommand's caption, I was able to get ArcGIS to reread the new Caption value by calling the Reset method on ICommandItem. But for some reason this still does not change the visible text on the button. Does anyone have any idea how to get this to work? I'm not sure why this is so hard to do.
... View more
08-16-2011
04:09 PM
|
0
|
0
|
4
|
POST
|
I am migrating an ArcMap 9.3 extension to version 10. After a particular user action I am changing the caption value for an ICommand instance. In previous versions of ArcObjects this change would be shown to the user immediately. In version 10 the change to the command's caption does not result in any repaint of the gui. To fix this I am calling the Refresh method of the ICommandItem object which holds the ICommand. The API states that calling Refresh will cause "the command item to be redrawn on the CommandBar in order to correctly display any new property changes." Is there something I'm missing?
... View more
08-15-2011
08:15 AM
|
0
|
6
|
109
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|