[fpc-devel] Streaming readonly properties

Vincent Snijders vsnijders at quicknet.nl
Thu Dec 14 08:54:23 CET 2006


Martin Schreiber schreef:
> 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;
> 

The problem with this solution, is the "write setsubcomponent;" part of the declaration.

I don't want the users of the LabeledEdit component can change the Label subcomponent.

Vincent



More information about the fpc-devel mailing list