Wondering if anyone can give me a couple of pointers regard the sequence of events.
I just get confused about which methods I should override and what does what and in what order.
If I use layout children do I need to override computerBounds, or DoResize.
So is there any docs on the order of events, and what we have to do if we override a certain methods like ComputeBounds.
I’m just asking off the top of my head here, but will post back with a more concrete example.
The GoObject.Bounds setter (if the new value is different from the old one) sets the internal “myBounds” field, calls the Changed method to notify GoDocument.Changed event handlers, calls OnBoundsChanged, and then if InvalidBounds is true, recursively sets the Bounds to the value of ComputeBounds().
Then if the GoObject has a Parent group, it calls OnChildBoundsChanged on that parent GoGroup, and if the parent’s InvalidBounds property is true, sets the parent’s Bounds to the value of Parent.ComputeBounds().
GoObject.OnBoundsChanged is normally a no-op.
GoGroup.OnBoundsChanged just calls MoveChildren if the size hasn’t changed. If the size has changed, it calls RescaleChildren followed by LayoutChildren and then sets InvalidBounds to true.
GoGroup.OnChildBoundsChanged just calls LayoutChildren followed by setting InvalidBounds to true.
GoObject.DoResize is only called by the GoToolResizing tool, when the user is interactively resizing an object.
Thanks very much for the speedy and informative response.