[Lazarus] Difference between Delphi 2010 / Lazarus
michael.vancanneyt at wisa.be
michael.vancanneyt at wisa.be
Fri Dec 14 11:48:07 CET 2012
On Fri, 14 Dec 2012, Mattias Gaertner wrote:
> On Fri, 14 Dec 2012 11:30:31 +0100 (CET)
> michael.vancanneyt at wisa.be wrote:
>
>>
>>
>> On Fri, 14 Dec 2012, Jorge Gonçalves wrote:
>>
>> >>
>> >> What does "Calculated" do?
>> >>>
>> >>
>> >> Judging from the Delphi code, it is no longer used. The GetCalculated
>> >> returns
>> >>
>> >>
>> > Yes i know.
>> > The problem surges when we read the dfm. The reader will give one exception
>> > that the property is unknown.
>> > If we try to remove the property from the file, Delphi will introduce them
>> > again, next time we edit the datamoudule.
>>
>> You can install an unknown property event handler in TReader: OnPropertyNotFound
>>
>> But that requires that you are able to choose which reader is used, because
>> now you cannot: I've long wanted to install a hook so you can select which
>> reader/writer is used in TStream.ReadComponent.
>>
>> Maybe the lazarus implementation offers a hook ?
>
> Maybe you mean in unit lresources.pp:
> LRSObjectReaderClass: TLRSObjectReaderClass=TLRSObjectReader;
> LRSObjectWriterClass: TLRSObjectWriterClass=TLRSObjectWriter;
Something like it, and also the hooks you posted in your other reply.
I think that the 2 variables you post above can be moved to the classes
unit: ObjectReaderClass and ObjectWriterClass. These should then be used in
the TStream.ReadComponent and TStream.WriteComponent.
That's what I meant with the 'install a hook'.
Once it is in place, the LCL can simply set these hooks, and remove any
custom hooks you made.
Michael.
More information about the Lazarus
mailing list