Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Make node deselect when mouse dragged on dgmView? (Read 1609 times)
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Make node deselect when mouse dragged on dgmView?
Dec 31st, 2007 at 4:04am
Print Post  
I have a situation where I select a node, then if I drag on the diagram view and never intersect with any other node, for instance just drag blank area, the selected node remains selected.

Any way to have it deselect?

It seems I can do this if I simply click outside the node, but dragging doesn't do it.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Make node deselect when mouse dragged on dgmVi
Reply #1 - Jan 1st, 2008 at 5:36am
Print Post  
The selection changes only if the selection rectangle contains some items. You could handle the view's MouseUp event, check if (diagram.Interaction.CurrentItem is Selection), and if the Selection.Bounds does not contains any nodes, call Selection.Clear().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
consolejoker
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 74
Joined: Dec 17th, 2007
Re: Make node deselect when mouse dragged on dgmVi
Reply #2 - Jan 1st, 2008 at 3:21pm
Print Post  
Is there an easy way to check if the selection bounds intersects any nodes or do I have to check it against all the nodes on the diagram?

Thx.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Make node deselect when mouse dragged on dgmVi
Reply #3 - Jan 2nd, 2008 at 6:41am
Print Post  
You will have to call RectangleF.IntersectsWith(selection.Bounds, node.Bounds) for each node in the diagram.

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