Index: JvGradientCaption.pas
===================================================================
--- JvGradientCaption.pas	(revision 10684)
+++ JvGradientCaption.pas	(working copy)
@@ -49,6 +49,8 @@
     FRgnChanged: Boolean;
     FWinHook: TJvWindowHook;
     FStartColor: TColor;
+    FEndColor: TColor;
+    FFillDirection : TFillDirection;
     FCaptions: TJvCaptionList;
     FFont: TFont;
     FDefaultFont: Boolean;
@@ -89,6 +91,8 @@
     procedure SetFontInactiveColor(Value: TColor);
     procedure SetHideDirection(Value: THideDirection);
     procedure SetPopupMenu(Value: TPopupMenu);
+    PROCEDURE SetEndColor(Value: TColor);
+    PROCEDURE SetFillDirection(Value: TFillDirection);
   protected
     procedure Loaded; override;
     procedure Notification(AComponent: TComponent; Operation: TOperation); override;
@@ -119,6 +123,10 @@
     property PopupMenu: TPopupMenu read FPopupMenu write SetPopupMenu;
     property StartColor: TColor read FStartColor write SetStartColor
       default clWindowText;
+    PROPERTY EndColor: TColor READ FEndColor WRITE SetEndColor
+      DEFAULT clActiveCaption; // new property introduced by AxP (AnuDeDeus)
+    PROPERTY  FillDirection : TFillDirection read FFillDirection write SetFillDirection
+      DEFAULT fdLeftToRight; // new property introduced by AxP (AnuDeDeus)
     property OnActivate: TNotifyEvent read FOnActivate write FOnActivate;
     property OnDeactivate: TNotifyEvent read FOnDeactivate write FOnDeactivate;
   end;
@@ -175,12 +183,14 @@
     property Visible: Boolean read FVisible write SetVisible default True;
   end;
 
-function GradientFormCaption(AForm: TCustomForm; AStartColor: TColor): TJvGradientCaption;
+// I didn't really understand the purpose of this function, but I updated it anyway, hope it's fine
+FUNCTION GradientFormCaption(AForm: TCustomForm; AStartColor, AEndColor: TColor):
+  TJvGradientCaption;
 
 {$IFDEF UNITVERSIONING}
 const
   UnitVersioning: TUnitVersionInfo = (
-    RCSfile: '$URL$';
+    RCSfile: '$RCSfile: JvGradientCaption.pas,v $';
     Revision: '$Revision$';
     Date: '$Date$';
     LogPath: 'JVCL\run'
@@ -193,12 +203,14 @@
   SysUtils,
   JvConsts;
 
-function GradientFormCaption(AForm: TCustomForm; AStartColor: TColor): TJvGradientCaption;
+FUNCTION GradientFormCaption(AForm: TCustomForm; AStartColor, AEndColor: TColor):
+  TJvGradientCaption;
 begin
   Result := TJvGradientCaption.Create(AForm);
   with Result do
   try
     FStartColor := AStartColor;
+    FEndColor := AEndColor;
     FormCaption := AForm.Caption;
     Update;
   except
@@ -445,6 +457,8 @@
   FWinHook.BeforeMessage := BeforeMessage;
   FWinHook.AfterMessage := AfterMessage;
   FStartColor := clWindowText;
+  FEndColor := clActiveCaption;// doubt: should it be clGradientActiveCaption?
+  FFillDirection := fdLeftToRight;
   FFontInactiveColor := clInactiveCaptionText;
   FFormCaption := '';
   FFont := TFont.Create;
@@ -720,6 +734,17 @@
   end;
 end;
 
+PROCEDURE TJvGradientCaption.SetEndColor(Value: TColor);
+BEGIN
+  IF FEndColor <> Value THEN
+  BEGIN
+    FEndColor := Value;
+    IF Active THEN
+      Update;
+  END;
+END;
+
+
 function TJvGradientCaption.GetActive: Boolean;
 begin
   Result := FActive;
@@ -848,7 +873,7 @@
 var
   R, DrawRect: TRect;
   Icons: TBorderIcons;
-  C: TColor;
+//  C: TColor;  replaced by FEndColor
   Ico: HIcon;
   Image: TBitmap;
   S: string;
@@ -932,29 +957,28 @@
     Image.Width := RectWidth(R);
     Image.Height := RectHeight(R);
     R := Rect(-Image.Width div 4, 0, Image.Width, Image.Height);
-    if SysGradient then
-    begin
-      if FWindowActive then
-        C := clGradientActiveCaption
-      else
-        C := clGradientInactiveCaption;
-    end
-    else
-    begin
-      if FWindowActive then
-        C := clActiveCaption
-      else
-        C := clInactiveCaption;
-    end;
+//    if SysGradient then
+//    begin
+//      if FWindowActive then
+//        C := clGradientActiveCaption
+//      else
+//        C := clGradientInactiveCaption;
+//    end
+//    else
+//    begin
+//      if FWindowActive then
+//        C := clActiveCaption
+//      else
+//        C := clInactiveCaption;
+//    end;
     if (FWindowActive and GradientActive) or
       (not FWindowActive and GradientInactive) then
     begin
-      GradientFillRect(Image.Canvas, R, FStartColor, C, fdLeftToRight,
-        FGradientSteps);
+      GradientFillRect(Image.Canvas, R, FStartColor, FEndColor, FFillDirection, FGradientSteps);
     end
     else
     begin
-      Image.Canvas.Brush.Color := C;
+      Image.Canvas.Brush.Color := FEndColor;
       Image.Canvas.FillRect(R);
     end;
     R.Left := 0;
@@ -1109,7 +1133,7 @@
 begin
   if FGradientSteps <> Value then
   begin
-    FGradientSteps := Value;
+    FGradientSteps := Value mod 256; // auto resets to 0 at 256
     if Active and ((FWindowActive and GradientActive) or
       (not FWindowActive and GradientInactive)) then
       Update;
@@ -1156,7 +1180,18 @@
   end;
 end;
 
+procedure TJvGradientCaption.SetFillDirection(Value: TFillDirection);
+begin
+  IF FFillDirection <> Value THEN
+  BEGIN
+    FFillDirection := Value;
+    IF Active THEN
+      Update;
+  END;
+end;
+
 {$IFDEF UNITVERSIONING}
+
 initialization
   RegisterUnitVersion(HInstance, UnitVersioning);
 
