[Lazarus] Control Notification bug?

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Feb 3 12:44:34 CET 2013


On Sun, 3 Feb 2013 13:32:09 +0200
Juha Manninen <juha.manninen62 at gmail.com> wrote:

> My new TCoolBar component uses overridden notification:
> 
>   procedure Notification(AComponent: TComponent; Operation:
> TOperation); override;
> 
> When Operation is opInsert, it adds a band and associates the new
> control with it.
> It works as expected when a control is dropped on a CoolBar.
> However, CoolBar is notified also when a control is dropped anywhere
> on the same form. I believe it is a bug, it should not happen.

No. The Notification is inherited from TComponent. So, it's about
Owner, not about TControl.Parent. Most controls are owned by the form.

 
> I solved the problem by checking if the control's parent = Self.

Good.

Mattias




More information about the Lazarus mailing list