[Lazarus] Is it meaningful or possible to change the visibility or the properties and events in a form or datamodule, ie make the private or protected?

Sven Barth pascaldragon at googlemail.com
Fri Mar 23 14:49:24 CET 2012


Am 23.03.2012 14:11, schrieb Frank Church:
> Is it meaningful or possible to change the visibility or the
> properties and events in a form or datamodule, ie make the private or
> protected?
>
> Of late when I look the definition of a form, it all seems so odd to
> me that properties, objects etc which are not meant to be accessible
> to external modules are automatically visible.
>
> I just want to check on how the form or module fits into the overall
> program just by looking at the public and published properties. Am I
> missing something about the ideas about Delphi and Lazarus which are
> supposed to be obvious?
>

All objects that should be placed in the lfm/dfm file MUST be placed in 
the published section in Delphi and Lazarus, because they are only 
streamed if there is RTTI for them for which "published" was created. 
Yes, there are other approaches, e.g. fpGUI has an IDE that has the GUI 
creation in code and of which the IDE parses and modifies the 
"initialization routine" to display a designer form, and another 
possiblity would be - if they'd be implemented in FPC - the extended 
RTTI which allows you to specify that also e.g. private fields have RTTI 
generated and (with an adjusted streaming system) this could also be 
used. But neither Delphi nor Lazarus uses this approach, so you must 
live with that (for now).

Regards,
Sven




More information about the Lazarus mailing list