[fpc-devel] property syntax extension
nc-gaertnma at netcologne.de
Sun Oct 21 16:18:46 CEST 2007
On Sun, 21 Oct 2007 21:55:45 +0800
Paul Ishenin <webpirat at mail.ru> wrote:
> Florian Klaempfl wrote:
> >> Only that the codetools can not use a ppureader.ppu from the RTL or
> >> FCL. It can use the ppureader.pas, but not the .ppu.
> >> Or use the XML approach as Florian
> > I suggested :) Paul didn't like it that much
> > He started also a wiki page:
> > http://wiki.freepascal.org/Property_attributes
> I still thinking that RTTI is much more useful than separate files.
> To use separate files you need some framework to find them and parse.
> If it is RTTI then existing tools can be easily extended to use new
> feature. In case of Lazarus ppu, xml, rtti is not so different.
> But lets think of other applications of property attributes. For
> example FastScript components (scripting engine of FastReports co.)
> use RTTI to automatically describe pascal classes in order to use
> them in script. Property attributes can store descriptions, value
> area, and another useful info.
> Or my example with database components.
> TxxxDatabase = class
> property TransactionModel: TTransactionModel attributes ['engines:
> ms-sql, oracle, sybase-asa'];
> Using such attribute database components can easily check whether
> this property applied to current engine.
> If this is stored in ppu, xml it will not used by component
> developers. And once again - for Lazarus it is not a big difference.
I got a practical question:
Where and how should the hint be used/shown in the OI?
If it is queried only manually (e.g. user moves mouse over property
and waits for a hint), then a find declaration can be done and the
comment next to the property can be shown. That's easy and we don't
need any change or new syntax.
OTOH if you want to check these flags in property editors to color
misused properties, then TPropertyEditors must be extended.
More information about the fpc-devel