Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Expanding nodes (Read 2114 times)
manas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: May 16th, 2006
Expanding nodes
May 19th, 2006 at 3:59am
Print Post  
We have used tree layout.
We have created each box with following command -
Box childNode = fc.CreateBox(0, 0, 80, 50);

We have used the arrows pointing from child node to parent node, for this we have used reversedArrows option in the constructor of tree layout as true. When we link the arrow with parentnode as source and child node as destination -

Arrow link = fc.CreateArrow(parentnode, childNode);

Now when we call -
treeLayout.Arrange(fc);

the tree layout doesnt work, all the boxes are placed in the position where they were created i.e (0,0)

Now if we change the link as
Arrow link = fc.CreateArrow(childNode,parentnode);

then the tree is drawn correctly but the expanding happens in opposite direction, i.e when we click on expand button of any node, then its parent is expanded or collapsed.

We want the arrows pointing from childnode to parentnode, but the expanding to happen the normal way, i.e when clicked on expand button of any node, then its child should be expanded or collapsed. Please explain this.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Expanding nodes
Reply #1 - May 19th, 2006 at 5:07am
Print Post  
You could set either the TreeLayout.ReversedArrows property or the flowchart's ExpandOnIncoming property.

Stoyan
  
Back to top
 
IP Logged
 
manas
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: May 16th, 2006
Re: Expanding nodes
Reply #2 - May 19th, 2006 at 5:28am
Print Post  

This works fine, thanks.
But if a childnode has two parents, and if one of the parent is collapsed, then the child node should not collapse, only the link should go.
Now the child node is getting collapsed if any of the parent is collapsed.
How to do this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Expanding nodes
Reply #3 - May 19th, 2006 at 6:15am
Print Post  
Collapsing is intended to work with tree structures. Otherwise you can iterate all invisible direct children of the collapsed parent, and if any of them has a second parent which is not collapsed, set Visible = true for that child box and the link to its parent. Also set child.Expanded = false followed by child.Expanded = true to expand again the branch that starts from that child box.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint