[fpc-pascal] TReader Fixups

Michael Van Canneyt michael at freepascal.org
Fri Jan 21 09:13:58 CET 2005



On Fri, 21 Jan 2005, Mattias Gaertner wrote:

>
> I need to stream references in DefineProperties.
>
> For those not familar with the streaming of TReader/TWriter:
>
> For example TForm.ActiveControl is a class property and is a reference
> to TControl. TWriter simply writes the name of the control.
> TReader reads the identifier, but during streaming not all controls are
> created, so TReader saves this as ToDo in a FFixUps list and sets all
> references after loading.
> That's a great feature, but it is private. You can not use it in your
> DefineProperties. It seems Delphi has the same problem.
> Either I'm blind and TReader has already a solution or we need a public
> method. For example
>
> procedure TReader.AddFixUp(Instance: TPersistent; PropInfo: Pointer;
>   const Ident: string);
> begin
>   FFixups.Add(TPropFixup.Create(Instance, Root, PropInfo, '', Ident));
> end;
>
> I can write a patch and test it.

That would be best.

Michael.




More information about the fpc-pascal mailing list