summaryrefslogtreecommitdiff
path: root/src/gui/fpg_gauge.pas
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/fpg_gauge.pas')
-rw-r--r--src/gui/fpg_gauge.pas18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/gui/fpg_gauge.pas b/src/gui/fpg_gauge.pas
index b8678828..37a154c6 100644
--- a/src/gui/fpg_gauge.pas
+++ b/src/gui/fpg_gauge.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2008 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -87,6 +87,7 @@ type
property Color: TfpgColor read FColor write FColor default clButtonFace;
property Enabled;
property FirstColor: TfpgColor read FFirstColor write SetFirstColor default clBlack;
+ property Hint;
property Kind: TGaugeKind read FKind write SetGaugeKind default gkHorizontalBar;
property MaxValue: Longint read FMax write SetMax default 100;
property MinValue: Longint read FMin write SetMin default 0;
@@ -96,6 +97,7 @@ type
property ShowHint;
property ShowText: Boolean read FShowText write SetShowText default True;
property Visible;
+ property OnShowHint;
end;
@@ -113,22 +115,22 @@ uses
to be moved in CanvasBase? }
procedure FillArcGradient(canvas: TfpgCanvas; X,Y,W,H: TfpgCoord; a1,a2: double; Astart,Astop: TfpgColor);
var
- RGBStart: TRGBTriple;
- RGBStop: TRGBTriple;
+ RGBStart: TFPColor;
+ RGBStop: TFPColor;
RDiff, GDiff, BDiff: Integer;
count: Integer;
i: Integer;
- newcolor: TRGBTriple;
+ newcolor: TFPColor;
begin
- if Astart = Astop then
+ if Astart = Astop then
begin { No gradient, just solid color}
canvas.SetColor(Astart);
canvas.FillArc(X, Y, W, H, a1, a2);
Exit; //==>
end;
- RGBStart := fpgColorToRGBTriple(fpgColorToRGB(AStart));
- RGBStop := fpgColorToRGBTriple(fpgColorToRGB(AStop));
+ RGBStart := fpgColorToFPColor(fpgColorToRGB(AStart));
+ RGBStop := fpgColorToFPColor(fpgColorToRGB(AStop));
count := min(H,W);
count := count div 2;
@@ -154,7 +156,7 @@ begin
newcolor.Red := RGBStart.Red + (i * RDiff) div count;
newcolor.Green := RGBStart.Green + (i * GDiff) div count;
newcolor.Blue := RGBStart.Blue + (i * BDiff) div count;
- canvas.SetColor(RGBTripleTofpgColor(newcolor));
+ canvas.SetColor(FPColorTofpgColor(newcolor));
canvas.DrawArc(X, Y, W, H, a1, a2);
end;
end;