[fpc-devel] extending platform flag request

Vincent Snijders vsnijders at quicknet.nl
Fri Sep 28 10:49:12 CEST 2007


Michael Van Canneyt schreef:
> 
> On Fri, 28 Sep 2007, Marc Weustink wrote:
> 
>> Graeme Geldenhuys wrote:
>>> On 27/09/2007, Павел Ишенин <webpirat at mail.ru> wrote:
>>>> TMenu = class(...)
>>>> published
>>>>   property Detachable: Boolean read ... write ... ; platform carbon qt;
>>>> { or it can be platform 'carbon,qt' or another easier way }
>>>> end;
>>> So using this example:  Detachable property information will be
>>> written to the lfm file for carbon and qt platforms. What is going to
>>> happen if that lfm file is loaded (as in x-platform applications)
>>> under a Windows or Linux-GTK system?  "Unknown property error" on load
>>> in Lazarus??? And when saved under the later platforms, Lazarus will
>>> auto remove that unknown property from the lfm file like it does with
>>> other unknown properties?
>> No the property will always exist and always been written. Only an indication
>> to the user can be shown that this is a property which might not work on all
>> platforms
>> IIRC, that's what the platform directive was meant for.
> 
> Only to say that code is platform specific. You get this only when
> compiling.
> 
> Note that what you ask goes way beyond platform: you ask widget-set dependencies.
> You should encode this kind of information in your interface class, not in 
> the RTII. 
> 

If RTTI (RTII= run time interface information ? ;-) )is out of the question, maybe 
it is a better place to add it to the fpdoc documentation for that property/class 
and let the IDE read that information from there.

Vincent



More information about the fpc-devel mailing list