[fpc-pascal] WriteComponent not outputting a hierarchy of components?

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Jun 3 20:14:30 CEST 2010


On 3 June 2010 17:24, Michael Van Canneyt <michael at freepascal.org> wrote:
>
> You must override GetChildren.
>
> In the LCL, TWinControl overrides GetChildren to write child controls.
>
> It is documented.

But why is GetChildren needed? Why can't TWriter use ComponentCount
and Components[] like I have done in the TraverseComponents()
recursive procedure?

Also I saw this comment in LCL's TCustomForm.GetChildren

"  Adds component to children list which have no parent.
    (TWinControl only lists components with parents) "

Is that still true?  In fpGUI I set Owner and Parent. What is
different in fpGUI (compared to LCL or VCL) is that Owner = Parent,
always. I don't see a need for them to be different - one widget can
just as easily manage the lifespan of another widget. Re-parenting a
widgets also works in fpGUI, by simply transferring the ownership to
the new parent widget (inserting into Components[] array).


-- 
Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-pascal mailing list