mirror of
				https://gitlab.com/freepascal.org/lazarus/lazarus.git
				synced 2025-11-04 11:24:40 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			71 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
			
		
		
	
	
			71 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			ObjectPascal
		
	
	
	
	
	
{ $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
 | 
						|
  public             
 | 
						|
    procedure BeforeDestruction; override; // fixes missing call to Destroying in FPC
 | 
						|
    class function NewInstance: TObject; override;
 | 
						|
    procedure RemoveAllHandlersOfObject(AnObject: TObject); virtual;
 | 
						|
    property WidgetSetClass: TWSLCLComponentClass read FWidgetSetClass;
 | 
						|
  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.
 |