diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-02-15 13:58:18 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-02-15 13:58:18 +0000 |
commit | 831cb67e19cfe06c390cc632d1d6e8446acfa57c (patch) | |
tree | 6aca91bff4114393585fac87911e08866d6a1abc /src/gui/gui_tab.pas | |
parent | 0bfd76ac0c585efcdbf4ee8574c8c844e7142108 (diff) | |
download | fpGUI-831cb67e19cfe06c390cc632d1d6e8446acfa57c.tar.xz |
* Applied Jean-Marc's TextColor and BackgroundColor patch.
* Made many more modifications based on Jean-Marc's patch and fixed a few things missed.
Diffstat (limited to 'src/gui/gui_tab.pas')
-rw-r--r-- | src/gui/gui_tab.pas | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/src/gui/gui_tab.pas b/src/gui/gui_tab.pas index e33e0e97..aab78db8 100644 --- a/src/gui/gui_tab.pas +++ b/src/gui/gui_tab.pas @@ -1,7 +1,7 @@ { fpGUI - Free Pascal GUI Library - Copyright (C) 2006 - 2007 See the file AUTHORS.txt, included in this + Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this distribution, for details of the copyright. See the file COPYING.modifiedLGPL, included in this distribution, @@ -48,12 +48,10 @@ type TfpgTabSheet = class(TfpgWidget) private - FBackgroundColor: TfpgColor; FText: string; function GetPageControl: TfpgPageControl; function GetPageIndex: Integer; function GetText: string; - procedure SetBackgroundColor(const AValue: TfpgColor); procedure SetPageIndex(const AValue: Integer); procedure SetText(const AValue: string); protected @@ -65,7 +63,6 @@ type property Text: string read GetText write SetText; property PageIndex: Integer read GetPageIndex write SetPageIndex; property PageControl: TfpgPageControl read GetPageControl; - property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor; end; @@ -74,7 +71,6 @@ type TfpgPageControl = class(TfpgWidget) private - FBackgroundColor: TfpgColor; FFont: TfpgFont; FActivePage: TfpgTabSheet; FMargin: integer; @@ -100,7 +96,6 @@ type function MaxButtonWidth: integer; function ButtonHeight: integer; function ButtonWidth(AText: string): integer; - procedure SetBackgroundColor(const AValue: TfpgColor); procedure SetFixedTabWidth(const AValue: integer); function GetTabText(AText: string): string; procedure LeftButtonClick(Sender: TObject); @@ -126,11 +121,12 @@ type property OnChange: TTabSheetChange read FOnChange write FOnChange; published property ActivePageIndex: integer read GetActivePageIndex write SetActivePageIndex; - property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor default clWindowBackground; + property BackgroundColor; property FixedTabWidth: integer read FFixedTabWidth write SetFixedTabWidth default 0; property SortPages: boolean read FSortPages write SetSortPages default False; property Style: TfpgTabStyle read FStyle write SetStyle default tsTabs; property TabPosition: TfpgTabPosition read FTabPosition write SetTabPosition default tpTop; + property TextColor; end; @@ -170,14 +166,6 @@ begin Result := FText; end; -procedure TfpgTabSheet.SetBackgroundColor(const AValue: TfpgColor); -begin - if FBackgroundColor = AValue then - Exit; //==> - FBackgroundColor := AValue; - RePaint; -end; - procedure TfpgTabSheet.SetPageIndex(const AValue: Integer); begin if PageControl <> nil then @@ -209,7 +197,8 @@ begin inherited Create(AOwner); FText := ''; FFocusable := True; - FBackgroundColor := clWindowBackground; + FBackgroundColor := Parent.BackgroundColor; + FTextColor := Parent.TextColor; end; destructor TfpgTabSheet.Destroy; @@ -330,14 +319,6 @@ begin result := FFont.TextWidth(AText) + 10; end; -procedure TfpgPageControl.SetBackgroundColor(const AValue: TfpgColor); -begin - if FBackgroundColor = AValue then - Exit; //==> - FBackgroundColor := AValue; - RePaint; -end; - procedure TfpgPageControl.SetFixedTabWidth(const AValue: integer); begin if FFixedTabWidth = AValue then @@ -462,8 +443,8 @@ begin if h = nil then Exit; Canvas.BeginDraw; - Canvas.SetTextColor(clText1); - + Canvas.SetTextColor(TextColor); + case TabPosition of tpTop: begin @@ -692,7 +673,8 @@ begin FWidth := 150; FHeight := 100; - FBackgroundColor := clWindowBackground; + FTextColor := Parent.TextColor; + FBackgroundColor := Parent.BackgroundColor; FFocusable := True; FOnChange := nil; FFixedTabWidth := 0; |