Particular shape

Hi i need to create a gotextnode with this shape for background:

| | | |
| | | |
what is the solution?

Use this:

public class SubroutineShape : GoRectangle {
public SubroutineShape() { }
public override void Paint(Graphics g, GoView view) {
base.Paint(g, view);
RectangleF b = this.Bounds;
float d = 10;
if (b.Width < 30) d *= b.Width/30;
GoShape.DrawLine(g, view, this.Pen, b.X+d, b.Top, b.X+d, b.Bottom);
GoShape.DrawLine(g, view, this.Pen, b.Right-d, b.Top, b.Right-d, b.Bottom);
You'll also need to increase the margins for the GoTextNode, so that the extra lines drawn by the SubroutineShape don't overlap the text:
textnode.TopLeftMargin = new SizeF(14, 4);
textnode.BottomRightMargin = new SizeF(14, 4);
If you already have a subclass of GoTextNode defined, it would be more efficient to override GoTextNode.CreateBackground, rather than setting the GoTextNode.Background property:
protected override GoObject CreateBackground() {
SubroutineShape r = new SubroutineShape();
r.Selectable = false;
r.Resizable = false;
r.Reshapable = false;
r.Brush = Brushes.LightGray;
return r;

How would I get a node to look like the document or delay shape in the following link:


For the “Delay” shape, you can use the AndShape example class that is in Demo1.

For the "Document" shape, you'll need to implement this using a poly-Bezier shape, a GoPolygon whose Style is Bezier. Something like:
[code] GoPolygon poly = new GoPolygon();
poly.Style = GoPolygonStyle.Bezier;
poly.AddPoint(0, 7);
poly.AddPoint(0, 5);
poly.AddPoint(0, 2);
poly.AddPoint(0, 0);
poly.AddPoint(3, 0);
poly.AddPoint(7, 0);
poly.AddPoint(10, 0);
poly.AddPoint(10, 3);
poly.AddPoint(10, 7);
poly.AddPoint(10, 7);
poly.AddPoint(5, 4);
poly.AddPoint(5, 10);
poly.AddPoint(0, 7);
poly.Size = new SizeF(100, 50);[/code]