mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-25 05:57:37 +01:00
CustomDrawn: Fixes compilation
git-svn-id: trunk@36018 -
This commit is contained in:
parent
1575cf7405
commit
a77dbf1589
@ -7,6 +7,7 @@ interface
|
|||||||
uses
|
uses
|
||||||
// RTL
|
// RTL
|
||||||
Classes, SysUtils, Types,
|
Classes, SysUtils, Types,
|
||||||
|
fpimage, fpcanvas,
|
||||||
// LazUtils
|
// LazUtils
|
||||||
lazutf8,
|
lazutf8,
|
||||||
// LCL -> Use only TForm, TWinControl, TCanvas and TLazIntfImage
|
// LCL -> Use only TForm, TWinControl, TCanvas and TLazIntfImage
|
||||||
@ -42,7 +43,7 @@ type
|
|||||||
procedure DrawCheckBoxSquare(ADest: TCanvas; ADestPos: TPoint; ASize: TSize;
|
procedure DrawCheckBoxSquare(ADest: TCanvas; ADestPos: TPoint; ASize: TSize;
|
||||||
AState: TCDControlState; AStateEx: TCDControlStateEx); override;
|
AState: TCDControlState; AStateEx: TCDControlStateEx); override;
|
||||||
// TCDGroupBox
|
// TCDGroupBox
|
||||||
procedure DrawGroupBox(ADest: TCanvas; ASize: TSize;
|
procedure DrawGroupBox(ADest: TFPCustomCanvas; ASize: TSize;
|
||||||
AState: TCDControlState; AStateEx: TCDControlStateEx); override;
|
AState: TCDControlState; AStateEx: TCDControlStateEx); override;
|
||||||
// ===================================
|
// ===================================
|
||||||
// Common Controls Tab
|
// Common Controls Tab
|
||||||
@ -187,44 +188,44 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDDrawerWinCE.DrawGroupBox(ADest: TCanvas;
|
procedure TCDDrawerWinCE.DrawGroupBox(ADest: TFPCustomCanvas;
|
||||||
ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx);
|
ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx);
|
||||||
var
|
var
|
||||||
FCaptionMiddle: integer;
|
FCaptionMiddle: integer;
|
||||||
lTextSize: TSize;
|
lTextSize: TSize;
|
||||||
lCaption: String;
|
lCaption: String;
|
||||||
begin
|
begin
|
||||||
FCaptionMiddle := ADest.TextHeight(cddTestStr) div 2;
|
FCaptionMiddle := (ADest as TCanvas).TextHeight(cddTestStr) div 2;
|
||||||
if FCaptionMiddle = 0 then FCaptionMiddle := AStateEx.Font.Size div 2;
|
if FCaptionMiddle = 0 then FCaptionMiddle := AStateEx.Font.Size div 2;
|
||||||
if FCaptionMiddle = 0 then FCaptionMiddle := 5;
|
if FCaptionMiddle = 0 then FCaptionMiddle := 5;
|
||||||
|
|
||||||
// Background
|
// Background
|
||||||
ADest.Brush.Color := AStateEx.ParentRGBColor;
|
ADest.Brush.FPColor := TColorToFPColor(AStateEx.ParentRGBColor);
|
||||||
ADest.Brush.Style := bsSolid;
|
ADest.Brush.Style := bsSolid;
|
||||||
ADest.Pen.Style := psSolid;
|
ADest.Pen.Style := psSolid;
|
||||||
ADest.Pen.Color := AStateEx.ParentRGBColor;
|
ADest.Pen.FPColor := TColorToFPColor(AStateEx.ParentRGBColor);
|
||||||
ADest.Rectangle(0, 0, ASize.cx, ASize.cy);
|
ADest.Rectangle(0, 0, ASize.cx, ASize.cy);
|
||||||
|
|
||||||
// frame
|
// frame
|
||||||
ADest.Pen.Color := clBlack;
|
ADest.Pen.FPColor := colBlack;
|
||||||
ADest.Pen.Style := psSolid;
|
ADest.Pen.Style := psSolid;
|
||||||
ADest.Brush.Style := bsClear;
|
ADest.Brush.Style := bsClear;
|
||||||
ADest.Rectangle(0, FCaptionMiddle, ASize.cx, ASize.cy);
|
ADest.Rectangle(0, FCaptionMiddle, ASize.cx, ASize.cy);
|
||||||
|
|
||||||
// ToDo: Make the caption smaller if it is too big
|
// ToDo: Make the caption smaller if it is too big
|
||||||
lCaption := AStateEx.Caption;
|
lCaption := AStateEx.Caption;
|
||||||
lTextSize := ADest.TextExtent(lCaption);
|
lTextSize := (ADest as TCanvas).TextExtent(lCaption);
|
||||||
|
|
||||||
// fill the text background
|
// fill the text background
|
||||||
ADest.Brush.Style := bsSolid;
|
ADest.Brush.Style := bsSolid;
|
||||||
ADest.Brush.Color := AStateEx.ParentRGBColor;
|
ADest.Brush.FPColor := TColorToFPColor(AStateEx.ParentRGBColor);
|
||||||
ADest.Pen.Style := psClear;
|
ADest.Pen.Style := psClear;
|
||||||
ADest.Rectangle(Bounds(FCaptionMiddle, 0, lTextSize.cx+5, lTextSize.cy));
|
ADest.Rectangle(Bounds(FCaptionMiddle, 0, lTextSize.cx+5, lTextSize.cy));
|
||||||
|
|
||||||
// paint text
|
// paint text
|
||||||
ADest.Pen.Style := psClear;
|
ADest.Pen.Style := psClear;
|
||||||
ADest.Brush.Style := bsClear;
|
ADest.Brush.Style := bsClear;
|
||||||
ADest.TextOut(FCaptionMiddle+3, 0, lCaption);
|
(ADest as TCanvas).TextOut(FCaptionMiddle+3, 0, lCaption);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCDDrawerWinCE.DrawTab(ADest: TCanvas; ADestPos: TPoint;
|
procedure TCDDrawerWinCE.DrawTab(ADest: TCanvas; ADestPos: TPoint;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user