I have the following class:
public class StateMachineNode : StateNode
{
GoRectangle r;
public StateMachineNode()
{
r = new GoRectangle();
r.Selectable = false;
r.Movable = false;
r.Resizable = false;
r.ResizesRealtime = true;
r.Brush = Brushes.WhiteSmoke;
r.Pen = Pens.Black;
this.Size = new SizeF(50, 50);
r.Size = new SizeF(40, 40);
this.InsertBefore(this.Label,r);
}
public override void LayoutChildren(GoObject childchanged)
{
base.LayoutChildren(childchanged);
//if (this.Initializing) return;
GoObject back = this.Background;
if (back != null && r != null)
{
r.Bounds = new RectangleF(back.Left + 5, back.Top + 5, back.Width - 10, back.Height - 10);
}
}
}
It displays correctly when I add it to a goView. However when I change the text on the Label the inner box is not repositioned correctly. Is there another function I should override to take care of this?
Regards,
Martin