LCL: TSpeedButton: added PaintBackground

git-svn-id: trunk@11852 -
This commit is contained in:
mattias 2007-08-23 20:31:46 +00:00
parent 4c1b802fe1
commit 99e2799127
2 changed files with 14 additions and 8 deletions

View File

@ -240,6 +240,7 @@ type
procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override;
procedure Paint; override;
procedure PaintBackground(var PaintRect: TRect); virtual;
procedure SetDown(Value: Boolean);
procedure SetGroupIndex(const Value: Integer);
procedure SetFlat(const Value: Boolean);

View File

@ -491,15 +491,9 @@ begin
if FGlyph=nil then exit;
PaintRect:=ClientRect;
FLastDrawDetails := GetDrawDetails;
if not Transparent and ThemeServices.HasTransparentParts(FLastDrawDetails) then
begin
Canvas.Brush.Color := Color;
Canvas.FillRect(PaintRect);
end;
ThemeServices.DrawElement(Canvas.Handle, FLastDrawDetails, PaintRect);
PaintRect := ThemeServices.ContentRect(Canvas.Handle, FLastDrawDetails, PaintRect);
PaintBackground(PaintRect);
GlyphSize := GetGlyphSize(PaintRect);
GlyphWidth := GlyphSize.CX;
@ -604,6 +598,17 @@ begin
inherited Paint;
end;
procedure TCustomSpeedButton.PaintBackground(var PaintRect: TRect);
begin
if not Transparent and ThemeServices.HasTransparentParts(FLastDrawDetails) then
begin
Canvas.Brush.Color := Color;
Canvas.FillRect(PaintRect);
end;
ThemeServices.DrawElement(Canvas.Handle, FLastDrawDetails, PaintRect);
PaintRect := ThemeServices.ContentRect(Canvas.Handle, FLastDrawDetails, PaintRect);
end;
{------------------------------------------------------------------------------
Method: TCustomSpeedButton.MouseDown
Params: Button: