[Lazarus] Custom composite components issue with latest Lazarus

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Feb 1 09:10:01 CET 2011


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?



On a side note:
If you don't know what the code above does... well, Lazarus form
designer has a loong time bug with composite components, treating each
component separately (sub component could even be deleted), where in
fact they were supposed to be treated as a single component. The code
above alleviated some of the Lazarus issues, but it was still very buggy.


Regards,
  - Graeme -

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/





More information about the Lazarus mailing list