Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic GroupNode can't be selected by dragging a rectangle over them with the mouse ? (Read 2252 times)
heyx
Junior Member
**
Offline


I Love MindFusion!

Posts: 69
Joined: Oct 9th, 2014
GroupNode can't be selected by dragging a rectangle over them with the mouse ?
Apr 1st, 2015 at 7:08am
Print Post  
hi,
I make a groupNode use this code:
Code
Select All
  public void GroupNodes()
        {
            if (DesignDiagram.Selection.Nodes.Count > 1)
            {
                var groupNode = DesignDiagram.Factory.CreateShapeNode(0, 0, 1, 1);
                groupNode.ZBottom(false);
                groupNode.Transparent = true;

                groupNode.HandlesStyle = HandlesStyle.Custom;
                groupNode.Tag = "Group";
                CreateGroup(groupNode, DesignDiagram.Selection.Nodes);
                foreach (DiagramNode child in groupNode.SubordinateGroup.AttachedNodes)
                {
                    child.Locked = true;
                    child.DataContext = groupNode;
                }

                DesignDiagram.Selection.Change(groupNode);
            }
        }
  private void CreateGroup(DiagramNode node, DiagramNodeCollection children)
        {
            Rect r = Rect.Empty;
            foreach (DiagramNode child in children)
            {
                Rect cb = child.Bounds;
                r = r.IsEmpty ? cb : Rect.Union(r, cb);
            }
            double margin = 2;

            r.Inflate(margin, margin);
            node.Bounds = r;
            node.SizeChanged += node_SizeChanged;
            node.MouseEnter += currentSelectNode_MouseEnter;
            node.MouseLeave += currentSelectNode_MouseLeave;
            node.Expandable = false;
            foreach (DiagramNode child in children)
            {
                child.AttachTo(node, AttachToNode.TopLeft);
            }
        }
 


and I can just select the groupNode by mouse click, I can't select more node by dragging a rectangle over them with the mouse.
could you please give me some help?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GroupNode can't be selected by dragging a rectangle over them with the mouse ?
Reply #1 - Apr 1st, 2015 at 7:38am
Print Post  
Hi,

You cannot select Locked nodes. If you want to prevent users from modifying them separately from group but still allow selection, set their EnabledHandles property to None instead.

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


I Love MindFusion!

Posts: 69
Joined: Oct 9th, 2014
Re: GroupNode can't be selected by dragging a rectangle over them with the mouse ?
Reply #2 - Apr 1st, 2015 at 9:32am
Print Post  
Hi Stoyan,
   
     but the GroupNode isn't locked, only its children node be locked. this can effect the GroupeNode?

thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: GroupNode can't be selected by dragging a rectangle over them with the mouse ?
Reply #3 - Apr 1st, 2015 at 10:09am
Print Post  
Quote:
I can just select the groupNode by mouse click, I can't select more node by dragging a rectangle over them with the mouse. could you please give me some help?


You said you can select the group node. If you mean you cannot select it along with other (top-level) nodes, check if you haven't disabled the AllowMultipleSelection property.

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