Home General

TppCusteomRegion.UpdateChildControls should be virtual

edited October 2011 in General
Hi,

We have created our own TppRegion descendant, which resizes its objects according
to some specific rules when the region is resized.
So what i want to do is intercept the default way that a TppRegion tells
its children to resize, and replace that with my own single procedure that
resizes and shifts all children of our new Region-component.

As far as I can see, the best way to do this is to override the UpdateChildControls
method of TppCustomregion ...... but alas, that one is not virtual!

Can you make this one virtual in the next release, or provide me with another
hook to implement this?

thanks

Bas

Comments

  • edited October 2011
    Hi Bas,

    It looks as though the UpdateChildControlBounds is called by the
    BoundsChange routine which is virtual. You could override this method
    and perhaps call your own version of UpdateChildControlBounds instead.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2011
    Hello Nico,

    thans for the tip, but the UpdateChildControls is called in more places then
    BoundsChange....

    But for an intermediate version it may be the best way to go
  • edited October 2011
    Hello Nico,

    Besides, I just realized I have to call the inherited BoundsChange to propagate
    the call upwards in the Classhierarchy (as TppCustomRegion.BoundsChange does.
    But the inherited call will call UpdateChildControls again ....
  • edited October 2011
    You are correct. I will make the UpdateChildControlBounds virtual for
    the next release.

    The current workaround would be to have your custom region descend from
    TppStretchable rather than TppCustomRegion to give you full control.
    You would then need to copy over any of the necessary code for it to
    function correctly.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited October 2011
    Hello Nico,


    Thanks!

    And while you're at it .. could you also make TppComponent.ParentBoundsChange
    virtual ?

    thanks
  • edited October 2011
    Hi Bas,

    I will make this change as well.

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.