Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Different look:container created program./interac. (Read 2618 times)
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
Different look:container created program./interac.
Apr 18th, 2010 at 8:46pm
Print Post  
Hi.

I have my own class derived from ContainerNode. Theres sub called in constructor:

Code
Select All
Public Sub New()
	  MyBase.new()
	  MMSetDefaultProperties()
End Sub

Public Sub New(ByVal parent As MindFusion.Diagramming.Diagram)
	  MyBase.New(parent)
	  MMSetDefaultProperties()
End Sub


'default settings of shape
Public Sub MMSetDefaultProperties()
	  Me.MinimumSize = New SizeF(20, 20) 'Constraints.MinWidth and Constraints.MinHeight dont work! :-)
	  Me.Obstacle = True ' whether this node is considered an obstacle by the link-routing algorithm
	  Me.Bounds = SDRectangleVirginCreator(0, 0, 50, 50)
	  Me.Font = New Font("Arial", 8, FontStyle.Regular) 'font used when rendering the container's texts
	  Me.AllowIncomingLinks = True 'true - because of notes
	  Me.AllowOutgoingLinks = True 'true - because of notes
	  Me.Brush = New LinearGradientBrush(Color.White, Color.LightBlue, 45) 'brush is used to fill the interiors of geometric shapes
	  Me.Pen = New Pen("0/#FF696969/0/0/0//0/0/10/") 'pen is used to draw the outline of geometric shapes
	  Me.HandlesStyle = HandlesStyle.EasyMove 'visual styles for frames that are drawn around selected nodes
	  Me.ShadowOffsetX = 0.5 'horizontal offset of the shadow
	  Me.ShadowOffsetY = 0.5 'vertical offset of the shadow
	  Me.CaptionHeight = 6 'height of the container's caption area
	  Me.Margin = 2 'how much space should be left between contained nodes and the container borders
	  Me.AutoShrink = True 'whether the container should shrink in size when nodes are removed from it
	  Me.Foldable = False 'whether the user is allowed to fold this container
	  Me.HighlightPen = New Pen(Color.BlueViolet) 'pen used to draw the container frame lines when an item is dragged over the container
	  Me.CaptionFormat.Alignment = StringAlignment.Center  'specifies the alignment of an object relative to its container
	  Me.CaptionFormat.FormatFlags = StringFormatFlags.NoClip
	  Me.CaptionFormat.Trimming = StringTrimming.None
	  Me.Caption = GsStringDefaultValue 'the text displayed as caption of the container
End Sub
 



Here u can see result after creating container.
http://i41.tinypic.com/j0kugz.jpg
The first was created programmatically, second one interactively.

See it? Theres different look of caption area.
Any help?

Thx.

...MUDO...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Different look:container created program./inte
Reply #1 - Apr 19th, 2010 at 8:14am
Print Post  
Try setting Me.CaptionFormat.LineAlignment too.

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



Posts: 90
Joined: Nov 29th, 2008
Re: Different look:container created program./inte
Reply #2 - Apr 19th, 2010 at 10:53am
Print Post  
Hi.

Yes, it  helps. Do u think its normal behaviour? Is it bug? Different result after creating object programmatically or interactively?

...MUDO...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Different look:container created program./inte
Reply #3 - Apr 19th, 2010 at 1:00pm
Print Post  
The second constructor will initialize from the default TextFormat set for the diagram, and the first won't. So you might get different results if you are using different constructors when adding nodes programmatically and when returning them from StartDraw.
  
Back to top
 
IP Logged
 
MUDO
Junior Member
**
Offline



Posts: 90
Joined: Nov 29th, 2008
Re: Different look:container created program./inte
Reply #4 - Apr 20th, 2010 at 1:11pm
Print Post  
Hi.

Yes, thats true, u r right Wink

Now after adding setting of that property to my sub which is called from all constructors, the problem is sovled.

Thx.

...MUDO...
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint