Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Thursday, September 13, 2007 5:17:31 AM(UTC)
keithway

Groups: Registered
Posts: 29


Hello,

Im on leadtools for .net v14. I want to use my own right click menu so I used the following line of code...

Me._annAuto.Manager.ObjectPropertiesDialogType = GetType(frmTextAnnotationDialog)

This works great except for one little glitch. I've noticed that if I right click on an annotation (but dont select anything) my custom dialog shows up... then if I right click again on the image (while my custom dialog is still showing) then the leadtools default dialog shows up instead. How can I prevent this from happening? How does it even have a handle to this dialog after I set the default dialog to my own?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Thursday, September 13, 2007 7:29:09 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


The objects and the container have different context menus.  The menus for the objects should change just that object, but the one for the container (when you click on the image and not an annotation) is for setting the default object properites. 

Try setting the AnnAutomationManager.ContextMenu property to change the one for the container.

Similarly, if you wanted to set specific context menus for specific objects, change the AnnAutomationObject.ContextMenu
 
#3 Posted : Tuesday, September 18, 2007 10:29:02 AM(UTC)
keithway

Groups: Registered
Posts: 29


Ok this all makes sense but I still have a problem with the Context menu for each object...

(For this example lets just say we're dealing with an AnnNoteObject)

I see you're telling me to set the AnnAutomationObject's context menu... but AnnNoteObject has no context menu and cant be casted to an AnnAutoObject... so can you give me an example of how to change this for a specific AnnNoteObject?
 
#4 Posted : Wednesday, September 19, 2007 4:26:02 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


The AnnAutomationObjects are completely different from the AnnObject derivitives (AnnNoteObject, AnnLineObject, etc.).  Each AnnAutomationObject has an Object property which contains the default AnnObject.  Finally, the AnnAutomationObjects are stored in the AnnAutomationmanger.Objects collection.

You can find an example on using the .NET help file page for "AnnAutomationManager Class".  This will show how to customize the AnnAutomationObjects.  In the example it just uses someting like lineObj.ContextMenu = AnnAutomationManager.CreateDefaultObjectContextMenu(lineObj.Id) but you can easily substitute this line with something like lineObj.ContextMenu = myLineObjContextmenu
 
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.

Powered by YAF.NET | YAF.NET © 2003-2020, Yet Another Forum.NET
This page was generated in 0.117 seconds.