From 6ab44daa2bfa8f8edf00432415bcfab2e9ac6b3c Mon Sep 17 00:00:00 2001 From: paul Date: Thu, 31 May 2007 02:09:19 +0000 Subject: [PATCH] cleanup git-svn-id: trunk@11234 - --- lcl/interfaces/carbon/carbonwsbuttons.pp | 26 ------------ lcl/widgetset/wsbuttons.pp | 53 +----------------------- 2 files changed, 1 insertion(+), 78 deletions(-) diff --git a/lcl/interfaces/carbon/carbonwsbuttons.pp b/lcl/interfaces/carbon/carbonwsbuttons.pp index aeb51732f7..3bbcbf9eb5 100644 --- a/lcl/interfaces/carbon/carbonwsbuttons.pp +++ b/lcl/interfaces/carbon/carbonwsbuttons.pp @@ -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 //////////////////////////////////////////////////// diff --git a/lcl/widgetset/wsbuttons.pp b/lcl/widgetset/wsbuttons.pp index 7666de6867..3067c2bb5e 100644 --- a/lcl/widgetset/wsbuttons.pp +++ b/lcl/widgetset/wsbuttons.pp @@ -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.