[Lazarus] fpGUI
Hans-Peter Diettrich
DrDiettrich1 at aol.com
Sun Jan 16 17:18:57 CET 2011
Graeme Geldenhuys schrieb:
> Lets say the Form unit is called frm_main.pas, it will have a structure
> as follows:
[...]
This code is not very compatible with the new AutoSize, and may cause
other problems.
But this should not be a problem, as long as the code generator and LCL
is provided and maintained by the same "authority".
> AfterCreate is a virtual method that gets called in a base form class in
> the AfterConstructor method.
What about code in FormCreate?
> You will also notice that the UI components are placed inside the
> Private section of the Form class. You can move it to any other pricacy
> section if you please. I simply apply standard OOP practises here, just
> like what you would do in business objects... Only make visible what you
> really want visible.
A reasonable point! :-)
Nonetheless the visibility of the component properties cannot be reduced
much. It must stay public, so that the properties are accessible in
AfterCreate. The same with Frames...
DoDi
More information about the Lazarus
mailing list