diff --git a/components/customdrawn/customdrawn_common.pas b/components/customdrawn/customdrawn_common.pas index ed37cff585..95c7c19860 100644 --- a/components/customdrawn/customdrawn_common.pas +++ b/components/customdrawn/customdrawn_common.pas @@ -26,6 +26,9 @@ type function GetMeasures(AMeasureID: Integer): Integer; override; function GetMeasuresEx(ADest: TCanvas; AMeasureID: Integer; AState: TCDControlState; AStateEx: TCDControlStateEx): Integer; override; + procedure CalculatePreferredSize(ADest: TCanvas; AControlId: TCDControlID; + AState: TCDControlState; AStateEx: TCDControlStateEx; + var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override; function GetColor(AColorID: Integer): TColor; override; procedure DrawControl(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AControl: TCDControlID; AState: TCDControlState; AStateEx: TCDControlStateEx); override; @@ -41,9 +44,6 @@ type procedure DrawEdit(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDEditStateEx); override; // TCDCheckBox - procedure CalculateCheckBoxPreferredSize(ADest: TCanvas; - AState: TCDControlState; AStateEx: TCDControlStateEx; - var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); override; procedure DrawCheckBox(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx); override; // TCDGroupBox @@ -52,6 +52,8 @@ type // =================================== // Common Controls Tab // =================================== + procedure DrawTrackBar(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; + AState: TCDControlState; AStateEx: TCDTrackBarStateEx); override; // TCDCustomTabControl procedure DrawCTabControl(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDCTabControlStateEx); override; @@ -104,6 +106,25 @@ begin end; end; +procedure TCDDrawerCommon.CalculatePreferredSize(ADest: TCanvas; + AControlId: TCDControlID; AState: TCDControlState; + AStateEx: TCDControlStateEx; var PreferredWidth, PreferredHeight: integer; + WithThemeSpace: Boolean); +begin + PreferredWidth := 0; + PreferredHeight := 0; + + case AControlId of + cidCheckBox: + begin + if AStateEx.AutoSize then + PreferredWidth := 21 + GetMeasuresEx(ADest, TCDCONTROL_CAPTION_WIDTH, AState, AStateEx); + + PreferredHeight := GetMeasuresEx(ADest, TCDCONTROL_CAPTION_HEIGHT, AState, AStateEx); + end; + end; +end; + function TCDDrawerCommon.GetColor(AColorID: Integer): TColor; begin case AColorId of @@ -121,7 +142,12 @@ procedure TCDDrawerCommon.DrawControl(ADest: TCanvas; ADestPos: TPoint; AStateEx: TCDControlStateEx); begin case AControl of - cidButton: DrawButton(ADest, ADestPos, ASize, AState, AStateEx); + cidButton: DrawButton(ADest, ADestPos, ASize, AState, AStateEx); + cidEdit: DrawEdit(ADest, ADestPos, ASize, AState, TCDEditStateEx(AStateEx)); + cidCheckBox: DrawCheckBox(ADest, ADestPos, ASize, AState, AStateEx); + cidGroupBox: DrawGroupBox(ADest, ADestPos, ASize, AState, AStateEx); + cidTrackBar: DrawTrackBar(ADest, ADestPos, ASize, AState, TCDTrackBarStateEx(AStateEx)); + cidCTabControl:DrawCTabControl(ADest, ADestPos, ASize, AState, TCDCTabControlStateEx(AStateEx)); end; end; @@ -265,18 +291,6 @@ begin end; end; -procedure TCDDrawerCommon.CalculateCheckBoxPreferredSize(ADest: TCanvas; - AState: TCDControlState; AStateEx: TCDControlStateEx; var PreferredWidth, - PreferredHeight: integer; WithThemeSpace: Boolean); -begin - PreferredWidth := 0; - - if AStateEx.AutoSize then - PreferredWidth := 21 + GetMeasuresEx(ADest, TCDCONTROL_CAPTION_WIDTH, AState, AStateEx); - - PreferredHeight := GetMeasuresEx(ADest, TCDCONTROL_CAPTION_HEIGHT, AState, AStateEx); -end; - procedure TCDDrawerCommon.DrawCheckBox(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx); const @@ -370,6 +384,12 @@ begin ADest.TextOut(FCaptionMiddle, 0, AStateEx.Caption); end; +procedure TCDDrawerCommon.DrawTrackBar(ADest: TCanvas; ADestPos: TPoint; + ASize: TSize; AState: TCDControlState; AStateEx: TCDTrackBarStateEx); +begin + +end; + procedure TCDDrawerCommon.DrawCTabControl(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDCTabControlStateEx); var diff --git a/components/customdrawn/customdrawn_extra1.pas b/components/customdrawn/customdrawn_extra1.pas index f33b6dea88..18909ace4c 100644 --- a/components/customdrawn/customdrawn_extra1.pas +++ b/components/customdrawn/customdrawn_extra1.pas @@ -6,16 +6,26 @@ interface uses // RTL - Classes, SysUtils, - // fpimage - fpcanvas, fpimgcanv, fpimage, + Classes, SysUtils, Types, // LCL -> Use only TForm, TWinControl, TCanvas and TLazIntfImage - Graphics, Controls, LCLType, LCLIntf, IntfGraphics, + Graphics, Controls, LCLType, // - customdrawncontrols, customdrawnutils; + customdrawndrawers, customdrawn_common; -{type - TCDButtonDrawerGrad = class(TCDButtonDrawer) +type + + { TCDDrawerExtra1 } + + TCDDrawerExtra1 = class(TCDDrawerCommon) + public + function GetMeasures(AMeasureID: Integer): Integer; override; + // =================================== + // Common Controls Tab + // =================================== + procedure DrawTrackBar(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; + AState: TCDControlState; AStateEx: TCDTrackBarStateEx); override; + end; +{ TCDButtonDrawerGrad = class(TCDButtonDrawer) public procedure DrawToIntfImage(ADest: TFPImageCanvas; CDButton: TCDButton); override; procedure DrawToCanvas(ADest: TCanvas; CDButton: TCDButton); override; @@ -87,6 +97,30 @@ end; procedure TCDTrackBarDrawerGraph.DrawToIntfImage(ADest: TFPImageCanvas; FPImg: TLazIntfImage; CDTrackBar: TCDTrackBar); + +procedure TCDTrackBarDrawerGraph.GetGeometry(var ALeftBorder, + ARightBorder: Integer); +begin + ALeftBorder := 9; + ARightBorder := 9; +end; + + RegisterTrackBarDrawer(TCDTrackBarDrawerGraph.Create, dsExtra1);} + +{ TCDDrawerExtra1 } + +function TCDDrawerExtra1.GetMeasures(AMeasureID: Integer): Integer; +begin + case AMeasureId of + TCDTRACKBAR_LEFT_SPACING: Result := 9; + TCDTRACKBAR_RIGHT_SPACING: Result := 9; + else + Result:=inherited GetMeasures(AMeasureID); + end; +end; + +procedure TCDDrawerExtra1.DrawTrackBar(ADest: TCanvas; ADestPos: TPoint; + ASize: TSize; AState: TCDControlState; AStateEx: TCDTrackBarStateEx); const CDBarEdge = 18; var @@ -96,43 +130,40 @@ var pStepWidth, pHalfStepWidth: Integer; begin // Sanity check - if CDTrackBar.Max - CDTrackBar.Min <= 0 then + if AStateEx.Max - AStateEx.Min <= 0 then raise Exception.Create('[TCDTrackBarDrawerGraph.DrawToIntfImage] Max-Min must be at least 1'); // Preparations - StepsCount := CDTrackBar.Max - CDTrackBar.Min + 1; - pStepWidth := (CDTrackBar.Width - CDBarEdge) div StepsCount; - pHalfStepWidth := (CDTrackBar.Width - CDBarEdge) div (StepsCount * 2); + StepsCount := AStateEx.Max - AStateEx.Min + 1; + pStepWidth := (ASize.cx - CDBarEdge) div StepsCount; + pHalfStepWidth := (ASize.cx - CDBarEdge) div (StepsCount * 2); // The bottom part of the drawing - lDrawingBottom := CDTrackBar.Height - 10; + lDrawingBottom := ASize.cy - 10; // Background - if CDTrackBar.Parent = nil then - ADest.Brush.FPColor := colLtGray - else - ADest.Brush.FPColor := TColorToFPColor(ColorToRGB(CDTrackBar.Color)); + ADest.Brush.Color := AStateEx.ParentRGBColor; ADest.Brush.Style := bsSolid; ADest.Pen.Style := psClear; - ADest.Rectangle(0, 0, CDTrackBar.Width, CDTrackBar.Height); - ADest.Brush.FPColor := TColorToFPColor(ColorToRGB($006BB6E6)); + ADest.Rectangle(0, 0, ASize.cx, ASize.cy); + ADest.Brush.Color := ColorToRGB($006BB6E6); // Draws the double-sided arrow in the center of the slider ADest.Pen.Style := psSolid; - ADest.Pen.FPColor := TColorToFPColor(ColorToRGB($006BB6E6)); - ADest.Line(0, lDrawingBottom, CDTrackBar.Width, lDrawingBottom); + ADest.Pen.Color := ColorToRGB($006BB6E6); + ADest.Line(0, lDrawingBottom, ASize.cx, lDrawingBottom); ADest.Line(3, lDrawingBottom - 1, 6, lDrawingBottom - 1); ADest.Line(5, lDrawingBottom - 2, 6, lDrawingBottom - 2); ADest.Line(3, lDrawingBottom + 1, 6, lDrawingBottom + 1); ADest.Line(5, lDrawingBottom + 2, 6, lDrawingBottom + 2); - ADest.Line(CDTrackBar.Width - 1 - 3, lDrawingBottom - 1, CDTrackBar.Width - 1 - 6, lDrawingBottom - 1); - ADest.Line(CDTrackBar.Width - 1 - 5, lDrawingBottom - 2, CDTrackBar.Width - 1 - 6, lDrawingBottom - 2); - ADest.Line(CDTrackBar.Width - 1 - 3, lDrawingBottom + 1, CDTrackBar.Width - 1 - 6, lDrawingBottom + 1); - ADest.Line(CDTrackBar.Width - 1 - 5, lDrawingBottom + 2, CDTrackBar.Width - 1 - 6, lDrawingBottom + 2); - ADest.Pen.FPColor := TColorToFPColor(ColorToRGB(clGray)); - ADest.Brush.FPColor := TColorToFPColor(ColorToRGB($00F0F0F0)); + ADest.Line(ASize.cx - 1 - 3, lDrawingBottom - 1, ASize.cx - 1 - 6, lDrawingBottom - 1); + ADest.Line(ASize.cx - 1 - 5, lDrawingBottom - 2, ASize.cx - 1 - 6, lDrawingBottom - 2); + ADest.Line(ASize.cx - 1 - 3, lDrawingBottom + 1, ASize.cx - 1 - 6, lDrawingBottom + 1); + ADest.Line(ASize.cx - 1 - 5, lDrawingBottom + 2, ASize.cx - 1 - 6, lDrawingBottom + 2); + ADest.Pen.Color := ColorToRGB(clGray); + ADest.Brush.Color := ColorToRGB($00F0F0F0); // Draws the decorative bars and also the slider button @@ -148,17 +179,17 @@ begin ADest.Brush.Style := bsSolid; ADest.Pen.Style := psSolid; - ADest.Pen.FPColor := colBlack; - if i + CDTrackBar.Min <= CDTrackBar.Position then - ADest.Brush.FPColor := colDkGray + ADest.Pen.Color := clBlack; + if i + AStateEx.Min <= AStateEx.Position then + ADest.Brush.Color := clDkGray else - ADest.Brush.FPColor := colWhite; + ADest.Brush.Color := clWhite; ADest.Rectangle(dRect); // Draw the slider - if i + CDTrackBar.Min = CDTrackBar.Position then + if i + AStateEx.Min = AStateEx.Position then begin ADest.Brush.FPColor := TColorToFPColor(ColorToRGB($006BB6E6)); ADest.Brush.Style := bsSolid; @@ -172,31 +203,23 @@ begin end; ADest.Pen.FPColor := TColorToFPColor(ColorToRGB($007BC6F6)); - ADest.Line(7, lDrawingBottom - 1, CDTrackBar.Width - 8, lDrawingBottom - 1); - ADest.Line(7, lDrawingBottom + 1, CDTrackBar.Width - 8, lDrawingBottom + 1); + ADest.Line(7, lDrawingBottom - 1, ASize.cx - 8, lDrawingBottom - 1); + ADest.Line(7, lDrawingBottom + 1, ASize.cx - 8, lDrawingBottom + 1); ADest.Colors[2, lDrawingBottom - 1] := ADest.Pen.FPColor; ADest.Colors[4, lDrawingBottom - 2] := ADest.Pen.FPColor; ADest.Colors[2, lDrawingBottom + 1] := ADest.Pen.FPColor; ADest.Colors[4, lDrawingBottom + 2] := ADest.Pen.FPColor; ADest.Colors[6, lDrawingBottom - 3] := ADest.Pen.FPColor; ADest.Colors[6, lDrawingBottom + 3] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 2, lDrawingBottom - 1] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 4, lDrawingBottom - 2] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 2, lDrawingBottom + 1] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 4, lDrawingBottom + 2] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 6, lDrawingBottom - 3] := ADest.Pen.FPColor; - ADest.Colors[CDTrackBar.Width - 1 - 6, lDrawingBottom + 3] := ADest.Pen.FPColor; -end; - -procedure TCDTrackBarDrawerGraph.GetGeometry(var ALeftBorder, - ARightBorder: Integer); -begin - ALeftBorder := 9; - ARightBorder := 9; + ADest.Colors[ASize.cx - 1 - 2, lDrawingBottom - 1] := ADest.Pen.FPColor; + ADest.Colors[ASize.cx - 1 - 4, lDrawingBottom - 2] := ADest.Pen.FPColor; + ADest.Colors[ASize.cx - 1 - 2, lDrawingBottom + 1] := ADest.Pen.FPColor; + ADest.Colors[ASize.cx - 1 - 4, lDrawingBottom + 2] := ADest.Pen.FPColor; + ADest.Colors[ASize.cx - 1 - 6, lDrawingBottom - 3] := ADest.Pen.FPColor; + ADest.Colors[ASize.cx - 1 - 6, lDrawingBottom + 3] := ADest.Pen.FPColor; end; initialization - RegisterButtonDrawer(TCDButtonDrawerGrad.Create, dsExtra1); - RegisterTrackBarDrawer(TCDTrackBarDrawerGraph.Create, dsExtra1);} + RegisterDrawer(TCDDrawerExtra1.Create, dsExtra1); end. diff --git a/components/customdrawn/customdrawncontrols.pas b/components/customdrawn/customdrawncontrols.pas index 74431f878a..eeb887cf5c 100644 --- a/components/customdrawn/customdrawncontrols.pas +++ b/components/customdrawn/customdrawncontrols.pas @@ -35,6 +35,8 @@ type FDrawer: TCDDrawer; FState: TCDControlState; FStateEx: TCDControlStateEx; + procedure CalculatePreferredSize(var PreferredWidth, + PreferredHeight: integer; WithThemeSpace: Boolean); override; procedure PrepareCurrentDrawer(); virtual; procedure SetDrawStyle(const AValue: TCDDrawStyle); virtual; function GetClientRect: TRect; override; @@ -193,8 +195,6 @@ type FCheckedState: TCheckBoxState; protected procedure DoButtonUp(); override; - procedure CalculatePreferredSize(var PreferredWidth, - PreferredHeight: integer; WithThemeSpace: Boolean); override; function GetControlId: TCDControlID; override; public constructor Create(AOwner: TComponent); override; @@ -207,16 +207,6 @@ type property State: TCheckBoxState read FCheckedState write FCheckedState default cbUnchecked; end; - { TCDCheckBoxDrawer } - - TCDCheckBoxDrawer = class(TCDDrawer) - public - procedure CalculatePreferredSize(CDCheckBox: TCDCheckBox; var PreferredWidth, - PreferredHeight: integer; WithThemeSpace: Boolean); virtual; abstract; - procedure DrawToIntfImage(ADest: TFPImageCanvas; CDCheckBox: TCDCheckBox); virtual; abstract; - procedure DrawToCanvas(ADest: TCanvas; CDCheckBox: TCDCheckBox); virtual; abstract; - end; - // =================================== // Common Controls Tab // =================================== @@ -264,6 +254,7 @@ type //procedure Paint; override; published property Color; + property DrawStyle; property Max: integer read FMax write SetMax default 10; property Min: integer read FMin write SetMin default 0; property OnChange: TNotifyEvent read FOnChange write FOnChange; @@ -271,15 +262,6 @@ type property TabStop default True; end; - { TCDTrackBarDrawer } - - TCDTrackBarDrawer = class(TCDDrawer) - public - procedure DrawToIntfImage(ADest: TFPImageCanvas; FPImg: TLazIntfImage; - CDTrackBar: TCDTrackBar); virtual; abstract; - procedure GetGeometry(var ALeftBorder, ARightBorder: Integer); virtual; abstract; - end; - { TCDListView } (* TCDListView = class(TCDControl) @@ -694,13 +676,6 @@ begin Invalidate; end; -procedure TCDCheckBox.CalculatePreferredSize(var PreferredWidth, - PreferredHeight: integer; WithThemeSpace: Boolean); -begin - TCDCheckBoxDrawer(FDrawer).CalculatePreferredSize( - Self, PreferredWidth, PreferredHeight, WithThemeSpace) -end; - function TCDCheckBox.GetControlId: TCDControlID; begin Result := cidCheckBox; @@ -822,7 +797,7 @@ end; function TCDCustomTabControl.GetControlId: TCDControlID; begin - Result := cidCustomTabControl; + Result := cidCTabControl; end; procedure TCDCustomTabControl.CreateControlStateEx; @@ -878,6 +853,15 @@ end; { TCDControl } +procedure TCDControl.CalculatePreferredSize(var PreferredWidth, + PreferredHeight: integer; WithThemeSpace: Boolean); +begin + PrepareControlState; + PrepareControlStateEx; + FDrawer.CalculatePreferredSize(Canvas, GetControlId(), FState, FStateEx, + PreferredWidth, PreferredHeight, WithThemeSpace); +end; + procedure TCDControl.PrepareCurrentDrawer; begin FDrawer := GetDrawer(FDrawStyle); @@ -925,9 +909,12 @@ end; procedure TCDControl.PrepareControlStateEx; begin - if Parent <> nil then FStateEx.ParentRGBColor := Parent.GetRGBBackgroundColor; + if Parent <> nil then FStateEx.ParentRGBColor := Parent.GetRGBBackgroundColor + else FStateEx.ParentRGBColor := clSilver; + if Color = clDefault then FStateEx.RGBColor := FDrawer.GetControlColor(GetControlId()) else FStateEx.RGBColor := GetRGBBackgroundColor; + FStateEx.Caption := Caption; FStateEx.Font := Font; FStateEx.AutoSize := AutoSize; @@ -1151,7 +1138,9 @@ function TCDTrackBar.GetPositionFromMousePos(X, Y: integer): integer; var lLeftBorder, lRightBorder: Integer; begin - TCDTrackBarDrawer(FDrawer).GetGeometry(lLeftBorder, lRightBorder); + lLeftBorder := FDrawer.GetMeasures(TCDTRACKBAR_LEFT_SPACING); + lRightBorder := FDrawer.GetMeasures(TCDTRACKBAR_RIGHT_SPACING); + if X > Width - lRightBorder then Result := FMax else if X < lLeftBorder then Result := FMin else Result := FMin + (X - lLeftBorder) * (FMax - FMin + 1) div (Width - lRightBorder - lLeftBorder); diff --git a/components/customdrawn/customdrawndrawers.pas b/components/customdrawn/customdrawndrawers.pas index 65e52c7edf..22171f6898 100644 --- a/components/customdrawn/customdrawndrawers.pas +++ b/components/customdrawn/customdrawndrawers.pas @@ -15,13 +15,15 @@ const // Measures TCDEDIT_LEFT_TEXT_SPACING = $400; // The space between the start of the text and the left end of the control TCDEDIT_RIGHT_TEXT_SPACING = $401; // The space between the end of the text and the right end of the control + TCDTRACKBAR_LEFT_SPACING = $1000; + TCDTRACKBAR_RIGHT_SPACING = $1001; // Measures Ex TCDCONTROL_CAPTION_WIDTH = $100; TCDCONTROL_CAPTION_HEIGHT = $101; - TCDCTABCONTROL_TAB_HEIGHT = $1000; - TCDCTABCONTROL_TAB_WIDTH = $1001; + TCDCTABCONTROL_TAB_HEIGHT = $1100; + TCDCTABCONTROL_TAB_WIDTH = $1101; // Colors TCDEDIT_BACKGROUND_COLOR = $400; @@ -128,7 +130,7 @@ type cidCheckBox, cidGroupBox, cidTrackBar, - cidCustomTabControl + cidCTabControl ); { TCDDrawer } @@ -144,6 +146,9 @@ type function GetMeasures(AMeasureID: Integer): Integer; virtual; abstract; function GetMeasuresEx(ADest: TCanvas; AMeasureID: Integer; AState: TCDControlState; AStateEx: TCDControlStateEx): Integer; virtual; abstract; + procedure CalculatePreferredSize(ADest: TCanvas; AControlId: TCDControlID; + AState: TCDControlState; AStateEx: TCDControlStateEx; + var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); virtual; abstract; function GetColor(AColorID: Integer): TColor; virtual; abstract; procedure DrawControl(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AControl: TCDControlID; AState: TCDControlState; AStateEx: TCDControlStateEx); virtual; abstract; @@ -156,9 +161,6 @@ type procedure DrawEdit(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDEditStateEx); virtual; abstract; // TCDCheckBox - procedure CalculateCheckBoxPreferredSize(ADest: TCanvas; - AState: TCDControlState; AStateEx: TCDControlStateEx; - var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); virtual; abstract; procedure DrawCheckBox(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDControlStateEx); virtual; abstract; // TCDGroupBox @@ -167,6 +169,9 @@ type // =================================== // Common Controls Tab // =================================== + // TCDTrackBar + procedure DrawTrackBar(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; + AState: TCDControlState; AStateEx: TCDTrackBarStateEx); virtual; abstract; // TCDCustomTabControl procedure DrawCTabControl(ADest: TCanvas; ADestPos: TPoint; ASize: TSize; AState: TCDControlState; AStateEx: TCDCTabControlStateEx); virtual; abstract; @@ -232,13 +237,13 @@ end; function TCDDrawer.GetControlColor(AControlId: TCDControlID): TColor; begin case AControlId of - cidControl: Result := clSilver; - cidButton: Result := clSilver; - cidEdit: Result := clSilver; - cidCheckBox: Result := clSilver; - cidGroupBox: Result := clSilver; - cidTrackBar: Result := clSilver; - cidCustomTabControl: Result := clSilver; + cidControl: Result := clSilver; + cidButton: Result := clSilver; + cidEdit: Result := clSilver; + cidCheckBox: Result := clSilver; + cidGroupBox: Result := clSilver; + cidTrackBar: Result := clSilver; + cidCTabControl: Result := clSilver; else Result := clSilver; end;