summaryrefslogtreecommitdiff
path: root/src/gui/gui_progressbar.pas
diff options
context:
space:
mode:
authorgraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-02-15 13:58:18 +0000
committergraemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf>2008-02-15 13:58:18 +0000
commit831cb67e19cfe06c390cc632d1d6e8446acfa57c (patch)
tree6aca91bff4114393585fac87911e08866d6a1abc /src/gui/gui_progressbar.pas
parent0bfd76ac0c585efcdbf4ee8574c8c844e7142108 (diff)
downloadfpGUI-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_progressbar.pas')
-rw-r--r--src/gui/gui_progressbar.pas19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/gui/gui_progressbar.pas b/src/gui/gui_progressbar.pas
index 2177f4ed..ca987bad 100644
--- a/src/gui/gui_progressbar.pas
+++ b/src/gui/gui_progressbar.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,
@@ -31,14 +31,12 @@ uses
type
TfpgCustomProgressBar = class(TfpgWidget)
private
- FBackgroundColor: TfpgColor;
FMax: longint;
FMin: longint;
FPosition: longint;
FShowCaption: boolean;
FStep: longint;
FFont: TfpgFont;
- procedure SetBackgroundColor(const AValue: TfpgColor);
procedure SetMax(const AValue: longint);
procedure SetMin(const AValue: longint);
procedure SetPosition(const AValue: longint);
@@ -51,7 +49,6 @@ type
property Position: longint read FPosition write SetPosition default 0;
property Step: longint read FStep write SetStep;
// property FontName: string read GetFontName write SetFontName;
- property BackgroundColor: TfpgColor read FBackgroundColor write SetBackgroundColor;
property ShowCaption: boolean read FShowCaption write SetShowCaption;
public
constructor Create(AOwner: TComponent); override;
@@ -64,12 +61,13 @@ type
TfpgProgressBar = class(TfpgCustomProgressBar)
published
- property BackgroundColor;
+ property BackgroundColor default $c4c4c4;
property ShowCaption;
property Max;
property Min;
property Position;
property Step;
+ property TextColor;
end;
implementation
@@ -91,14 +89,6 @@ begin
RePaint;
end;
-procedure TfpgCustomProgressBar.SetBackgroundColor(const AValue: TfpgColor);
-begin
- if FBackgroundColor = AValue then
- Exit; //==>
- FBackgroundColor := AValue;
- RePaint;
-end;
-
procedure TfpgCustomProgressBar.SetMin(const AValue: longint);
begin
if FMin = AValue then
@@ -199,7 +189,7 @@ begin
begin
x := (Width - FFont.TextWidth(txt)) div 2;
y := (Height - FFont.Height) div 2;
- Canvas.SetTextColor(clText1);
+ Canvas.SetTextColor(TextColor);
Canvas.Font := FFont;
Canvas.DrawString(x, y, txt);
end;
@@ -217,6 +207,7 @@ begin
FStep := 1;
FPosition := 0;
FBackgroundColor := TfpgColor($c4c4c4); // clListBox;
+ FTextColor := Parent.TextColor;
FShowCaption := False;
FFont := fpgStyle.DefaultFont;
end;