Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Contents of ContainerNode only visible when ContainerNode is selected (Read 4171 times)
dossantos
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Mar 25th, 2013
Contents of ContainerNode only visible when ContainerNode is selected
May 7th, 2013 at 1:30pm
Print Post  
Hi all,


I added some nodes programmatically into a ContainerNode, and they are only visible while the ContainerNode is selected. As soon as I deselect it, it gets shown as if it were empty. What could be the cause of that?


Cheers,
Tim


Edit:  I just found out that only programmatically added Nodes suffer from this behaviour. If I drag some other node into the container at run time, this node is always visible (irrespective of whether the container is selected or not). However, the programmatically added nodes still vanish when deselecting the container (making it look like it only contains the dragged-in nodes), and reappear when selecting the container again.

Another point to mention is that the container does not shrink (AutoShrink is on); the inner nodes just become invisible/visible, they are not removed/added!
  
Back to top
 
IP Logged
 
dossantos
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 21
Joined: Mar 25th, 2013
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #1 - May 7th, 2013 at 2:01pm
Print Post  
Got it. The nodes came from another Diagram, and needed to be added to the Diagram containing the ContainerNode first.

That you can add nodes from a second Diagram into a ContainerNode on the first Diagram, without getting an exception, leading to such strange behaviour, seems like a bug to me, though Wink
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #2 - May 7th, 2013 at 2:04pm
Print Post  
Hi,

You will have to set the nodes' ZIndex to a value larger than the container's ZIndex, or create the container before its children.

The version we are currently preparing for release implements local Z order for each container, and you wouldn't need to fix Z indices with it. We'll upload a preview build in a couple of days.

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


I Love MindFusion!

Posts: 21
Joined: Mar 25th, 2013
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #3 - May 7th, 2013 at 2:08pm
Print Post  
Thanks, I found the stupid error I made (see other post) - but good to know that there's work being done on the Container Nodes! Smiley


Related: I want to make the ContainerNodes themselves invisible, only show the contained nodes and links (just use them for an automatic "multilevel"-layout); and I want the ContainerNodes' contents (Nodes and Links) to be smaller than the rest. Are there ways to achieve these results?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #4 - May 7th, 2013 at 2:19pm
Print Post  
You could set the container's Brush, ShadowBrush and Pen to ones having a Transparent color. Alternatively, derive from ContainerNode and override DrawLocal to draw nothing. You might as well use regular ShapeNodes instead of containers, set their Transparent property, and use the AttachTo method for the logical grouping you need.

I suppose you can make child items smaller by scaling down a bit their Bounds, Font, ControlPoints coordinates, etc.

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


I Love MindFusion!

Posts: 21
Joined: Mar 25th, 2013
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #5 - May 8th, 2013 at 11:35am
Print Post  
Stoyan,

thanks for the hints, I was able to style the ContainerNodes as desired!

Now, the last thing I want to achieve (and I'm a bit struggling with) is to layout the whole diagram. My "child diagrams" inside the Containers are nicely arranged; how can I now arrange the Containers to not overlap, and to put one specific container in the center? I tried applying Layouts to them (FractalLayout, LayeredLayout etc.), and I made the second, third... Container a child of the first one using "AttachTo", but nevertheless, after layout.Arrange(diag), all ContainerNodes are superpositioned (same coordinates).

Have you a hint for me on how to automatically arrange the Containers next to each other, with one of them centered in the DiagramView?


Thanks, cheers,
Tim
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Contents of ContainerNode only visible when ContainerNode is selected
Reply #6 - May 8th, 2013 at 2:02pm
Print Post  
Hi,

The layout class might do nothing if you call AttachTo and then arrange with KeepGroupLayout enabled. Also make sure IgnoreLayout is set to false for containers.

Instead of AttachTo, try adding temporary links from the container you need at the center to all other top-level containers, then run FractalLayout with the center container set as Root, and finally remove the temporary links.

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