Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Prevent nested item selection (Read 865 times)
corcav
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Apr 1st, 2009
Prevent nested item selection
May 29th, 2009 at 3:20pm
Print Post  
I have a composite shape made up of various sub-shapes, i'd like to prevent nested shaped to be selectable (i'd like to select parent item when a nested shape is clicked) is there a way to prevent this?
Tried Locked property but when i do a Rectangle selection i get a NodeSelected event event for nested nodes.

Thanks for you precious help
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Prevent nested item selection
Reply #1 - May 29th, 2009 at 3:39pm
Print Post  
You should use Locked. I've tried this and NodeSelected worked correctly both when clicking nodes and when drawing a selection rectangle.

Code
Select All
ShapeNode n1 = diagram.Factory.CreateShapeNode(10, 10, 60, 40);
n1.Text = "n1";
ShapeNode n2 = diagram.Factory.CreateShapeNode(10, 10, 20, 20);
n2.Text = "n2";
n2.Locked = true;
n2.AttachTo(n1, AttachToNode.TopLeft);

private void diagram_NodeSelected(object sender, NodeEventArgs e)
{
	Debug.WriteLine((e.Node as ShapeNode).Text);
}
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint