Controller.MouseLocation
I have custom data that I am dragging onto a diagram and I am trying to get the location of the mouse using diagram.Controller.MouseLocation. This seems to be putting invalid data in the x and y locations for my application. Can somebody verify this behavior in a dragdrop event for the diagram with the latest version?
SIGN IN To post a reply.
6 Replies
TL
Truman Lackey
June 8, 2006 04:30 PM UTC
Resolved with:
Dim pt As Point = Me.mainDiagram.PointToClient(New Point(e.X, e.Y))
in the dragdrop event.
If Controller.MouseLocation is not valid anymore for a dragdrop then article:
http://www.syncfusion.com/Support/article.aspx?id=10566
may need updated.
AD
Administrator
Syncfusion Team
July 4, 2006 09:44 AM UTC
Hi,
Yes, you need to use PointToClient() to compute the location of specified screen point into client co-ordinates the within the Diagram.DragDrop() event method. I have updated the KB article with these details. Thanks for pointing out this one. You can verify the updated KB article using the following link - http://www.syncfusion.com/support/kb/diagram/Default.aspx?ToDo=view&questId=38
Thanks,
Meera.
TL
Truman Lackey
July 28, 2006 01:37 AM UTC
Dragdrop on zoomed diagram drops object in wrong position.
Modified DragDrop with zoom tool activation attached.
Any work around for this with 4.1.0.62 would be great.
Truman
Modified DragDrop with zoom tool activation attached.
Any work around for this with 4.1.0.62 would be great.
Truman
vb5.zip
AD
Administrator
Syncfusion Team
August 8, 2006 10:18 AM UTC
Hi Truman,
We regret for this delay in getting back to you.
Thank you for the sample post.We have logged a QA report on this issue .The report id is # 2516 and you can track the progress of this fix by referring the WebBasedTracking system.
Please stay assured that we will do our best to fix the issues at the earliest.
Thank you for your patience.
Regards,
Praveena.
We regret for this delay in getting back to you.
Thank you for the sample post.We have logged a QA report on this issue .The report id is # 2516 and you can track the progress of this fix by referring the WebBasedTracking system.
Please stay assured that we will do our best to fix the issues at the earliest.
Thank you for your patience.
Regards,
Praveena.
TL
Truman Lackey
August 9, 2006 06:14 PM UTC
The following code in 4.1.0.62 seems to be working for the dragdrop example. I have not tested it extensively.
Private Sub diagram1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles diagram1.DragDrop
Dim pt As Point = Me.diagram1.PointToClient(New Point(e.X, e.Y))
Dim vPoint As New PointF(pt.X, pt.Y)
Dim wPoint As PointF = Me.diagram1.View.ViewToWorld(vPoint)
''if this is a bitmap then insert a BitmapNode in Diagram
If e.Data.GetDataPresent(DataFormats.Bitmap) Then
Dim bmpnode As New BitmapNode(CType(e.Data.GetData(DataFormats.Bitmap), Bitmap))
Dim insCmd As New InsertNodesCmd
insCmd.Nodes.Add(bmpnode)
insCmd.Location = wPoint
diagram1.Controller.ExecuteCommand(insCmd)
ElseIf e.Data.GetDataPresent(GetType(TreeNode)) Then
Dim treenode As TreeNode = CType(e.Data.GetData(GetType(TreeNode)), TreeNode)
Dim textnode As New TextNode
textnode.Text = treenode.Text
textnode.SizeToText(New SizeF(0, 0))
textnode.Location = wPoint
Me.diagram1.Model.AppendChild(textnode)
Me.diagram1.Refresh()
End If
End Sub ''diagram1_DragDrop)
Private Sub diagram1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles diagram1.DragDrop
Dim pt As Point = Me.diagram1.PointToClient(New Point(e.X, e.Y))
Dim vPoint As New PointF(pt.X, pt.Y)
Dim wPoint As PointF = Me.diagram1.View.ViewToWorld(vPoint)
''if this is a bitmap then insert a BitmapNode in Diagram
If e.Data.GetDataPresent(DataFormats.Bitmap) Then
Dim bmpnode As New BitmapNode(CType(e.Data.GetData(DataFormats.Bitmap), Bitmap))
Dim insCmd As New InsertNodesCmd
insCmd.Nodes.Add(bmpnode)
insCmd.Location = wPoint
diagram1.Controller.ExecuteCommand(insCmd)
ElseIf e.Data.GetDataPresent(GetType(TreeNode)) Then
Dim treenode As TreeNode = CType(e.Data.GetData(GetType(TreeNode)), TreeNode)
Dim textnode As New TextNode
textnode.Text = treenode.Text
textnode.SizeToText(New SizeF(0, 0))
textnode.Location = wPoint
Me.diagram1.Model.AppendChild(textnode)
Me.diagram1.Refresh()
End If
End Sub ''diagram1_DragDrop)
AD
Administrator
Syncfusion Team
August 10, 2006 01:58 PM UTC
Hi Truman,
We are glad to here that you got the issue resolved. I tested with the Diagram DragDrop sample and the application is working as expected. However we will keep you updated regarding the progress of the defect report.
Thank you for your efforts.
Regards,
Praveena.
We are glad to here that you got the issue resolved. I tested with the Diagram DragDrop sample and the application is working as expected. However we will keep you updated regarding the progress of the defect report.
Thank you for your efforts.
Regards,
Praveena.
SIGN IN To post a reply.
- 6 Replies
- 2 Participants
-
TL Truman Lackey
- Jun 7, 2006 11:55 PM UTC
- Aug 10, 2006 01:58 PM UTC