[Lazarus] Bug creating a new control?

patspiper patspiper at gmail.com
Sat Feb 22 09:51:56 CET 2014


On 22/02/14 02:50, Fabio Luis Girardi wrote:
> Hi all!
>
> 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];
>
>
> 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.

Stephano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140222/a2b79838/attachment-0003.html>


More information about the Lazarus mailing list