mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-22 02:19:37 +02:00
Starts preparring customdrawncontrols.pas for usage inside customdrawnws
git-svn-id: trunk@33868 -
This commit is contained in:
parent
ec49388044
commit
afe0cc0ae5
@ -60,11 +60,11 @@ type
|
|||||||
//
|
//
|
||||||
property DrawStyle: TCDDrawStyle read FDrawStyle write SetDrawStyle;
|
property DrawStyle: TCDDrawStyle read FDrawStyle write SetDrawStyle;
|
||||||
public
|
public
|
||||||
//
|
|
||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure EraseBackground(DC: HDC); override;
|
procedure EraseBackground(DC: HDC); override;
|
||||||
procedure Paint; override;
|
procedure Paint; override;
|
||||||
|
procedure DrawToCanvas(ACanvas: TCanvas);
|
||||||
end;
|
end;
|
||||||
TCDControlClass = class of TCDControl;
|
TCDControlClass = class of TCDControl;
|
||||||
|
|
||||||
@ -799,35 +799,37 @@ end;
|
|||||||
procedure TCDControl.Paint;
|
procedure TCDControl.Paint;
|
||||||
var
|
var
|
||||||
ABmp: TBitmap;
|
ABmp: TBitmap;
|
||||||
lSize: TSize;
|
|
||||||
lControlId: TCDControlID;
|
|
||||||
begin
|
begin
|
||||||
inherited Paint;
|
inherited Paint;
|
||||||
|
|
||||||
PrepareCurrentDrawer();
|
|
||||||
|
|
||||||
{$ifdef CDControlsDoDoubleBuffer}
|
{$ifdef CDControlsDoDoubleBuffer}
|
||||||
ABmp := TBitmap.Create;
|
ABmp := TBitmap.Create;
|
||||||
try
|
try
|
||||||
ABmp.Width := Width;
|
ABmp.Width := Width;
|
||||||
ABmp.Height := Height;
|
ABmp.Height := Height;
|
||||||
lSize := Size(Width, Height);
|
DrawToCanvas(ABmp.Canvas);
|
||||||
lControlId := GetControlId();
|
|
||||||
PrepareControlState;
|
|
||||||
PrepareControlStateEx;
|
|
||||||
FDrawer.DrawControl(ABmp.Canvas, Point(0, 0),
|
|
||||||
lSize, lControlId, FState, FStateEx);
|
|
||||||
Canvas.Draw(0, 0, ABmp);
|
Canvas.Draw(0, 0, ABmp);
|
||||||
finally
|
finally
|
||||||
ABmp.Free;
|
ABmp.Free;
|
||||||
end;
|
end;
|
||||||
{$else}
|
{$else}
|
||||||
|
DrawToCanvas(Canvas);
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TCDControl.DrawToCanvas(ACanvas: TCanvas);
|
||||||
|
var
|
||||||
|
ABmp: TBitmap;
|
||||||
|
lSize: TSize;
|
||||||
|
lControlId: TCDControlID;
|
||||||
|
begin
|
||||||
|
PrepareCurrentDrawer();
|
||||||
|
|
||||||
lSize := Size(Width, Height);
|
lSize := Size(Width, Height);
|
||||||
lControlId := GetControlId();
|
lControlId := GetControlId();
|
||||||
PrepareControlState;
|
PrepareControlState;
|
||||||
PrepareControlStateEx;
|
PrepareControlStateEx;
|
||||||
FDrawer.DrawControl(Canvas, lSize, lControlId, FState, FStateEx);
|
FDrawer.DrawControl(Canvas, lSize, lControlId, FState, FStateEx);
|
||||||
{$endif}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDControl.MouseEnter;
|
procedure TCDControl.MouseEnter;
|
||||||
|
Loading…
Reference in New Issue
Block a user