Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Container Node Issue When Location Is Moved In Collapsed State (Read 4551 times)
Bala
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 156
Joined: Apr 21st, 2009
Container Node Issue When Location Is Moved In Collapsed State
Jul 4th, 2012 at 10:33am
Print Post  
Hi,

We have a requirement where container mode, when collapsed, should be collapsed at center of itself instead on top and when expanded should expand considering it collapsed position as center.

To achieve this we have created a sample. While we have achieved collapsing at center first by calculating the center position of container node and then using Container.Move function to this position.

However we are facing following issues:

1. When container node is collapsed and moved to center position, the child nodes of container nodes gets overlapped over each other and doesnt retain their position on expanding the container nodes. This we observed while moving the container node manually as well.

2. We want the container node should not resize beyond the rectangled required for properly showing all its child nodes. For this we calculated the required bound for its contents and set the MinHeight & MinWidth. However when user resizes the container node to smaller size then required size, the selection handle of container remains at MinHeight but the inner rectangle get resized to height & width less than MinHeight and Width. Check attached image.

I have attached the sample application where both the above behaviour can be observed. To check #1 manually follow below steps:

1. Comment out below code from "diagram_ContainerFolded" and "diagram_ContainerUnFolded" methods:
     container.Move(ctrNode.OriginalRect.X,      ctrNode.OriginalRect.Y + ctrNode.OriginalRect.Height / 2);

2. Run the sample

3. Collapse container nodes

4. Move the collapsed container node while in collapse state

5. Expand container node and observe positions of children nodes.

Your help in this regard will appreciated.

Thanking you in anticipation!

Regards,
Rohit
  

SampleApplication.zip (Attachment deleted)
BeforeResizing.PNG (Attachment deleted)
AfterResizing.PNG (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Container Node Issue When Location Is Moved In Collapsed State
Reply #1 - Jul 5th, 2012 at 1:28pm
Print Post  
Apparently 1 happens because of the KeepInsideParent constraint you set for child items - the constraint is applied also when moving a folded container and its children end up in the caption area. You will have to disable that constraint for child nodes from the ContainerFolded event, and enable it again from ContainerUnfolded.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Container Node Issue When Location Is Moved In Collapsed State
Reply #2 - Jul 5th, 2012 at 1:36pm
Print Post  
2) You should set the MinWidth and MinHeight properties of  node.Constraints in order to prevent the user from setting smaller size. The ones you are setting directly on node are derived from FrameworkElement and used by the WPF layout system; the diagram control ignores them.

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