lcl: formatting, cleanup

git-svn-id: trunk@28339 -
This commit is contained in:
paul 2010-11-19 09:56:17 +00:00
parent 38fb9f15de
commit 7854080d5d
3 changed files with 7 additions and 17 deletions

View File

@ -255,7 +255,6 @@ type
procedure SetControl(AControl: TControl);
protected
procedure CreateHandle; override;
procedure CreateFont; override;
function GetDefaultColor(const ADefaultColorType: TDefaultColorType): TColor; override;
public
constructor Create;

View File

@ -33,15 +33,6 @@ begin
end;
end;
{------------------------------------------------------------------------------
procedure TControlCanvas.CreateFont;
------------------------------------------------------------------------------}
procedure TControlCanvas.CreateFont;
begin
inherited CreateFont;
//DebugLn('TControlCanvas.CreateFont A ',ClassName,' Control=',Control.Name,':',Control.ClassName,' ',Font.Name,' ',Font.Height);
end;
function TControlCanvas.GetDefaultColor(const ADefaultColorType: TDefaultColorType): TColor;
begin
if Assigned(FControl) then
@ -90,7 +81,8 @@ begin
//DebugLn('[TControlCanvas.CreateHandle] ',FControl<>nil,' DC=',DbgS(FDeviceContext,8),' WinHandle=',DbgS(FWindowHandle,8));
if FControl = nil then
inherited CreateHandle
else begin
else
begin
if ControlIsPainting then
debugln(['TControlCanvas.CreateHandle WARNING: accessing the canvas of '+DbgSName(FControl)+' is not supported outside of paint message']);
if FDeviceContext = 0 then
@ -122,5 +114,5 @@ end;
function TControlCanvas.ControlIsPainting: boolean;
begin
Result:=(FControl<>nil) and FControl.IsProcessingPaintMsg;
Result := Assigned(FControl) and FControl.IsProcessingPaintMsg;
end;

View File

@ -56,8 +56,7 @@ end;
------------------------------------------------------------------------------}
destructor TCustomControl.Destroy;
begin
FCanvas.Free;
FCanvas:=nil;
FreeAndNil(FCanvas);
inherited Destroy;
end;
@ -82,15 +81,15 @@ end;
procedure TCustomControl.FontChanged(Sender: TObject);
begin
Canvas.Font:=Font;
Canvas.Font := Font;
inherited FontChanged(Sender);
end;
procedure TCustomControl.SetColor(Value: TColor);
begin
if Value=Color then exit;
if Value = Color then Exit;
inherited SetColor(Value);
Canvas.Brush.Color:=Color;
Canvas.Brush.Color := Color;
end;
class procedure TCustomControl.WSRegisterClass;