Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Move a container without affecting its content (Read 3628 times)
yrauma
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Move a container without affecting its content
May 6th, 2010 at 3:17pm
Print Post  
Hi !

Im working on a big project using containerNode and shapeNode and so on...

I have a big trouble for which I cannot find any solution... And I have been searching for a while now...

I have many containers with shapeNode or other Container in it. When I load my project I restore the old diagram and add nodes into my container..
Then I restore the layout and call the Move function on the container with the stored positions.

My issue is that when I move a container it moves all the objects contained in it, which is cool when i drag stuff with the mouse but not in that case.

So I would like to be able to set the postion of a container without affecting any of its child objects...

I tried the Move method, settings the bounds and so on but I always have the same problem.

Do you have any idea on how I can do that ?

Thanks !
Yrauma
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Move a container without affecting its content
Reply #1 - May 6th, 2010 at 4:07pm
Print Post  
Hi there,

You can do that by calling the SetBounds method with its updateGroups argument set to false:

container.SetBounds(newBound, false, true);

You might set the third argument to true as well to disable updating the links' positions. The Bounds property setter calls that method with both arguments true.

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


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Move a container without affecting its content
Reply #2 - May 6th, 2010 at 4:26pm
Print Post  
Oh this is exactly what I need ! Thanks

But it seems that I cannot access this fuction Sad
I have the 5.2.1 version is it only available since 5.3 ?

This is not even in my doc ...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Move a container without affecting its content
Reply #3 - May 6th, 2010 at 4:53pm
Print Post  
Yes, it was added to the control with the V5.3.2 release. If you don't wish to move to that version, you could change your code a bit to first restore the layout and than add nodes to their containers.

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


I love YaBB 1G - SP1!

Posts: 61
Joined: Mar 28th, 2010
Re: Move a container without affecting its content
Reply #4 - May 6th, 2010 at 5:12pm
Print Post  
Yes, that's what I did, it's hacky but works while we do not update the version.

Thanks a lot for your help Stoyan !!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint