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 : Sunday, February 19, 2006 11:58:00 PM(UTC)
csyemily

Groups: Registered
Posts: 9


I am adding a Text object to the automation annotation toolbar by creating an AnnTextObject to the AnnAutomationManager.AnnAutomationObject. When trying to draw a text object in the rasterimageviewer, the properties dialog of the text object display. How can i disable this dialog window (i.e. when adding a text object, i don't want this property dialog to be displayed).

I am using LeadTools version 14.5

Thanks.

 

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 : Monday, February 20, 2006 11:06:41 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

There are two types of the context menu:
1. The context menu for an
AnnAutomation Object: The Context Menu is displayed whenever an
annotation object associated with this automation object is
right-clicked by the mouse in design mode. You disable this menu by setting its value to null.

2. Main automation context
menu: This is the menu that appears when the user clicks anywhere on a
container but not on any of the objects currently in the container. To
disable this menu you can set the nnAutomationManager.ContextMenu
Property to null to disable this menu. You disable this menu by setting its value to null.


For more information, please refer to the following topics in the LEADTOOLS .Net documentation:
- AnnAutomationObject.ContextMenu Property
- AnnAutomationManager.ContextMenu Property

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Friday, February 24, 2006 4:54:46 AM(UTC)
csyemily

Groups: Registered
Posts: 9


I am trying to disable the context menu when using TextObject as follow:

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' Type the path of the Leadtools Bin folder.
        RasterCodecs.CodecsPath = "C:\Program Files\LEAD Technologies, Inc\LEADTOOLS EVAL 14.5\Bin\Dotnet\v11"

        ' intitialize a new RasterCodecs object
        Dim codecs As RasterCodecs = New RasterCodecs

        ' load the main image into our viewer
        RasterImageViewer1.Image = codecs.Load("C:\mages\sample1.cmp")

        If (Not IsNothing(RasterImageViewer1.Image)) Then
            ' create and setup the automation manager
            annAutomationManager = New AnnAutomationManager

            ' Instruct the manager to create the default (all) automation objects.
            annAutomationManager.CreateDefaultObjects()

            ' create the toolbar and add it to the form
            annAutomationManager.CreateToolBar()
            ''annAutomationManager.ContextMenu = Nothing

            For Each obj As AnnAutomationObject In annAutomationManager.Objects
                ' for each tool
                obj.UseRotateControlPoints = True
                'obj.ContextMenu = Nothing

                If obj.Id = annAutomationManager.TextObjectId Then
                    obj.ContextMenu = Nothing
                End If
            Next obj

            Controls.Add(annAutomationManager.ToolBar)

            ' setup the automation (will create the container as well)
            Dim automation As AnnAutomation = New AnnAutomation(annAutomationManager, RasterImageViewer1)

            ' setup this automation as the active one
           automation.Active = True
        End If
    End Sub
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

However, after compiling the project, when i select the textobject item from the menu and start draw the text box in the rasterimageviewer, the properties dialog of the textobject still display automatically. Is anything incorrect ?????[:'(]

 
#4 Posted : Monday, February 27, 2006 3:37:52 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

Please try the following:

- To disable the main automation context menu
+------------------------------+
annAutomationManager.ContextMenu = Nothing
+------------------------------+

- To disable the object's properties dialog:
+------------------------------+
annAutomationManager.ObjectPropertiesDialogType = Nothing
+------------------------------+

- To disable the context menu for each AnnAutomationObject:
+------------------------------+
Dim x As Integer
For x = 0 To 28
annAutomationManager.Objects(x).ContextMenu = Nothing
Next
+------------------------------+

If you face any problem, please let me know.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Tuesday, February 28, 2006 10:45:20 AM(UTC)
achandra

Groups: Registered
Posts: 17


How to reenable the properties dialog again after we disable it? It seems that after we set the ObjectPropertiesDialogType = nothing, the objectProperties remain disable.

Thanks
 
#6 Posted : Thursday, March 2, 2006 12:16:53 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

Do you mean that you want to return to the default ObjectPropertiesDialog?
However, you may try to do the following:
- Before disabling the ObjectPropertiesDialog, declare a form type (System.Windows.Forms.Form) variable and assign the AnnAutomationManager.ObjectPropertiesDialogType Property to it:
+-------------------------------+
Form1 = AnnAutomationManager.ObjectPropertiesDialogType
+-------------------------------+

- Diable the ObjectPropertiesDialogType property:
+-------------------------------+
ObjectPropertiesDialogType = nothing
+-------------------------------+

- When you want to retrive the ObjectPropertiesDialog, do the following:
+-------------------------------+
AnnAutomationManager.ObjectPropertiesDialogType = Form1
+-------------------------------+

Please try the above instructions and let me know what will happen with you.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#7 Posted : Friday, March 3, 2006 7:22:48 AM(UTC)
achandra

Groups: Registered
Posts: 17


I tried the above instruction in C#.

I cannot convert System.type into System.Windows.Forms.Form.

Since ObjectPropertiesDialog has a type "System.Type", we cannot save it under System.Windows.Forms.Form

So far, it did not work for me.
 
#8 Posted : Monday, March 6, 2006 5:07:37 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

Was thanked: 1 time(s) in 1 post(s)

Hello,

Please try to declare a temp type object to hold the ObjectPropertiesDialogType Property, and then disable it. When you want to enable the property again, reassign the temp type object to the ObjectPropertiesdialogType Property. The code will be something like follows:
+------------------------------------+
Dim ObjectPropertiesDialogType1 As System.Type
...
ObjectPropertiesDialogType1 = annAutomationManager.ObjectPropertiesDialogType
annAutomationManager.ObjectPropertiesDialogType = Nothing 'disable
annAutomationManager.ObjectPropertiesDialogType = ObjectPropertiesDialogType1' enable
...
+------------------------------------+

Please try the above instructions and let me know what will happen with you.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
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-2019, Yet Another Forum.NET
This page was generated in 0.233 seconds.