Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Replace position between 2 objects (Read 3595 times)
tzippy
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Replace position between 2 objects
Jan 11th, 2009 at 1:31pm
Print Post  
Hi,
How can I replace the position between 2 nodes in a diagram?
10X
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Replace position between 2 objects
Reply #1 - Jan 11th, 2009 at 2:27pm
Print Post  
Hi,

Rect r1 = node1.Bounds;
node1.Bounds = node2.Bounds;
node2.Bounds = r1;

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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Replace position between 2 objects
Reply #2 - Jan 12th, 2009 at 9:33am
Print Post  
Thank for reply.
I would want to reorder the items by layout, and keep the new positions.
Is there a property which get the order of the items in the layout?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Replace position between 2 objects
Reply #3 - Jan 12th, 2009 at 10:39am
Print Post  
You need for a pair of nodes to be always placed the first on the left and the second on the right? You could try attaching the second node to the first one (method AttachTo), and then use the KeepGroupLayout property of the layout classes.

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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Replace position between 2 objects
Reply #4 - Jan 12th, 2009 at 12:24pm
Print Post  
I want to replace between 2 nodes,
but they not necessarily next to each other.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Replace position between 2 objects
Reply #5 - Jan 12th, 2009 at 1:13pm
Print Post  
If you are using TreeLayout, just create the links to child nodes in the order you need them - TreeLayout uses the order of outgoing links to deterine the child placement order. Or after applying the layout, see if the nodes you need in specific order are placed in the opposite order, and if so, swap their positions as shown above.

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


I love YaBB 1G - SP1!

Posts: 77
Joined: Jan 11th, 2009
Re: Replace position between 2 objects
Reply #6 - Jan 12th, 2009 at 2:52pm
Print Post  
Thanks
Your answer helped me.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint