anchor.diff:        if not (csLoading in ComponentState) then
           raise EInvalidOperation.CreateFmt(SOutOfRange, [-MaxInt, FMaxValue - 1]);
       FMinValue := Value;
  -    if FCurValue < Value then FCurValue := Value;
  -    Refresh;
  -  end;
  -end;
  -
  -procedure TGauge.SetMaxValue(Value: Longint);
  +    if FCurValue < Value then
  +      FCurValue := Value;
  +    Refresh;
  +  end;
  +end;
  +
  +procedure TGauge.SetMaxValue(Value: LongInt);
   begin
     if Value <> FMaxValue then
     begin
  
positive.code: 
    TGauge = class(TGraphicControl)
    private
      FMinValue: Longint;
      FMaxValue: Longint;
      FCurValue: Longint;
      FKind: TGaugeKind;
      FShowText: Boolean;
      FBorderStyle: TBorderStyle;
      FForeColor: TColor;
      FBackColor: TColor;
      procedure PaintBackground(AnImage: TBitmap);
      procedure PaintAsText(AnImage: TBitmap; PaintRect: TRect);
      procedure PaintAsNothing(AnImage: TBitmap; PaintRect: TRect);
      procedure PaintAsBar(AnImage: TBitmap; PaintRect: TRect);
      procedure PaintAsPie(AnImage: TBitmap; PaintRect: TRect);
      procedure PaintAsNeedle(AnImage: TBitmap; PaintRect: TRect);
      procedure SetGaugeKind(Value: TGaugeKind);
      procedure SetShowText(Value: Boolean);
      procedure SetBorderStyle(Value: TBorderStyle);
      procedure SetForeColor(Value: TColor);
      procedure SetBackColor(Value: TColor);
      procedure SetMinValue(Value: Longint);
      procedure SetMaxValue(Value: Longint);
      procedure SetProgress(Value: Longint);
      function GetPercentDone: Longint;
    protected
      procedure Paint; override;
    public
      constructor Create(AOwner: TComponent); override;
      procedure AddProgress(Value: Longint);
      property PercentDone: Longint read GetPercentDone;
    published
      property Align;
      property Anchors;
      property BackColor: TColor read FBackColor write SetBackColor default clWhite;
      property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsSingle;
      property Color;
      property Constraints;
      property Enabled;
      property ForeColor: TColor read FForeColor write SetForeColor default clBlack;
      property Font;
      property Kind: TGaugeKind read FKind write SetGaugeKind default gkHorizontalBar;
      property MinValue: Longint read FMinValue write SetMinValue default 0;
      property MaxValue: Longint read FMaxValue write SetMaxValue default 100;
      property ParentColor;
      property ParentFont;
      property ParentShowHint;
      property PopupMenu;
      property Progress: Longint read FCurValue write SetProgress;
      property ShowHint;
      property ShowText: Boolean read FShowText write SetShowText default True;
      property Visible;
    end;
  
  
negative.code:   with AnImage.Canvas do
    begin
      Brush.Color := Color;
      FillRect(APaintRect);
      Brush.Color := BackColor;
      Pen.Color := ForeColor;
      Pen.Width := 1;
      Pie(X, Y, W, H * 2 - 1, X + W, APaintRect.Bottom - 1, X, APaintRect.Bottom - 1);
      MoveTo(X, APaintRect.Bottom);
      LineTo(X + W, APaintRect.Bottom);
      if PercentDone > 0 then
      begin
        Pen.Color := ForeColor;
        MiddleX := Width div 2;
        MoveTo(MiddleX, APaintRect.Bottom - 1);
        Angle := (Pi * ((PercentDone / 100)));
        LineTo(integer(Round(MiddleX * (1 - Cos(Angle)))),
          integer(Round((APaintRect.Bottom - 1) * (1 - Sin(Angle)))));
      end;
    end;
  end;
  