[Lazarus] Custom composite components issue with latest Lazarus

Martin Schreiber mse00000 at gmail.com
Tue Feb 1 09:19:35 CET 2011


On Tuesday, 1. February 2011 09.10:01 Graeme Geldenhuys wrote:
> Hi,
>
> tiOPF v2 has a few "unsupported" LCL components. They are basically
> composite components (eg: a panel with other embedded components).
> Before, the following code compiled without problems. A user reported
> that it doesn't compile any more.
>
> ---8<-----------8<-----------8<-----------8<-----------8<-----------
>   {$IFDEF FPC}
>   Include(FLabel.ComponentStyle, csSubComponent);
>   Include(FLabel.ControlStyle, csNoDesignSelectable);
>   Include(FWinControl.ComponentStyle, csSubComponent);
>   Include(FWinControl.ControlStyle, csNoDesignSelectable);
>   {$ENDIF}
> ---8<-----------8<-----------8<-----------8<-----------8<-----------
>
>
> There are two problems really.
>
> 1) Since recent FPC release, the Include() may not take a property as a
> parameter. This is easily worked around, so not a problem.
>
> 2) ComponentStyle now seems to be a read-only property, where I guess
> before it was read/write.  How am I supposed to fix this code now?
> FComponentStyle is also Protected, so I can't access it normally, except
> with the "friend class hack". Is the hack the only way? Why is
> ComponentStyle now read-only, and why is there no SetComponentStyle
> method as replacement?
>
Please use
"
    procedure SetSubComponent(ASubComponent: Boolean);
"

Martin




More information about the Lazarus mailing list