OK, how about a compiler switch (that can be turned on or off) that SEARCHES
for the property (or event if defined in code and not by the Object Inspector)?
It shouldn't be so difficult to deal with Sender (or components in a loop)
where the exact Type is not known in advance, just the presence of a specific
property or Event. If the switch can be turned Off again after the routine,
the impact on performance shouldn't be a concern. Greater flexibility and ease
of use, especially for newbies (RTTI is difficult and poorly documented) is
needed if freepascal/Lazarus is to become universally adopted.
Can there please be a discussion on this? Thanks!
A. G.
On Thursday, January 30, 2014 3:58 PM, Alejandro Gonzalo
<[email protected]> wrote:
OK, how about a compiler switch (that can be turned on or off) that SEARCHES
for the property (or event if defined in code and not by the Object Inspector)?
It shouldn't be so difficult to deal with Sender (or components in a loop)
where the exact Type is not known in advance, just the presence of a specific
property or Event. If the switch can be turned Off again after the routine,
the impact on performance shouldn't be a concern. Greater flexibility and ease
of use, especially for newbies (RTTI is difficult and poorly documented) is
needed if freepascal/Lazarus is to become universally adopted.
Can there please be a discussion on this? Thanks!
A. G.
On Friday, January 17, 2014 6:22 PM, Hans-Peter Diettrich
<[email protected]> wrote:
Alejandro Gonzalo schrieb:
> In Delphi this will work even if the Sender is not a TdbGrid, as long as
> it has a DataSource property:
It only *happens* to work for you in Delphi.
> TdbGrid(Sender).datasource:=myDataSource;
This hack requires that Sender has a DataSource property in *exactly*
the same place where it sits in
TdbGrid. That's very unlikely for any
other class.
DoDi
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus