Node Layout issue (pics + demo)

Hi All,
After struggling for a while to get my head around the event sequence and finally getting my node to work how I want, I have one little niggle left, which hopefully someone can help me solve this last issue.
I have spent so many hours working on this I would be very greatful if someone could have a quick look over it.
Here is the problem,
When I add a node the node gets added as show below:

The node is made up of a GradientShape, a port on the top, goText label for the “Question Branching Test” text, another goText for the “Branching Question” (italics) and finally a goMultiTextNode for the Branch Items list (With a port on the right hand side).
As you can see the node is a little too small when its first being added, I have overriden “Compute Resize” aqnd have a min size of (200, 60).
So First problem is that when I add a newly created node it is not sizing correclty and I cannot find how to fix.

Second item: if I click the resize handles once (without moving the mouse) the node width is resized correctly However the height seems to increase for no reason (Well obviously for a reason, but I cannot find it anywhere). See below:

So, if I now resize the nodes height I can dag the height so its smaller than the node bounds, when I release the node automatically resizes to the minimum height possible (Which is what I want) however the gradient stays at the invalid resized location, How can I get the gradient to resize to where the handles are shown on the image below:

Then finally if it click the Green handle once the gradient is then resized accordingly. How can I get the gradient to resize when an invalid resize is performed, it seems the gradient just stays at the last invalid resize point until I resize again.
I resize my gradient in the LayoutChildren, its a little hard to explain, so I have attached a VS2005 sample to demo what I am doing.
I’m on my last couple of days evaluation of the GoDiagram 2.5 Beta, so any help in getting this sorted would be great.

Thanks in advance
P.S the VS project can be downloaded from:

I forgot to attach the final image to the post.
The image below shows the node how I would like to to appear when it is first added to the document, It seems I have some issues with the order in which I am laying the child items out.

I don’t have time right now to look at the code.
Basically it looks like your implementation of LayoutChildren isn’t making sure the rounded rectangle is sized correctly to surround all of the children. ComputeResize is just called when the user does interactive resizing.
However, I don’t understand why you’re not just using a GoMultiTextNode as the whole node. You can adapt the code in MultiTextNodeWithBack in Demo1 to have the Background be a LinearGradientRoundedRectangle. Something like:
public class MultiTextNodeWithBack : GoMultiTextNode {
public MultiTextNodeWithBack() {
this.ListGroup.LinePen = null;
this.ListGroup.BorderPen = null;
myBack = CreateBackground();
InsertBefore(null, myBack);
this.ListGroup.AutoRescales = false;
this.ListGroup.Resizable = true;
this.ListGroup.Reshapable = true;
this.ListGroup.ResizesRealtime = true;
this.ListGroup.Size = new SizeF(100, 50);
this.ListGroup.TopIndex = 0;
public override GoObject SelectionObject {
get { return this.ListGroup; }
protected virtual GoObject CreateBackground() {
LinearGradientRoundedRectangle r = new LinearGradientRoundedRectangle();
r.Selectable = false;
r.StartColor = Color.LightGreen;
r.EndColor = Color.White;
return r;
. . .
The .ListGroup changes are copied from the ScrollingMultiTextNode example class, to support resizing by the user.

The image in my second post is exactly how I want it to look. So the drawing of the background etc is correct.
The issue I have is that when I resize the node smaller than it can go, see the 3rd picture in the first post. When I resize and the new size is smaller than all the items the node automatically resizes itself to accomodate all objects in the node, however the background gradient stays at the invalid size.
The samples arn’t much use, I find them unorganised and everytime I want to find something its split across different nodes and I end up spending hours looking through it. (Not a very good experience)
I’m not using the multitext node because I have a base node class that handles the input port, header text and gradient background. All my nodes inherit from this class and provide there own functionality.
Also if you notice the fill isn’t just a standard gradient fill, I only gradient fill the top 10% of the shape, I use a blend with the brush to get that effect.
Is there anyone else who can help. I need to get this sorted before we can make a decision, also if we did purchase GoDiagram, what kind of support levels are there available. I.e. if we cannot figure something out what options are available for getting help?

I might have been a bit unclear in my original post, but the 4th picture is exactly how I want my node to look, i.e. the output ports are supposed to be across the lines.


I can take a look at this when I get a chance.

Sorry for the delay – I have been attending SIGGRAPH.
I took a look at your code and noticed one thing right away: both of your LayoutChildren implementations are depending on the value of GoObject.Bounds (or Size or Position or Left or Top or Right or Bottom or Width or Height) that may be changing during the execution of your code. After all, if you were to move some child object way to the left of all of the other children, both Me.Left would decrease and Me.Width would increase accordingly.
It’s best to size and position all of the children relative to the SelectionObject (if that’s a child object) or relative to one of child objects that you can depend on. Hence GoIconicNode positions all the children relative to the Icon; GoTextNode positions all of the children relative to the Label; GoListGroup positions all of the children relative to the first child. Perhaps that should be the mGoMultiText child in your case.

Hi Walter,
Thank you for your replies, you were spot on, as soon as I stopped using the bounds in the layoutchildren and started using the selection object everything was working as expected. :)