LEADTOOLS Support
Document
Document SDK Questions
AnnAutomationObject ContextMenu does not work correctly
This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Sunday, December 17, 2006 11:33:20 PM(UTC)
Groups: Registered
Posts: 8
I create my automation objects manually and I want to have to objects of the same type for example two AnnNoteObject tools. For one of them I want to display the context menu (after right click) so I create it as follows:
noteObj.ContextMenu = manager.CreateDefaultObjectContextMenu(noteObj.Id);
But for the second note object I don't want to display the context menu so I set it to null.
Unfortunatelly the result is that the context menu is always displayed for both object. If I change the objects creation order (for first object context menu is set to null) then the context menu is not displayed for both objects. Of course I create the AnnAutomationObject with different identifiers.
#2
Posted
:
Tuesday, December 19, 2006 4:46:53 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You can supply your own derived class to the
ContextMenu property, and in this class examine which object was being clicked
and decide whether to display the menu or not.
#3
Posted
:
Tuesday, December 19, 2006 4:57:59 AM(UTC)
Groups: Registered
Posts: 8
Could you provide me some example code? Where should I examine (what event) whether the context menu should be displayed or nor?
In my opinion if I set the default menu for a first note object and null for the second note object then the context menu should appear only for first object not for both.
#4
Posted
:
Thursday, December 21, 2006 7:43:23 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You can implement a PopUp event handler for the
ContextMenu class, and in this event examine which object was being clicked and
decide whether to display the menu or not.
I have attached to this post the file "Mianform.cs"
for the "C# annotation automation demo", in which I modified the code
to hide context menu from popping up for any Note object whose text is
"A". To find my modifications search for the word
"NoteMenu".
LEADTOOLS Support
Document
Document SDK Questions
AnnAutomationObject ContextMenu does not work correctly
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.