Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Countering the AttachTo.FixedCorner behaviour (Read 2028 times)
Julien_Dechene
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Jun 20th, 2011
Countering the AttachTo.FixedCorner behaviour
Jul 19th, 2011 at 8:38pm
Print Post  
Hello, I would like to know if there is some way to prevent the node to move when we resize their container. I tried to find some way to override the UpdateToCornerAttachment callback but it doesnt seem to work.

I also tried to set explicitly the attachments Type so that it won't be AttachTo.FixedCorner, but again it didnt work as expected.

Also I would like to know when exactly Groups are constructed when we load a diagram and attachments are assigned.

Thanks in advance and let me know if I was too vague in my explanations.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Countering the AttachTo.FixedCorner behaviour
Reply #1 - Jul 20th, 2011 at 7:25am
Print Post  
Hi,

The only way I can see doing that via the public API is to create a custom container class that attaches children through the Group.AttachCustom method. Then the group will call the container's UpdateGroup override where you can set the child nodes' positions only if Diagram.Interaction indicates the container is being moved, and leave them where they are if the container is being resized.

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


I love YaBB 1G - SP1!

Posts: 17
Joined: Jun 20th, 2011
Re: Countering the AttachTo.FixedCorner behaviour
Reply #2 - Jul 20th, 2011 at 2:03pm
Print Post  
Thanks for the quick response. I managed too retrieve the Attachments list for the nodes and I reassigned the type to Custom. I did that in the LoadFromXml override of my custom nodes. So far it seems to work as intended. But I am asking myself if I need anything else to be sure that I won't have any erratic behaviors. Also I'm wondering at which moment in the node's reation is the best to attach it to its container.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Countering the AttachTo.FixedCorner behaviour
Reply #3 - Jul 20th, 2011 at 6:55pm
Print Post  
It all sounds like a big hack to me Smiley I will add this to the feature list for the next release; our developers should be able to easily add some property to control whether child nodes move when containers resize.
  
Back to top
 
IP Logged
 
Julien_Dechene
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Jun 20th, 2011
Re: Countering the AttachTo.FixedCorner behaviour
Reply #4 - Jul 20th, 2011 at 7:44pm
Print Post  
Found a cleaner way to do it, but still it's far from elegant. I'm using the AttachCustom callback and overriding the OnUpdateBounds (UpdateGroup gave me problems). It could be nice to have a way to tell the Diagram which AttachTo behavior we want to use as default. Anyways, thanks a lot sir, your help is always greatly appreciated.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint