This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, September 6, 2005 4:08:56 AM(UTC)
Groups: Registered
Posts: 11
Does anyone know of a way to specify a different
dialog (or at the very least, specify a different default page in the
standard dialog) for annotations in v14, without going through the
trouble of doing everything manually? I'm using the annotations
automation manager in VB.NET, and I would like to use my own properties
dialog for when a user edits the contents of an annotation.
If that isn't doable, I would at least like to have the Text tab come
up (for the annotations that use it) so that the users (who only really
care about the text anway), won't always have to select the tab first
before editing.
I like the convenience of the automation manager (and definitely don't
want to have to do everything using low-level commands), but it would
be nice to have a custom dialog, if at all possible.
Thankee...
#2
Posted
:
Sunday, September 11, 2005 2:49:55 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
If you are taking about the
properties dialog of the annotation objects inn LEADTOOLS .Net v14, you
can create your custom annotation properties dialog as follows:
1. Create the custom properties dialog (such as Form2).
2. After creating the
AnnAutomationManager object, set the
AnnAutomationManager.ObjectPropertiesDialogType property to the custom
properties dialog that you have created:
+----------------------------------------------+
Private annAutomationManager As annAutomationManager
Public AutomationAnn As AnnAutomation
. . .
Dim x As New Form2
. . .
nnAutomationManager = New AnnAutomationManager
annAutomationManager.CreateDefaultObjects()
annAutomationManager.CreateToolBar()
Controls.Add(annAutomationManager.ToolBar)
annAutomationManager.ObjectPropertiesDialogType = x.GetType()
. . .
+----------------------------------------------+
3. Show the Annotation object properties dialog as follows:
+----------------------------------------------+
automation.StartEditing(automation.CurrentEditObject, False)
If (automation.CanShowObjectPropertiesDialog) Then
automation.ShowObjectPropertiesDialog()
AnnObj2.Name = szMsg ' set the name property to the values that you Got from the custom Dialog
automation.Container.Objects.Add(AnnObj2)
automation.Viewer.Invalidate(AnnObj2.InvalidRectangle)
Else
MessageBox.Show("Cannot show the object properties dialog because no object is currently being edited (selected)")
End If
+----------------------------------------------+
If this explanation did not help you with your question, then please provide us with more information.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#3
Posted
:
Monday, September 12, 2005 4:52:29 AM(UTC)
Groups: Registered
Posts: 11
Ahh, that's what I was looking for. I'm not sure what szMsg is,
but between your code and the sample low-level annotations demo that
came with the toolkit, I should be able to suss it out. Thanks
bunches!!!!
#4
Posted
:
Thursday, November 17, 2005 6:35:33 AM(UTC)
Groups: Registered
Posts: 11
OK, as it turns out, this is a lot trickier than I first thought.
I have made use of your above code to assign a new dialog to the object properties dialog
type, and it shows up when I create or edit annotations (just by setting the type).
However, I have no idea how to get the annotation object's defaults into the dialog. I have an AnnObject variable declared in the dialog, but I see no way from the above code to reference it to the current object being edited. Could you elucidate somewhat on that? And, for that matter, what exactly is szMsg, anyway?
The low-level annotation sample project was useful in that it tells me what fields I need to grab from the AnnObject itself, but it doesn't show how to do it with the automation manager. Any help would be greatly appreciated.
Also, is there any way to make the default object properties dialog (the one that comes with LEADTools) default to the Text tab instead of the first tab on the left?
#5
Posted
:
Monday, November 21, 2005 1:00:23 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
I am attaching a small project
that shows how to change the default annotation properties dialog and
use your custom dialog, then how to retrieve the data (properties) from
the custom dialog and set it to the current annotation object.
About changing the order of the
tabs in the default annotation dialog, I am afraid that you will not be
able to change the order of the tabs in the default annotation dialog.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#6
Posted
:
Monday, November 21, 2005 6:01:36 AM(UTC)
Groups: Registered
Posts: 11
Hi Maen,
Well, we're getting there! The above example is great if I always have my users click a button to edit their annotation info, but what about intercepting the initial annotation creation event, or when they edit the annotation properties from the context menu?
Thanks for your help!
#7
Posted
:
Thursday, November 24, 2005 1:10:07 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
You can show the properties dialog for the new created annotation objects as follows:
Using the same sample project
(LEAD_AnnCustomnt.zip), you will need to handle the
AutomationAnn.CurrentDesignerChanged event as follows:
+--------------------------------------------------------------------+
...
AddHandler AutomationAnn.CurrentDesignerChanged, AddressOf automation_CurrentDesignerChanged
...
Private Sub automation_CurrentDesignerChanged(ByVal sender As Object, ByVal e As EventArgs)
Dim Anndes As AnnEditDesigner
Dim AnnObj As AnnObject
Dim automation As AnnAutomation = DirectCast(sender, AnnAutomation)
If (Not IsNothing(automation.CurrentDesigner) AndAlso TypeOf (automation.CurrentDesigner) Is AnnEditDesigner) Then
Anndes = automation.CurrentDesigner
AnnObj = Anndes.EditObject()
If (automation.CanShowObjectPropertiesDialog) Then
automation.ShowObjectPropertiesDialog()
AnnObj.Name = szMsg
End If
' subscribe to this run designer Run event
End If
End Sub
+--------------------------------------------------------------------+
Thanks,
Maen Badwan
LEADTOOLS Technical Support
#8
Posted
:
Monday, November 28, 2005 8:49:13 AM(UTC)
Groups: Registered
Posts: 11
Heya,
I implemented the above, and while the annotation object DOES get updated after creating the annotation initially, I have the following problems:
- The object properties dialog pops up twice when I create a new annotation. Same thing if I use the "Show Properties" button in your sample project to edit an existing annotation, although I was able to get around that by comenting out the call to ShowProperties in the ObjectPropertiesDialogTest routine (automation.StartEditing seems to be enough to fire off the designer change. Too bad there isn't a coresponding StopEditing method to tell it not to bring it up twice).
- Clicking on an annotation when it is not selected also brings up the dialog. Once the dialog is closed, the annotation follows the cursor (as if I were performing a move operation).
- Getting to the object properties dialog from the context menu still does not update the annotation being edited.
Closer and closer...but not there yet!
Slainte!
-Mike
#9
Posted
:
Monday, December 5, 2005 6:03:16 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
About showing the properties
dialog twice, I checked this issue and you are right; the problem is in
the code AnnAutomation.StartEditing enough for showing the properties
dialog.
Did you use the same demo with the code in the last post on the forum?
About showing the properties dialog from the context menu, I still investigating about this issue.
However, you may try to show
the properties dialog in the AnnAutomation.AfterObjectChanged Event
instead of showing it in the AnnAutomation.CurrentDesignerChanged Event.
Please 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.