Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Exploded ContainerNode.Margin (Read 5602 times)
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Exploded ContainerNode.Margin
Aug 31st, 2009 at 10:11am
Print Post  
Hi,

Can you please provide an "exploded" version of the ContainerNode.Margin property, similar to:
http://msdn.microsoft.com/en-us/library/system.windows.forms.control.margin.aspx?

As an example, I need to preserve extra space at the right (inside the ContainerNode) for the ContainerNode's local-self-links, so that these don't cross any other elements.

Thanks in advance,
-Mihai
  
Back to top
 
IP Logged
 
mihai
Junior Member
**
Offline



Posts: 86
Joined: Jul 29th, 2009
Re: Exploded ContainerNode.Margin
Reply #1 - Sep 3rd, 2009 at 4:05pm
Print Post  
Hi,

Can you please let me know if there is another way to achieve the same goal, at least for an interim?

Thanks in advance,
-Mihai
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exploded ContainerNode.Margin
Reply #2 - Sep 4th, 2009 at 8:52am
Print Post  
Hi Mihai,

We have added a SetBounds(rect, updateGroup, updateLinks) method to CotnainerNode that lets you set the container's Bounds without affecting the position of its children or connected links. It is available in this build:

https://mindfusion.eu/_beta/fcnet532.zip

You can use it like this:

Code
Select All
ContainerNode c = diagram.ActiveItem as ContainerNode;
if (c != null)
{
	RectangleF r = c.Bounds;
	r.X -= 1;
	r.Y -= 2;
	r.Width += 4;
	r.Height += 5;
	c.SetBounds(r, false, true);
}
 



and do something similar in response to ContainerChildAdded / Removed events.

Changing Margins from a float to a struct will require us updating the file format in several flowcharting components, so it won't make it for this release.

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



Posts: 86
Joined: Jul 29th, 2009
Re: Exploded ContainerNode.Margin
Reply #3 - Sep 4th, 2009 at 9:25am
Print Post  
Hi Stoyan,

Thanks! This works like a charm.

Quote:
Changing Margins from a float to a struct will require us updating the file format in several flowcharting components, so it won't make it for this release.

Indeed, there's always a concern not to break the deserialization. The best way I know of for version-tolerant serialization is to use, for example, the [OptionalFieldAttribute] for the float-Margin and populate the struct-Margin on [OnDeserializingAttribute], if null.

I'll still vote for the struct-Margin. Smiley

Thanks again!
-Mihai
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint