Hi Support!
I would like to know if there is a way to define a minimum size ( W,H), para GoTextNode object ?
I created a class to define a GoTextNode object, and I would like to define a minimum size…
Thanks!
MyCLass:
//Class: Group
[Serializable]
public class GroupItem : GoTextNode
{
//Variables
//This field keeps track of this process item image
private ProcessItemImage mProcessItemImage;
private Color mfirst_color = Color.White;
private Color msecond_color = Color.White;
//Constructor with parameter to create Group Item
public GroupItem()
{
mProcessItemImage = null;
mfirst_color = Color.FromArgb(159, 232, 0);
msecond_color = Color.White;
ConfigureGroupItem(ItemKind.GroupItem, mfirst_color, msecond_color);
}
//This property is for convenience in accessing the Process Item Image class
public ProcessItemImage ProcessImage
{
get { return mProcessItemImage; }
}
//Adjust port positions for certain background shapes
public override void LayoutChildren(GoObject childchanged)
{
base.LayoutChildren(childchanged);
//Get Process Image
ProcessItemImage dec = this.ProcessImage;
//Check if image exists and Rectangle as background
if (dec != null && this.Background != null)
{
//Set image position
PointF pt = new PointF(this.Background.Right - 3, this.Background.Top + 1);
if (dec.Image != null)
{
dec.Image.SetSpotLocation(TopRight, pt);
}
}
}
//Configure each Group process item
private void ConfigureGroupItem(ItemKind PrcItemKind, Color first, Color second)
{
//Insert Image
ProcessItemImage m_PocessItemImage = new ProcessItemImage(ItemKind.GroupItem);
mProcessItemImage = m_PocessItemImage;
InsertBefore(this.Background, m_PocessItemImage);
//Set background
GoRoundedRectangle bkground_shape = new GoRoundedRectangle();
bkground_shape.Corner = new SizeF(5, 5);
Pen pen = new Pen(Color.Black);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
bkground_shape.Pen = pen;
this.Background = bkground_shape;
if (ProcessImage != null)
{
this.ProcessImage.AutoRescales = false;
}
this.Shape.FillShapeHighlight(first, second);
this.TopLeftMargin = new SizeF(35, 20);
this.BottomRightMargin = new SizeF(35, 20);
this.Editable = false;
this.Shadowed = false;
this.Resizable = true;
this.ResizesRealtime = true;
this.Reshapable = true;
this.AutoResizes = false;
this.TopPort.Visible = false;
this.BottomPort.Visible = false;
this.LeftPort.Visible = false;
this.RightPort.Visible = false;
}
}