[Lazarus] Bug creating a new control?

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Feb 23 17:51:58 CET 2014



> patspiper <patspiper at gmail.com> hat am 22. Februar 2014 um 09:51 geschrieben:
> 
> 
> On 22/02/14 02:50, Fabio Luis Girardi wrote:
> [...]
> I started the TDBCtrlGrid implementation some days ago. At this point, I don't
> know if I'm doing some mistake or if Lazarus has a bug. The problem is that I
> can't put any controls on TDBCtrlGrid area, but I can put controls with
> csReplicatable in ControlStyle inside a "RowPanel" (TDBCtrlGridRow class) that
> is a control that will be used to draw rows, BUT LAZARUS don't do this!!
> 
> TDBCtrlGrid is created with 
> 
> ControlStyle := [csOpaque, csDoubleClicks];
> 
> and TDBCtrlGridRow is created with
> 
> ControlStyle := [csAcceptsControls, csCaptureMouse, csClickEvents,
>     csDoubleClicks, csOpaque, csReplicatable];

What do you use as ancestor?
You probably you need to use TCustomControl.


> Logically, the row panel must accept controls, but TDBCtrlGrid NOR
> TDBCtrlGridRow accepts controls.
> 
> 
> 
>  Add a (protected) method to your class:
>      function ChildClassAllowed(ChildClass: TClass): boolean; override;
>  and set its result to true if you want to allow the ChildClass to be dropped
> on your component.

This function is needed to limit the allowed classes. By default any class is
allowed.
But only a few classes implements adding child controls. For example
TCustomControl.

Mattias




More information about the Lazarus mailing list