From fe227ded7fb1c93df173a77476de00bed41ddf63 Mon Sep 17 00:00:00 2001 From: mattias Date: Wed, 6 Aug 2014 16:54:36 +0000 Subject: [PATCH] LCL: fixed GetDefaultColor for TStaticText, TNoteBook, TTabSheet, TGroupBox, bug #26535 git-svn-id: trunk@46021 - --- lcl/graphics.pp | 2 +- lcl/include/control.inc | 4 ++-- lcl/interfaces/gtk3/gtk3wsstdctrls.pp | 7 +------ lcl/widgetset/wscomctrls.pp | 17 ++++++++++------ lcl/widgetset/wscontrols.pp | 11 +++++++--- lcl/widgetset/wsextctrls.pp | 17 ++++++++++------ lcl/widgetset/wsstdctrls.pp | 29 +++++++++++++++++++-------- 7 files changed, 55 insertions(+), 32 deletions(-) diff --git a/lcl/graphics.pp b/lcl/graphics.pp index 7219b5d219..a12e983318 100644 --- a/lcl/graphics.pp +++ b/lcl/graphics.pp @@ -48,8 +48,8 @@ uses FPReadJpeg, FPWriteJpeg, // jpg support FPReadTiff, FPTiffCmn, // tiff support FPReadGif, - IntfGraphics, AvgLvlTree, + IntfGraphics, LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache, GraphType, IcnsTypes, GraphMath, WSReferences; diff --git a/lcl/include/control.inc b/lcl/include/control.inc index f134321118..c95c36cab5 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -1266,8 +1266,8 @@ end; function TControl.GetDefaultColor(const DefaultColorType: TDefaultColorType): TColor; const DefColors: array[TDefaultColorType] of TColor = ( - { dctBrush } clForm, - { dctFont } clBtnText + { dctBrush } clWindow, + { dctFont } clWindowText ); begin Result := TWSControlClass(WidgetSetClass).GetDefaultColor(Self, DefaultColorType); diff --git a/lcl/interfaces/gtk3/gtk3wsstdctrls.pp b/lcl/interfaces/gtk3/gtk3wsstdctrls.pp index 5ace11c717..b519145402 100644 --- a/lcl/interfaces/gtk3/gtk3wsstdctrls.pp +++ b/lcl/interfaces/gtk3/gtk3wsstdctrls.pp @@ -1101,13 +1101,8 @@ end; { TGtk3WSButtonControl } class function TGtk3WSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; -const - DefColors: array[TDefaultColorType] of TColor = ( - { dctBrush } clBtnFace, - { dctFont } clBtnText - ); begin - Result := DefColors[ADefaultColorType]; + Result := DefBtnColors[ADefaultColorType]; end; end. diff --git a/lcl/widgetset/wscomctrls.pp b/lcl/widgetset/wscomctrls.pp index 202775908c..d02eab4d98 100644 --- a/lcl/widgetset/wscomctrls.pp +++ b/lcl/widgetset/wscomctrls.pp @@ -90,6 +90,8 @@ type TWSTabSheet = class(TWSCustomPage) published + class function GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; override; end; { TWSPageControl } @@ -260,6 +262,14 @@ implementation uses LResources; +{ TWSTabSheet } + +class function TWSTabSheet.GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; +begin + Result:=DefBtnColors[ADefaultColorType]; +end; + { TWSCustomPage } class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage); @@ -401,13 +411,8 @@ begin end; class function TWSStatusBar.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; -const - DefColors: array[TDefaultColorType] of TColor = ( - { dctBrush } clBtnFace, - { dctFont } clBtnText - ); begin - Result := DefColors[ADefaultColorType]; + Result := DefBtnColors[ADefaultColorType]; end; { TWSCustomListView } diff --git a/lcl/widgetset/wscontrols.pp b/lcl/widgetset/wscontrols.pp index a2bc48cab9..ef275e0fcc 100644 --- a/lcl/widgetset/wscontrols.pp +++ b/lcl/widgetset/wscontrols.pp @@ -34,17 +34,22 @@ interface // the uses clause of the XXXintf.pp //////////////////////////////////////////////////// uses - Classes, + Classes, Types, //////////////////////////////////////////////////// -// To get as little as posible circles, +// To get as little as possible circles, // uncomment only when needed for registration //////////////////////////////////////////////////// - Controls, Graphics, LCLType, Types, + Controls, Graphics, LCLType, //////////////////////////////////////////////////// WSLCLClasses, WSImgList, { TODO: remove when CreateHandle/Component code moved } InterfaceBase, WSFactory; +const + DefBtnColors: array[TDefaultColorType] of TColor = ( + { dctBrush } clBtnFace, + { dctFont } clBtnText + ); type { TWSDragImageList } diff --git a/lcl/widgetset/wsextctrls.pp b/lcl/widgetset/wsextctrls.pp index 26c2964ebd..98dd95b559 100644 --- a/lcl/widgetset/wsextctrls.pp +++ b/lcl/widgetset/wsextctrls.pp @@ -53,6 +53,8 @@ type TWSNotebook = class(TWSCustomControl) published + class function GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; override; end; { TWSShape } @@ -173,6 +175,14 @@ type implementation +{ TWSNotebook } + +class function TWSNotebook.GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; +begin + Result:=DefBtnColors[ADefaultColorType]; +end; + { TWSCustomTrayIcon } class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean; @@ -332,13 +342,8 @@ end; { TWSCustomPanel } class function TWSCustomPanel.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; -const - DefColors: array[TDefaultColorType] of TColor = ( - { dctBrush } clBtnFace, - { dctFont } clBtnText - ); begin - Result := DefColors[ADefaultColorType]; + Result := DefBtnColors[ADefaultColorType]; end; end. diff --git a/lcl/widgetset/wsstdctrls.pp b/lcl/widgetset/wsstdctrls.pp index 94949010c0..d714a70634 100644 --- a/lcl/widgetset/wsstdctrls.pp +++ b/lcl/widgetset/wsstdctrls.pp @@ -35,13 +35,14 @@ interface // the uses clause of the XXXintf.pp //////////////////////////////////////////////////// uses + Classes, //////////////////////////////////////////////////// -// To get as little as posible circles, +// To get as little as possible circles, // uncomment only when needed for registration //////////////////////////////////////////////////// Graphics, Controls, StdCtrls, //////////////////////////////////////////////////// - WSLCLClasses, WSControls, Classes, WSFactory, Clipbrd; + Clipbrd, WSLCLClasses, WSControls, WSFactory; type { TWSScrollBar } @@ -63,6 +64,7 @@ type TWSGroupBox = class(TWSCustomGroupBox) published + class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override; end; { TWSCustomComboBox } @@ -198,6 +200,8 @@ type published class procedure SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment); virtual; class procedure SetStaticBorderStyle(const ACustomStaticText: TCustomStaticText; const NewBorderStyle: TStaticBorderStyle); virtual; + class function GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; override; end; { TWSStaticText } @@ -271,6 +275,14 @@ implementation uses LResources; +{ TWSGroupBox } + +class function TWSGroupBox.GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; +begin + Result:=DefBtnColors[ADefaultColorType]; +end; + { TWSScrollBar } class procedure TWSScrollBar.SetParams(const AScrollBar: TCustomScrollBar); @@ -624,6 +636,12 @@ begin // nothing end; +class function TWSCustomStaticText.GetDefaultColor(const AControl: TControl; + const ADefaultColorType: TDefaultColorType): TColor; +begin + Result:=DefBtnColors[ADefaultColorType]; +end; + { TWSButton } class procedure TWSButton.SetDefault(const AButton: TCustomButton; ADefault: Boolean); @@ -811,13 +829,8 @@ end; { TWSButtonControl } class function TWSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; -const - DefColors: array[TDefaultColorType] of TColor = ( - { dctBrush } clBtnFace, - { dctFont } clBtnText - ); begin - Result := DefColors[ADefaultColorType]; + Result := DefBtnColors[ADefaultColorType]; end; end.