{ $Id$} { ***************************************************************************** * lclclasses.pp * * ------------- * * * * * ***************************************************************************** ***************************************************************************** * * * This file is part of the Lazarus Component Library (LCL) * * * * See the file COPYING.LCL, included in this distribution, * * for details about the copyright. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * * ***************************************************************************** Defines the base class for all LCL TComponents including controls. } unit LCLClasses; {$mode objfpc}{$H+} interface uses Classes, WSLCLClasses; type { TLCLComponent } TLCLComponent = class(TComponent) private FWidgetSetClass: TWSLCLComponentClass; protected property WidgetSetClass: TWSLCLComponentClass read FWidgetSetClass; public procedure BeforeDestruction; override; // fixes missing call to Destroying in FPC class function NewInstance: TObject; override; procedure RemoveAllHandlersOfObject(AnObject: TObject); virtual; end; implementation procedure TLCLComponent.BeforeDestruction; begin inherited; Destroying; end; function TLCLComponent.NewInstance: TObject; begin Result := inherited NewInstance; TLCLComponent(Result).FWidgetSetClass := FindWSComponentClass(Self); if TLCLComponent(Result).FWidgetSetClass = nil then TLCLComponent(Result).FWidgetSetClass := TWSLCLComponent; end; procedure TLCLComponent.RemoveAllHandlersOfObject(AnObject: TObject); begin end; end.