Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Detect multiselect types (Read 2246 times)
JHanson
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 4
Joined: May 4th, 2015
Detect multiselect types
May 29th, 2015 at 8:07pm
Print Post  
I need to distinguish between when a user selects multiple nodes by dragging a rectangle around them with the mouse and when they select multiple nodes individually by using the CTRL key and clicking.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Detect multiselect types
Reply #1 - Jun 1st, 2015 at 7:53am
Print Post  
Inside NodeSelecting validation event handler you could detect that by comparing e.SelectionRectangle with RectangleF.Empty. An empty rectangle means CTRL-click selection.

Alternatively, for both Selecting and Selected events you could inspect the Diagram.Interaction object:

Code
Select All
private void diagram_NodeSelected(object sender, NodeEventArgs e)
{
	if (diagram.Interaction != null &&
		diagram.Interaction.CurrentItem is Selection)
	{
		Debug.WriteLine("lasso selection");
	}
	else
	{
		Debug.WriteLine("click selection");
	}
} 



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


I Love MindFusion!

Posts: 4
Joined: May 4th, 2015
Re: Detect multiselect types
Reply #2 - Jun 1st, 2015 at 2:18pm
Print Post  
Excellent, thank you!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint