lazarus/lcl/widgetset/wsproc.pp
marc 1dfeafc69c * Native imagelists - part 3 add&remove
git-svn-id: trunk@10925 -
2007-04-09 23:17:44 +00:00

70 lines
2.4 KiB
ObjectPascal

{
/***************************************************************************
wsproc.pp
---------
Widgetset Utility Code
***************************************************************************/
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL, 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. *
* *
*****************************************************************************
Useful lower level helper functions and classes for implementing widgetsets.
}
unit WSProc;
{$mode objfpc}{$H+}
interface
uses
LCLClasses, LCLProc, Controls;
function WSCheckHandleAllocated(const AComponent: TLCLHandleComponent;
const AProcName: String): Boolean;
function WSCheckHandleAllocated(const AWincontrol: TWinControl;
const AProcName: String): Boolean;
implementation
function WSCheckHandleAllocated(const AComponent: TLCLHandleComponent;
const AProcName: String): Boolean;
procedure Warn;
begin
DebugLn('[WARNING] %s called without handle for %s(%s)', [AProcName, AComponent.Name, AComponent.ClassName]);
end;
begin
Result := AComponent.HandleAllocated;
if Result then Exit;
Warn;
end;
function WSCheckHandleAllocated(const AWincontrol: TWinControl;
const AProcName: String): Boolean;
procedure Warn;
begin
DebugLn('[WARNING] %s called without handle for %s(%s)', [AProcName, AWincontrol.Name, AWincontrol.ClassName]);
end;
begin
Result := AWinControl.HandleAllocated;
if Result then Exit;
Warn;
end;
end.