GoSubGraph - handle hides label

Hi,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

I am using GoSubGraph in my application and when the label is wider then node inside the GoSubgraph the handle hides the beginning of the label.

I have tried this:

public override void LayoutChildren(GoObject goObject)

{

base.LayoutChildren(goObject);

RepositionLabel();

}

private bool RepositionLabel()

{

if (Label!= null && (Label.Left<Handle.Right + 2)&& (Label.Top<Handle.Bottom + 2))

{

Label.Left = Handle.Right + 2;

return true;

}

return false;

}

this solution didn't work because the handle was out of the subGraph bounds. so i have tryed to add this:

protected override bool ComputeBoundsSkip(GoObject goObject)

{

if (goObject == this.Handle)

return false;

return base.ComputeBoundsSkip(goObject)

}

but this didn't work because every time I have moved a node inside the subgraph the Top boarder of the bounds moved 10 pixels up.

Please Help

Thanks

Aviram

Maybe you just want to position the Label yourself, putting it relative to the Handle rather than relative to the contents of the subgraph.
[Serializable]
public class TestSubGraph5 : GoSubGraph {
public TestSubGraph5() { }
public override void LayoutLabel() {
base.LayoutLabel();
GoText lab = this.Label;
GoSubGraphHandle h = this.Handle;
if (lab != null && h != null) {
PointF pt = h.GetSpotLocation(TopRight);
pt.X += 3; // add some space between the Handle and the Label
lab.SetSpotLocation(TopLeft, pt);
}
}
}

Thanks for the help bu unfortunately the subgraph still doesn’t function as it should:

  1. when i move items inside the subgraph to the right the boarder doesn’t resize properly (the left side of the bounds rectangle doesn’t move to the right). - I guess that this has happened because we have repositioned the label relatively to the handle which wasn’t repositioned yet.
  2. The handle still hides the label. it is only after i collapse and then expand that the label moves.
    can anyone help?
  1. I don’t see why moving a subgraph item to the right should move the left side of the border, unless that item had been on the left side to begin with. Nor, with the overridden implementation of LayoutLabel, do I see why it matters that the label hadn’t been laid out yet.
  2. You can always call that LayoutLabel method explicitly when you are done initializing the node.