[fpc-devel] Streaming readonly properties

Martin Schreiber fpmse at bluewin.ch
Thu Dec 14 08:09:32 CET 2006


On Tuesday 12 December 2006 14.54, vsnijders at quicknet.nl wrote:
> As said in an earlier mail I have problems streaming the
> property EditLabel: TBoundLabel read FEditLabel;
> of a TLabeledEdit with fpc 2.1.1.
>

A usual solution:

 ttestcomp = class(tcomponent)
  private
   fsubcomponent: ttestsubcomponent;
   procedure setsubcomponent(const avalue: ttestsubcomponent);
  //...
  published
   property subcomponent: ttestsubcomponent read fsubcomponent
                           write setsubcomponent;
 end;

implementation

procedure ttestcomp.setsubcomponent(const avalue: ttestsubcomponent);
begin
 fsubcomponent.assign(avalue);
end;

Martin



More information about the fpc-devel mailing list