mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 15:16:04 +02:00
cleanup
git-svn-id: trunk@11234 -
This commit is contained in:
parent
34e4c10709
commit
6ab44daa2b
@ -68,7 +68,6 @@ type
|
||||
private
|
||||
protected
|
||||
public
|
||||
class procedure DrawFrame(const ASpeedButton: TCustomSpeedButton; const ADrawFlags: Integer; var ARect: TRect); override;
|
||||
end;
|
||||
|
||||
|
||||
@ -156,31 +155,6 @@ begin
|
||||
TCarbonBitBtn(ABitBtn.Handle).SetLayout(AValue);
|
||||
end;
|
||||
|
||||
{ TCarbonWSSpeedButton }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TCarbonWSSpeedButton.DrawFrame
|
||||
Params: ASpeedButton - LCL custom speed button
|
||||
ADrawFlags - Frame draw flags (DFCS_*)
|
||||
ARect - Frame rectangle, returned adjusted to frame client
|
||||
area
|
||||
|
||||
Draws a speed button frame according to the specified draw flags in Carbon
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TCarbonWSSpeedButton.DrawFrame(const ASpeedButton: TCustomSpeedButton;
|
||||
const ADrawFlags: Integer; var ARect: TRect);
|
||||
var
|
||||
DC: HDC;
|
||||
begin
|
||||
if (ADrawFlags and DFCS_FLAT) = 0 then
|
||||
begin
|
||||
DC := ASpeedButton.Canvas.GetUpdatedHandle([csBrushValid, csPenValid]);
|
||||
|
||||
TCarbonDeviceContext(DC).DrawFrameControl(ARect, DFC_BUTTON, ADrawFlags);
|
||||
end;
|
||||
// TODO: transparent and colored opaque style
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
|
@ -72,7 +72,6 @@ type
|
||||
|
||||
TWSSpeedButtonClass = class of TWSSpeedButton;
|
||||
TWSSpeedButton = class(TWSGraphicControl)
|
||||
class procedure DrawFrame(const ASpeedButton: TCustomSpeedButton; const ADrawFlags: Integer; var ARect: TRect); virtual;
|
||||
end;
|
||||
|
||||
|
||||
@ -112,56 +111,6 @@ class procedure TWSBitBtn.SetSpacing(const ABitBtn: TCustomBitBtn;
|
||||
begin
|
||||
end;
|
||||
|
||||
|
||||
{ TWSSpeedButton }
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Method: TWSSpeedButton.DrawFrame
|
||||
Params: ASpeedButton - LCL custom speed button
|
||||
ADrawFlags - Frame draw flags (DFCS_*)
|
||||
ARect - Frame rectangle, returned adjusted to frame client
|
||||
area
|
||||
|
||||
Draws a speed button frame according to the specified draw flags
|
||||
------------------------------------------------------------------------------}
|
||||
class procedure TWSSpeedButton.DrawFrame(const ASpeedButton: TCustomSpeedButton;
|
||||
const ADrawFlags: Integer; var ARect: TRect);
|
||||
var
|
||||
Bevel: TBevelCut;
|
||||
begin
|
||||
// do not draw anything if flat and mouse not in control (simplified)
|
||||
if ASpeedButton.Transparent then
|
||||
begin
|
||||
if (ADrawFlags and DFCS_FLAT) = 0 then
|
||||
begin
|
||||
if (ADrawFlags and DFCS_PUSHED) <> 0 then
|
||||
Bevel := bvLowered
|
||||
else
|
||||
Bevel := bvRaised;
|
||||
|
||||
ASpeedButton.Canvas.Frame3D(ARect, 1, Bevel);
|
||||
InflateRect(ARect, -1, -1);
|
||||
end;
|
||||
end
|
||||
else
|
||||
begin
|
||||
if (ADrawFlags and DFCS_FLAT) = 0 then
|
||||
begin
|
||||
DrawFrameControl(
|
||||
ASpeedButton.Canvas.GetUpdatedHandle([csBrushValid,csPenValid]),
|
||||
ARect, DFC_BUTTON, ADrawFlags);
|
||||
|
||||
InflateRect(ARect, -1, -1);
|
||||
end;
|
||||
end;
|
||||
|
||||
if (not ASpeedButton.Transparent) and ASpeedButton.Enabled then
|
||||
begin
|
||||
ASpeedButton.Canvas.Brush.Color := ASpeedButton.Color;
|
||||
ASpeedButton.Canvas.FillRect(ARect);
|
||||
end;
|
||||
end;
|
||||
|
||||
initialization
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
@ -170,6 +119,6 @@ initialization
|
||||
////////////////////////////////////////////////////
|
||||
// RegisterWSComponent(TCustomButton, TWSButton);
|
||||
// RegisterWSComponent(TCustomBitBtn, TWSBitBtn);
|
||||
RegisterWSComponent(TCustomSpeedButton, TWSSpeedButton);
|
||||
// RegisterWSComponent(TCustomSpeedButton, TWSSpeedButton);
|
||||
////////////////////////////////////////////////////
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user