Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Rearrange Containers on Fold/Unfold? (Read 1739 times)
ThomasK
YaBB Newbies
*
Offline



Posts: 4
Joined: Jan 20th, 2011
Rearrange Containers on Fold/Unfold?
May 13th, 2011 at 12:22pm
Print Post  
Hi,

i have several ContainerNodes, each is a new graph.
The layout places them vertically:
layout.MultipleGraphsPlacement = MultipleGraphsPlacement.Vertical;

When i fold one container i want the diagram to be rearranged so the gap between the now folded container and the next ohne is closed.
And when i unfold the container it has to be rearranged so the distance to the next one is the same again.

layout.Arrange(myDiagram) seems to ignore the fact that a container is folded.

How can i get this done?

thx


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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Rearrange Containers on Fold/Unfold?
Reply #1 - May 14th, 2011 at 6:48am
Print Post  
Hi,

Indeed the GraphsPlacement function allocates space for container's children even if the container is folded. There is no way to prevent that now. If you only need to arrange all containers vertically, you could directly set their Bounds instead of using Layout.Arrange:

Code
Select All
private void diagram_ContainerFolded(object sender, NodeEventArgs e)
{
	float x = 10, y = 10, p = 5;
	foreach (DiagramNode node in diagram.Nodes)
	{
		if (node is ContainerNode)
		{
			node.Move(x, y);
			y += node.Bounds.Height + p;
		}
	}
} 



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



Posts: 4
Joined: Jan 20th, 2011
Re: Rearrange Containers on Fold/Unfold?
Reply #2 - May 16th, 2011 at 11:49am
Print Post  
Hi Stoyan,

thank you i think this should work in this case.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint