Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Diagram NodeModified event has MousePosition = 0,0 (Read 2964 times)
gea
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Apr 2nd, 2008
Diagram NodeModified event has MousePosition = 0,0
Apr 2nd, 2008 at 3:51pm
Print Post  
When I select and move a single box, NodeModified is fired once and e.MousePosition appears to be valid.  But when I select and move more than one box, NodeModified fires for each box and is passed e.MousePosition = 0, 0.  I was hoping to use the mouse position where the edit ended.  I also don't see any Diagram property where I could query it.   I have Mindfusion.Diagramming 5.0.3.29403.  It has taken me a while to port my old v4 FlowChart code and understand this change, and I don't have time to strip my code down to a simple example.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram NodeModified event has MousePosition =
Reply #1 - Apr 2nd, 2008 at 5:45pm
Print Post  
MousePosition usually specifies where the adjustment handle has been dropped, but since in multiple selection there isn't any handle associated with the operation, the argument is not set. You can always find the current mouse position as below:

Point screenPos = Control.MousePosition;
Point clientPos = diagView.PointToClient(screenPos);
PointF diagPod = diagView.ClientToDoc(clientPos);

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
gea
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 6
Joined: Apr 2nd, 2008
Re: Diagram NodeModified event has MousePosition =
Reply #2 - Apr 2nd, 2008 at 5:58pm
Print Post  
Thanks.  I was hoping Diagram, not DiagramView, had the functionality I needed.  In this case, it seems like it was unnecessary to decouple v4 FlowChart into Diagram and DiagramView.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Diagram NodeModified event has MousePosition =
Reply #3 - Apr 2nd, 2008 at 6:42pm
Print Post  
This is just a minor inconvenience, while the decoupling has some great advantages, at least from our point of view. Independence from Windows Forms lets you use the diagramming API from services or console applications, e.g. to do some batch processing. It will also let us create WebForms.DiagramView and Gtk.DiagramView components for use on other platforms, while reusing everything from the Diagramming, Layout, Import and Export namespaces.

We can implement a MousePosition argument for multiple-selection as well. In that case it might be misleading to specify it in the NodeModified event, when the node could be far away from the mouse. So perhaps we'll add it to the SelectionMoved args.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint