LCL: fixed GetDefaultColor for TStaticText, TNoteBook, TTabSheet, TGroupBox, bug #26535

git-svn-id: trunk@46021 -
This commit is contained in:
mattias 2014-08-06 16:54:36 +00:00
parent 1dfcf970e9
commit fe227ded7f
7 changed files with 55 additions and 32 deletions

View File

@ -48,8 +48,8 @@ uses
FPReadJpeg, FPWriteJpeg, // jpg support FPReadJpeg, FPWriteJpeg, // jpg support
FPReadTiff, FPTiffCmn, // tiff support FPReadTiff, FPTiffCmn, // tiff support
FPReadGif, FPReadGif,
IntfGraphics,
AvgLvlTree, AvgLvlTree,
IntfGraphics,
LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache, LCLStrConsts, LCLType, LCLProc, LMessages, LResources, LCLResCache,
GraphType, IcnsTypes, GraphMath, WSReferences; GraphType, IcnsTypes, GraphMath, WSReferences;

View File

@ -1266,8 +1266,8 @@ end;
function TControl.GetDefaultColor(const DefaultColorType: TDefaultColorType): TColor; function TControl.GetDefaultColor(const DefaultColorType: TDefaultColorType): TColor;
const const
DefColors: array[TDefaultColorType] of TColor = ( DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clForm, { dctBrush } clWindow,
{ dctFont } clBtnText { dctFont } clWindowText
); );
begin begin
Result := TWSControlClass(WidgetSetClass).GetDefaultColor(Self, DefaultColorType); Result := TWSControlClass(WidgetSetClass).GetDefaultColor(Self, DefaultColorType);

View File

@ -1101,13 +1101,8 @@ end;
{ TGtk3WSButtonControl } { TGtk3WSButtonControl }
class function TGtk3WSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; class function TGtk3WSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
const
DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBtnFace,
{ dctFont } clBtnText
);
begin begin
Result := DefColors[ADefaultColorType]; Result := DefBtnColors[ADefaultColorType];
end; end;
end. end.

View File

@ -90,6 +90,8 @@ type
TWSTabSheet = class(TWSCustomPage) TWSTabSheet = class(TWSCustomPage)
published published
class function GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor; override;
end; end;
{ TWSPageControl } { TWSPageControl }
@ -260,6 +262,14 @@ implementation
uses uses
LResources; LResources;
{ TWSTabSheet }
class function TWSTabSheet.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
begin
Result:=DefBtnColors[ADefaultColorType];
end;
{ TWSCustomPage } { TWSCustomPage }
class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage); class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage);
@ -401,13 +411,8 @@ begin
end; end;
class function TWSStatusBar.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; class function TWSStatusBar.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
const
DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBtnFace,
{ dctFont } clBtnText
);
begin begin
Result := DefColors[ADefaultColorType]; Result := DefBtnColors[ADefaultColorType];
end; end;
{ TWSCustomListView } { TWSCustomListView }

View File

@ -34,17 +34,22 @@ interface
// the uses clause of the XXXintf.pp // the uses clause of the XXXintf.pp
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
uses uses
Classes, Classes, Types,
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// To get as little as posible circles, // To get as little as possible circles,
// uncomment only when needed for registration // uncomment only when needed for registration
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
Controls, Graphics, LCLType, Types, Controls, Graphics, LCLType,
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
WSLCLClasses, WSImgList, WSLCLClasses, WSImgList,
{ TODO: remove when CreateHandle/Component code moved } { TODO: remove when CreateHandle/Component code moved }
InterfaceBase, WSFactory; InterfaceBase, WSFactory;
const
DefBtnColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBtnFace,
{ dctFont } clBtnText
);
type type
{ TWSDragImageList } { TWSDragImageList }

View File

@ -53,6 +53,8 @@ type
TWSNotebook = class(TWSCustomControl) TWSNotebook = class(TWSCustomControl)
published published
class function GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor; override;
end; end;
{ TWSShape } { TWSShape }
@ -173,6 +175,14 @@ type
implementation implementation
{ TWSNotebook }
class function TWSNotebook.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
begin
Result:=DefBtnColors[ADefaultColorType];
end;
{ TWSCustomTrayIcon } { TWSCustomTrayIcon }
class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean; class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
@ -332,13 +342,8 @@ end;
{ TWSCustomPanel } { TWSCustomPanel }
class function TWSCustomPanel.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; class function TWSCustomPanel.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
const
DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBtnFace,
{ dctFont } clBtnText
);
begin begin
Result := DefColors[ADefaultColorType]; Result := DefBtnColors[ADefaultColorType];
end; end;
end. end.

View File

@ -35,13 +35,14 @@ interface
// the uses clause of the XXXintf.pp // the uses clause of the XXXintf.pp
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
uses uses
Classes,
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
// To get as little as posible circles, // To get as little as possible circles,
// uncomment only when needed for registration // uncomment only when needed for registration
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
Graphics, Controls, StdCtrls, Graphics, Controls, StdCtrls,
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
WSLCLClasses, WSControls, Classes, WSFactory, Clipbrd; Clipbrd, WSLCLClasses, WSControls, WSFactory;
type type
{ TWSScrollBar } { TWSScrollBar }
@ -63,6 +64,7 @@ type
TWSGroupBox = class(TWSCustomGroupBox) TWSGroupBox = class(TWSCustomGroupBox)
published published
class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override;
end; end;
{ TWSCustomComboBox } { TWSCustomComboBox }
@ -198,6 +200,8 @@ type
published published
class procedure SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment); virtual; class procedure SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment); virtual;
class procedure SetStaticBorderStyle(const ACustomStaticText: TCustomStaticText; const NewBorderStyle: TStaticBorderStyle); virtual; class procedure SetStaticBorderStyle(const ACustomStaticText: TCustomStaticText; const NewBorderStyle: TStaticBorderStyle); virtual;
class function GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor; override;
end; end;
{ TWSStaticText } { TWSStaticText }
@ -271,6 +275,14 @@ implementation
uses uses
LResources; LResources;
{ TWSGroupBox }
class function TWSGroupBox.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
begin
Result:=DefBtnColors[ADefaultColorType];
end;
{ TWSScrollBar } { TWSScrollBar }
class procedure TWSScrollBar.SetParams(const AScrollBar: TCustomScrollBar); class procedure TWSScrollBar.SetParams(const AScrollBar: TCustomScrollBar);
@ -624,6 +636,12 @@ begin
// nothing // nothing
end; end;
class function TWSCustomStaticText.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
begin
Result:=DefBtnColors[ADefaultColorType];
end;
{ TWSButton } { TWSButton }
class procedure TWSButton.SetDefault(const AButton: TCustomButton; ADefault: Boolean); class procedure TWSButton.SetDefault(const AButton: TCustomButton; ADefault: Boolean);
@ -811,13 +829,8 @@ end;
{ TWSButtonControl } { TWSButtonControl }
class function TWSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; class function TWSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
const
DefColors: array[TDefaultColorType] of TColor = (
{ dctBrush } clBtnFace,
{ dctFont } clBtnText
);
begin begin
Result := DefColors[ADefaultColorType]; Result := DefBtnColors[ADefaultColorType];
end; end;
end. end.