I am using serveal basic Go Shapes.
Did you start with GraphNode in FlowCharter?
All my Blocks have one common ancestor that inherits from GoTextNode.
I’m not sure what you are asking? Do you mean which demo did I start from? If that is the question None really.
I emailed you the LayoutChildren code from GoTextNode, so you can see what is happening. But basically… the size of the background shape is the size of the label plus the margins. To change that, you have to do your own LayoutChildren.
Set GoTextNode.AutoResizes to false. That will cause the label (a GoText object) to be sized to fit inside the Background object, minus the margins.
I never got the email, I’ll check my spam folder.
Yes. Look at ChartNode in the FlowGrammers sample (3.0).
First the Stop Sign.
WaitUntilBlockUI backGround = new WaitUntilBlockUI();
backGround.Selectable = false;
GoDrawing (and the predefined GoFigures) are a way of having 2D shapes without having a specific class (like GoOctagon) to implement them.
stop.AutoResizes = false;
GoDrawing s = new GoDrawing(GoFigure.StopSign);
s.Reshapable = false;
s.Size = new SizeF(50, 50);
stop.Background = s;
stop.Location = new PointF(200, 200);
stop.Label.Bold = true;
stop.Label.Alignment = GoObject.Middle;
stop.Text = "Stop";
I can’t even find GoDrawing I am using 2.6
No, it was new in 3.0. I looked at to see if you were licensed for 3.0, and you were, so I assumed you had that.
OK so lets start over.
Even in 2.6, GoTextNode uses “GoObject” for Background, so you can use a GoImage, or a GoOctagon… anything derived from GoObject.
ok so then why does this not work. When I drag this onto my diagram it shows up small not 48 x 48. I have tried up to 256x256.
GoImage background = new GoImage();
background.Image = Properties.Resources.MyImage;
background.AutoResizes = false;
background.Size = new SizeF(48, 48);
this.Background = background;
this.Editable = false;
this.AutoResizes = false;
this.Label = null;
I think because you’re setting the background before setting AutoResizes.
That made the difference.
So now the Image is the size I want but it looks like the ports are still where they would be if the image was small.
I don’t see how that can happen if you haven’t overridden LayoutChildren. Have you done that?
I have not overridden layout children.