Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Layouts within layouts (Read 4551 times)
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Layouts within layouts
Jun 8th, 2009 at 2:52pm
Print Post  
Is there any way to do a layout within a layout? I've got a number of boxes which contain tables. The tables in each box arrange themselves beautifully with the tree layout, but the boxes all stack roughly on top of each other after ArrangeDiagram is called.

Ideally, what we'd want would be for boxes to be arranged in a tree, with their contents ALSO arranged in trees.
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #1 - Jun 8th, 2009 at 4:49pm
Print Post  
If you set TreeLayout.Root, ArrangeDiagram will arrange only the nodes that can be reached from the root. You could use that to arrange the children of each container, call container.ResizetoFitChildren, and finally apply TreeLayout on the containers using the KeepGroupLayout property.

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



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Layouts within layouts
Reply #2 - Jun 9th, 2009 at 2:36pm
Print Post  
If it were as simple as self-contained trees of tables inside boxes which were connected to one another, I think that would work.

However, I think what's preventing it from working is the fact that boxes aren't connected to one another; instead, the connections are between tables inside boxes.

This might be something I have to do by hand?
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #3 - Jun 9th, 2009 at 5:50pm
Print Post  
Try setting IgnoreLayout = true for each link that connects tables in different containers, and only the tree branch inside the container should be arranged when Root is set. If this does not work, I suppose our developer could add an Arrange(layout) method to containers.

Stoyan
  
Back to top
 
IP Logged
 
sbailey
Junior Member
**
Offline



Posts: 61
Location: MD
Joined: Apr 24th, 2009
Re: Layouts within layouts
Reply #4 - Jun 10th, 2009 at 7:03pm
Print Post  
The biggest problem is that it *seems* like boxes that aren't connected to each other remain stacked on top of one another, so doing two layout steps doesn't help.

Perhaps I should apply a different layout, like the spring layout, to the boxes? But this layout doesn't have the option to preserve groupings...

Another issue I'm running into is that I can't select arrows when they're inside boxes. The boxes seem to absorb the mouse click. Is this a Z-order issue?
  

Editor Programmer&&Bethesda Softworks
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #5 - Jun 10th, 2009 at 7:24pm
Print Post  
Quote:
The biggest problem is that it *seems* like boxes that aren't connected to each other remain stacked on top of one another, so doing two layout steps doesn't help.


If you set TreeLayout.Root, ArrangeDiagram won't move nodes that cannot be reached from the root. Could you save the diagram to xml, and email it to support@mindfusion.eu along with your layout code?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #6 - Jun 10th, 2009 at 7:25pm
Print Post  
Regarding hit-testing and Z order, set the HitTestPriority property to "htpZOrder".
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #7 - Jun 11th, 2009 at 3:58pm
Print Post  
Hi,

We have received the files and will send you sample layout code tomorrow.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Layouts within layouts
Reply #8 - Jun 12th, 2009 at 3:01pm
Print Post  
Hi,

You can find an example on the private messages page. The layout code runs when you press the Layout button. The zip also includes a flowchartx.dll that fixes how IgnoreLayout is handled by some layout classes.

The sample arranges only the children of a container by setting the IgnoreLayout property of all other nodes. That's not very convenient, but it's the only way we found with the current API. There is an Arrange(items) method in the .NET version of the control that can be used to arrange only a part of the items; we'll try to port it to FlowchartX for the next release.

Another restriction is that LayeredLayout used in the sample can arrange only a single connected component of a graph. If you have some containers that are not connected to the graph, you will have to add temporary arrows to connect them before running the layout.

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