Browse Source

FlashProgressBar Added MarqueeWidthType

Massimo Magnano 9 months ago
parent
commit
157f03abf1

+ 67 - 13
bgraflashprogressbar.pas

@@ -23,6 +23,7 @@
              Added Graph Style and ShowDividers, Renamed MultiProgress properties
              Added ShowBarAnimation
     2025-02  Added use of Font.Color
+    2025-03  Added MarqueeWidthType
 ***************************** END CONTRIBUTOR(S) *****************************}
 unit BGRAFlashProgressBar;
 
@@ -40,6 +41,7 @@ uses
 
 type
   TBGRAPBarStyle = (pbstNormal, pbstMultiProgress, pbstMarquee, pbstTimer, pbstGraph);
+  TBGRAPBarMarqueeWidthType = (pbmwAuto, pbmwFixed, pbmwValue, pbmwValueSub); //, pbmwInc MaxM: maybe tomorrow when I have free time
   TBGRAPBarMarqueeDirection = (pbmdToRight, pbmdToLeft);
   TBGRAPBarMarqueeSpeed = (pbmsSlow, pbmsMedium, pbmsFast);
 
@@ -73,6 +75,7 @@ type
     procedure SetGraphYLineAfter(AValue: String);
     procedure SetGraphYLineCaption(AValue: String);
     procedure SetGraphYLineDigits(AValue: Integer);
+    procedure SetMarqueeWidthType(AValue: TBGRAPBarMarqueeWidthType);
     procedure SetMax(AValue: Integer);
     procedure SetMin(AValue: Integer);
     procedure SetPosition(AValue: Integer);
@@ -110,6 +113,7 @@ type
     FGraphShowYDividers: Boolean;
     FBarColor,
     FBarColorSub: TColor;
+    FMarqueeWidthType: TBGRAPBarMarqueeWidthType;
     FMarqueeDirection: TBGRAPBarMarqueeDirection;
     FMarqueeSpeed: TBGRAPBarMarqueeSpeed;
     FMarqueeWidth,
@@ -159,6 +163,8 @@ type
 
     procedure TimerOnTimer(Sender: TObject);
 
+    procedure CalcMarqueeWidth;
+
   public
     constructor Create(AOwner: TComponent); override;
     destructor Destroy; override;
@@ -226,10 +232,11 @@ type
     property ShowDividers: Boolean read FShowDividers write SetShowDividers default False;
     property ShowBarAnimation: Boolean read FShowBarAnimation write SetShowBarAnimation default False;
     property Style: TBGRAPBarStyle read FStyle write SetStyle default pbstNormal;
-    property MarqueeWidth: Word read FMarqueeWidth write SetMarqueeWidth default 0;
+    property MarqueeWidthType: TBGRAPBarMarqueeWidthType read FMarqueeWidthType write SetMarqueeWidthType default pbmwAuto;
+    property MarqueeWidth: Word read FMarqueeWidth write SetMarqueeWidth default 95;
     property MarqueeSpeed: TBGRAPBarMarqueeSpeed read FMarqueeSpeed write SetMarqueeSpeed default pbmsMedium;
     property MarqueeDirection: TBGRAPBarMarqueeDirection read FMarqueeDirection write SetMarqueeDirection default pbmdToRight;
-    property MarqueeBounce: Word read FMarqueeBounce write SetMarqueeBounce;
+    property MarqueeBounce: Word read FMarqueeBounce write SetMarqueeBounce default 0;
 
     property TimerInterval: Cardinal read FTimerInterval write SetTimerInterval default 100;
     property TimerAutoRestart: Boolean read FTimerAutoRestart write FTimerAutoRestart default True;
@@ -269,6 +276,7 @@ const
   MARQUEE_TIMER_MED  = 20;
   MARQUEE_TIMER_FAST = 10;
   MARQUEE_INC = 2;
+  MARQUEE_WIDTH_MIN = 10;
 
 {$IFDEF FPC}
 procedure Register;
@@ -438,6 +446,17 @@ begin
   Invalidate;
 end;
 
+procedure TBGRAFlashProgressBar.SetMarqueeWidthType(AValue: TBGRAPBarMarqueeWidthType);
+begin
+  if FMarqueeWidthType=AValue then Exit;
+  FMarqueeWidthType:=AValue;
+
+  CalcMarqueeWidth;
+
+  if Assigned(FOnChange) then FOnChange(Self);
+  Invalidate;
+end;
+
 procedure TBGRAFlashProgressBar.SetMax(AValue: Integer);
 begin
   SetMaxValue(AValue);
@@ -515,13 +534,18 @@ end;
 procedure TBGRAFlashProgressBar.SetMarqueeWidth(AValue: Word);
 begin
   if FMarqueeWidth=AValue then Exit;
+
+  if (AValue > Width) then AValue:= Width;
+  if (AValue < MARQUEE_WIDTH_MIN) then AValue:= MARQUEE_WIDTH_MIN;
   FMarqueeWidth:= AValue;
-  if (FMarqueeWidth = 0)
-  then rMarqueeWidth:= Width div 4
-  else rMarqueeWidth:= FMarqueeWidth;
 
-  if Assigned(FOnChange) then FOnChange(Self);
-  Invalidate;
+  if (FMarqueeWidthType = pbmwFixed) then
+  begin
+    rMarqueeWidth:= FMarqueeWidth;
+
+    if Assigned(FOnChange) then FOnChange(Self);
+    Invalidate;
+  end;
 end;
 
 procedure TBGRAFlashProgressBar.SetMaxValue(AValue: Double);
@@ -602,7 +626,7 @@ begin
 
         if (FMarqueeDirection = pbmdToRight)
         then marqueeLeft:= 2
-        else marqueeLeft:= -FMarqueeWidth;
+        else marqueeLeft:= -rMarqueeWidth;
 
         if FTimerAutoRestart and
            not(csLoading in ComponentState) and
@@ -727,6 +751,22 @@ begin
   end;
 end;
 
+procedure TBGRAFlashProgressBar.CalcMarqueeWidth;
+begin
+  Case FMarqueeWidthType of
+    pbmwAuto: rMarqueeWidth:= Width div 4;
+    pbmwFixed: rMarqueeWidth:= FMarqueeWidth;
+    pbmwValue: begin
+        rMarqueeWidth:= round((FValue - FMinValue) / (FMaxValue - FMinValue) * (Width-2));
+        if (rMarqueeWidth < MARQUEE_WIDTH_MIN) then rMarqueeWidth:= MARQUEE_WIDTH_MIN;
+    end;
+    pbmwValueSub: begin
+        rMarqueeWidth:= round((FValueSub - FMinValue) / (FMaxValue - FMinValue) * (Width-2));
+        if (rMarqueeWidth < MARQUEE_WIDTH_MIN) then rMarqueeWidth:= MARQUEE_WIDTH_MIN;
+    end;
+  end;
+end;
+
 {$hints off}
 class function TBGRAFlashProgressBar.GetControlClassDefaultSize: TSize;
 begin
@@ -744,9 +784,7 @@ procedure TBGRAFlashProgressBar.DoOnResize;
 begin
   inherited DoOnResize;
 
-  if (FMarqueeWidth = 0)
-  then rMarqueeWidth:= Width div 4
-  else rMarqueeWidth:= FMarqueeWidth;
+  if (FMarqueeWidthType = pbmwAuto) then rMarqueeWidth:= Width div 4;
 end;
 
 {$hints on}
@@ -775,9 +813,11 @@ begin
       internalTimer.Enabled:= FShowBarAnimation;
     end;
     pbstMarquee: begin
+      CalcMarqueeWidth;
+
       if (FMarqueeDirection = pbmdToRight)
       then marqueeLeft:= 2
-      else marqueeLeft:= -FMarqueeWidth;
+      else marqueeLeft:= -rMarqueeWidth;
 
       if FTimerAutoRestart and not(csDesigning in ComponentState) then internalTimer.Enabled:= True;
     end;
@@ -843,13 +883,15 @@ begin
   barAnimLeft:= 0;
 
   //Marquee
-  FMarqueeWidth:= 0; //AutoWidth
+  FMarqueeWidthType:= pbmwAuto; //AutoWidth
   rMarqueeWidth:= 95; //PreferredWidth div 4
+  FMarqueeWidth:= 95;
   FMarqueeSpeed:= pbmsMedium;
   FMarqueeDirection:= pbmdToRight;
   marqueeCurMode:= pbmdToRight;
   marqueeLeft:= 0;
   marqueeRight:= 0;
+  FMarqueeBounce:= 0;
   marqueeBouncing:= False;
 
   //Timer
@@ -1215,6 +1257,18 @@ begin
         else if FShowDividers then DrawDividers(False);
       end;
       pbstMarquee: begin
+        //Calculate new MarqueeWidth based on Values (only if type is Value related)
+        Case FMarqueeWidthType of
+          pbmwValue: begin
+              rMarqueeWidth:= round((FValue - FMinValue) / (FMaxValue - FMinValue) * (content.right - content.left));
+              if (rMarqueeWidth < MARQUEE_WIDTH_MIN) then rMarqueeWidth:= MARQUEE_WIDTH_MIN;
+          end;
+          pbmwValueSub: begin
+              rMarqueeWidth:= round((FValueSub - FMinValue) / (FMaxValue - FMinValue) * (content.right - content.left));
+              if (rMarqueeWidth < MARQUEE_WIDTH_MIN) then rMarqueeWidth:= MARQUEE_WIDTH_MIN;
+          end;
+        end;
+
         if (marqueeCurMode = pbmdToRight)
         then begin
                //check if the whole bar is out put it back to the beginning

+ 1 - 1
test/test_progressbar/test_progressbar.lpi

@@ -26,7 +26,7 @@
           <Version Value="11"/>
           <PathDelim Value="\"/>
           <Target>
-            <Filename Value="test_progressbar"/>
+            <Filename Value="bin\$(TargetCPU)-$(TargetOS)\test_progressbar"/>
           </Target>
           <SearchPaths>
             <IncludeFiles Value="$(ProjOutDir)"/>

+ 139 - 145
test/test_progressbar/umain.lfm

@@ -1,10 +1,10 @@
 object Form1: TForm1
   Left = 357
-  Height = 565
+  Height = 548
   Top = 179
   Width = 654
   Caption = 'Form1'
-  ClientHeight = 565
+  ClientHeight = 548
   ClientWidth = 654
   DesignTimePPI = 120
   OnClose = FormClose
@@ -30,14 +30,13 @@ object Form1: TForm1
     BackgroundRandomizeMinIntensity = 4000
     BackgroundRandomizeMaxIntensity = 5000
     BackgroundRandomize = True
-    MarqueeBounce = 0
     OnTimerEnd = BGRAMaxMProgressTimerEnd
   end
   object edCaption: TEdit
     Left = 75
     Height = 28
     Top = 150
-    Width = 100
+    Width = 150
     TabOrder = 0
     OnChange = edCaptionChange
   end
@@ -49,7 +48,7 @@ object Form1: TForm1
     Caption = 'Caption :'
   end
   object cbCaptionPercent: TCheckBox
-    Left = 291
+    Left = 339
     Height = 24
     Top = 150
     Width = 111
@@ -58,14 +57,14 @@ object Form1: TForm1
     OnChange = cbCaptionPercentChange
   end
   object Label6: TLabel
-    Left = 320
+    Left = 360
     Height = 20
     Top = 180
     Width = 46
     Caption = 'Digits :'
   end
   object edCaptionDigits: TSpinEdit
-    Left = 370
+    Left = 410
     Height = 28
     Top = 175
     Width = 62
@@ -74,7 +73,7 @@ object Form1: TForm1
     OnChange = edCaptionDigitsChange
   end
   object rgCaptionAlign: TRadioGroup
-    Left = 184
+    Left = 232
     Height = 81
     Top = 150
     Width = 99
@@ -144,74 +143,36 @@ object Form1: TForm1
     OnChange = cbBackgroundRandomChange
   end
   object PageControl1: TPageControl
-    Left = 10
-    Height = 312
-    Top = 240
-    Width = 630
+    Left = 0
+    Height = 300
+    Top = 248
+    Width = 654
     ActivePage = TabNormal
+    Align = alBottom
     TabIndex = 0
     TabOrder = 6
     OnChange = PageControl1Change
     object TabNormal: TTabSheet
       Caption = 'Normal'
-      ClientHeight = 279
-      ClientWidth = 622
-      object Label5: TLabel
-        Left = 20
-        Height = 20
-        Top = 25
-        Width = 32
-        Caption = 'Min :'
-      end
-      object edMin: TFloatSpinEdit
-        Left = 59
-        Height = 25
-        Top = 20
-        Width = 100
-        Font.Color = clWindowText
-        Font.Name = 'Arial'
-        MaxValue = 100
-        ParentFont = False
-        TabOrder = 0
-        OnChange = edMinChange
-      end
-      object Label7: TLabel
-        Left = 18
-        Height = 20
-        Top = 65
-        Width = 35
-        Caption = 'Max :'
-      end
-      object edMax: TFloatSpinEdit
-        Left = 59
-        Height = 25
-        Top = 60
-        Width = 100
-        Font.Color = clWindowText
-        Font.Name = 'Arial'
-        MaxValue = 100
-        ParentFont = False
-        TabOrder = 1
-        Value = 100
-        OnChange = edMaxChange
-      end
+      ClientHeight = 267
+      ClientWidth = 646
       object Label2: TLabel
-        Left = 14
+        Left = 16
         Height = 20
-        Top = 105
+        Top = 20
         Width = 43
         Caption = 'Value :'
       end
       object edValue: TFloatSpinEdit
-        Left = 59
+        Left = 65
         Height = 25
-        Top = 100
-        Width = 100
+        Top = 20
+        Width = 85
         Font.Color = clWindowText
         Font.Name = 'Arial'
         MaxValue = 100
         ParentFont = False
-        TabOrder = 2
+        TabOrder = 0
         Value = 30
         OnChange = edValueChange
       end
@@ -219,27 +180,27 @@ object Form1: TForm1
     object TabMultiProgress: TTabSheet
       Tag = 1
       Caption = 'MultiProgress'
-      ClientHeight = 279
-      ClientWidth = 622
+      ClientHeight = 267
+      ClientWidth = 646
       object Label3: TLabel
         Left = 190
         Height = 20
-        Top = 26
+        Top = 20
         Width = 72
         Caption = 'Value Sub :'
       end
-      object edMultiPValueSub: TFloatSpinEdit
+      object edValueSub: TFloatSpinEdit
         Left = 270
         Height = 25
         Top = 20
-        Width = 81
+        Width = 85
         Font.Color = clWindowText
         Font.Name = 'Arial'
         MaxValue = 100
         ParentFont = False
         TabOrder = 0
         Value = 10
-        OnChange = edMultiPValueSubChange
+        OnChange = edValueSubChange
       end
       object cbCaptionPercentM: TCheckBox
         Left = 190
@@ -301,62 +262,23 @@ object Form1: TForm1
         StateDisabled.BorderColor = 12566463
         StateDisabled.BorderWidth = 1
       end
-      object Label11: TLabel
-        Left = 26
-        Height = 20
-        Top = 25
-        Width = 32
-        Caption = 'Min :'
-      end
-      object edMin1: TFloatSpinEdit
-        Left = 65
-        Height = 25
-        Top = 20
-        Width = 100
-        Font.Color = clWindowText
-        Font.Name = 'Arial'
-        MaxValue = 100
-        ParentFont = False
-        TabOrder = 3
-        OnChange = edMinChange
-      end
-      object Label12: TLabel
-        Left = 24
-        Height = 20
-        Top = 65
-        Width = 35
-        Caption = 'Max :'
-      end
-      object edMax1: TFloatSpinEdit
-        Left = 65
-        Height = 25
-        Top = 60
-        Width = 100
-        Font.Color = clWindowText
-        Font.Name = 'Arial'
-        MaxValue = 100
-        ParentFont = False
-        TabOrder = 4
-        Value = 100
-        OnChange = edMaxChange
-      end
       object Label13: TLabel
-        Left = 20
+        Left = 16
         Height = 20
-        Top = 105
+        Top = 20
         Width = 43
         Caption = 'Value :'
       end
       object edValue1: TFloatSpinEdit
         Left = 65
         Height = 25
-        Top = 100
-        Width = 100
+        Top = 20
+        Width = 85
         Font.Color = clWindowText
         Font.Name = 'Arial'
         MaxValue = 100
         ParentFont = False
-        TabOrder = 5
+        TabOrder = 3
         Value = 30
         OnChange = edValueChange
       end
@@ -364,8 +286,8 @@ object Form1: TForm1
     object TabMarquee: TTabSheet
       Tag = 2
       Caption = 'Marquee'
-      ClientHeight = 279
-      ClientWidth = 622
+      ClientHeight = 267
+      ClientWidth = 646
       object rgMarqueeSpeed: TRadioGroup
         Left = 20
         Height = 81
@@ -392,16 +314,16 @@ object Form1: TForm1
         OnClick = rgMarqueeSpeedClick
       end
       object edMarqueeWidth: TBCTrackbarUpdown
-        Left = 255
-        Height = 32
-        Top = 41
-        Width = 80
+        Left = 384
+        Height = 30
+        Top = 74
+        Width = 85
         AllowNegativeValues = False
         BarExponent = 1
         Increment = 1
         LongTimeInterval = 400
-        MinValue = 20
-        MaxValue = 100
+        MinValue = 10
+        MaxValue = 475
         OnChange = edMarqueeWidthChange
         Value = 95
         ShortTimeInterval = 100
@@ -463,29 +385,10 @@ object Form1: TForm1
         Font.Name = 'Arial'
         HasTrackBar = True
         ArrowColor = clBtnText
-        Enabled = False
         TabOrder = 1
         TabStop = True
         UseDockManager = False
       end
-      object Label1: TLabel
-        Left = 170
-        Height = 20
-        Top = 21
-        Width = 47
-        Caption = 'Width :'
-      end
-      object cbMarqueeWidth: TCheckBox
-        Left = 189
-        Height = 24
-        Top = 41
-        Width = 53
-        Caption = 'Auto'
-        Checked = True
-        State = cbChecked
-        TabOrder = 2
-        OnChange = cbMarqueeWidthChange
-      end
       object rgMarqueeDirection: TRadioGroup
         Left = 130
         Height = 51
@@ -508,7 +411,7 @@ object Form1: TForm1
           'Right'
           'Left'
         )
-        TabOrder = 3
+        TabOrder = 2
         OnClick = rgMarqueeDirectionClick
       end
       object btTimerPlayPause1: TBGRASpeedButton
@@ -535,7 +438,7 @@ object Form1: TForm1
         Caption = 'Auto Start'
         Checked = True
         State = cbChecked
-        TabOrder = 4
+        TabOrder = 3
         OnChange = cbTimerAutoStartChange
       end
       object edMarqueeBounce: TSpinEdit
@@ -546,7 +449,7 @@ object Form1: TForm1
         Width = 62
         MaxValue = 10
         ParentShowHint = False
-        TabOrder = 5
+        TabOrder = 4
         OnChange = edMarqueeBounceChange
       end
       object Label8: TLabel
@@ -556,12 +459,64 @@ object Form1: TForm1
         Width = 52
         Caption = 'Bounce:'
       end
+      object rgMarqueeWidthType: TRadioGroup
+        Left = 280
+        Height = 148
+        Top = 20
+        Width = 96
+        AutoFill = True
+        Caption = 'Width Type'
+        ChildSizing.LeftRightSpacing = 6
+        ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+        ChildSizing.EnlargeVertical = crsHomogenousChildResize
+        ChildSizing.ShrinkHorizontal = crsScaleChilds
+        ChildSizing.ShrinkVertical = crsScaleChilds
+        ChildSizing.Layout = cclLeftToRightThenTopToBottom
+        ChildSizing.ControlsPerLine = 1
+        ClientHeight = 123
+        ClientWidth = 92
+        ItemIndex = 0
+        Items.Strings = (
+          'Auto'
+          'Fixed'
+          'Value'
+          'ValueSub'
+        )
+        TabOrder = 5
+        OnClick = rgMarqueeWidthTypeClick
+      end
+      object edValueSub1: TFloatSpinEdit
+        Left = 384
+        Height = 25
+        Top = 143
+        Width = 85
+        Font.Color = clWindowText
+        Font.Name = 'Arial'
+        MaxValue = 100
+        ParentFont = False
+        TabOrder = 6
+        Value = 10
+        OnChange = edValueSubChange
+      end
+      object edValue2: TFloatSpinEdit
+        Left = 384
+        Height = 25
+        Top = 112
+        Width = 85
+        Font.Color = clWindowText
+        Font.Name = 'Arial'
+        MaxValue = 100
+        ParentFont = False
+        TabOrder = 7
+        Value = 30
+        OnChange = edValueChange
+      end
     end
     object TabTimer: TTabSheet
       Tag = 3
       Caption = 'Timer'
-      ClientHeight = 279
-      ClientWidth = 622
+      ClientHeight = 267
+      ClientWidth = 646
       object btTimerStart: TBGRASpeedButton
         Left = 40
         Height = 28
@@ -632,8 +587,8 @@ object Form1: TForm1
     object TabGraph: TTabSheet
       Tag = 4
       Caption = 'Graph'
-      ClientHeight = 279
-      ClientWidth = 622
+      ClientHeight = 267
+      ClientWidth = 646
       object Label9: TLabel
         Left = 202
         Height = 20
@@ -829,7 +784,7 @@ object Form1: TForm1
         Left = 415
         Height = 28
         Top = 81
-        Width = 100
+        Width = 150
         TabOrder = 7
         OnChange = edYLineCaptionChange
       end
@@ -844,7 +799,7 @@ object Form1: TForm1
         Left = 415
         Height = 28
         Top = 116
-        Width = 100
+        Width = 150
         TabOrder = 8
         OnChange = edYLineAfterChange
       end
@@ -939,6 +894,45 @@ object Form1: TForm1
     StateDisabled.BorderColor = 12566463
     StateDisabled.BorderWidth = 1
   end
+  object Label5: TLabel
+    Left = 34
+    Height = 20
+    Top = 189
+    Width = 32
+    Caption = 'Min :'
+  end
+  object edMin: TFloatSpinEdit
+    Left = 75
+    Height = 25
+    Top = 184
+    Width = 100
+    Font.Color = clWindowText
+    Font.Name = 'Arial'
+    MaxValue = 100
+    ParentFont = False
+    TabOrder = 8
+    OnChange = edMinChange
+  end
+  object Label7: TLabel
+    Left = 34
+    Height = 20
+    Top = 221
+    Width = 35
+    Caption = 'Max :'
+  end
+  object edMax: TFloatSpinEdit
+    Left = 75
+    Height = 25
+    Top = 216
+    Width = 100
+    Font.Color = clWindowText
+    Font.Name = 'Arial'
+    MaxValue = 100
+    ParentFont = False
+    TabOrder = 9
+    Value = 100
+    OnChange = edMaxChange
+  end
   object ColorDialog1: TColorDialog
     Color = clBlack
     CustomColors.Strings = (

+ 32 - 21
test/test_progressbar/umain.pas

@@ -26,7 +26,6 @@ type
     cbBackgroundRandom: TCheckBox;
     cbCaptionPercent1: TCheckBox;
     cbCaptionPercentM: TCheckBox;
-    cbMarqueeWidth: TCheckBox;
     cbShowDividers: TCheckBox;
     cbShowDividersY: TCheckBox;
     cbShowYLine: TCheckBox;
@@ -37,6 +36,10 @@ type
     ColorDialog1: TColorDialog;
     btBarColor: TColorSpeedButton;
     edCaption: TEdit;
+    edMax: TFloatSpinEdit;
+    edMin: TFloatSpinEdit;
+    edValueSub1: TFloatSpinEdit;
+    edValue2: TFloatSpinEdit;
     edYLineCaption: TEdit;
     edYLineAfter: TEdit;
     edYLineDigits: TSpinEdit;
@@ -46,23 +49,16 @@ type
     edGraphValueY: TFloatSpinEdit;
     edMarqueeBounce: TSpinEdit;
     edMarqueeWidth: TBCTrackbarUpdown;
-    edMax: TFloatSpinEdit;
-    edMax1: TFloatSpinEdit;
     edMax2: TFloatSpinEdit;
     edMaxY: TFloatSpinEdit;
-    edMin: TFloatSpinEdit;
-    edMin1: TFloatSpinEdit;
     edMin2: TFloatSpinEdit;
     edMinY: TFloatSpinEdit;
-    edMultiPValueSub: TFloatSpinEdit;
+    edValueSub: TFloatSpinEdit;
     edValue: TFloatSpinEdit;
     edValue1: TFloatSpinEdit;
     GroupBox1: TGroupBox;
     GroupBox2: TGroupBox;
-    Label1: TLabel;
     Label10: TLabel;
-    Label11: TLabel;
-    Label12: TLabel;
     Label13: TLabel;
     Label14: TLabel;
     Label15: TLabel;
@@ -89,6 +85,7 @@ type
     rgCaptionAlignM: TRadioGroup;
     rgMarqueeDirection: TRadioGroup;
     rgMarqueeSpeed: TRadioGroup;
+    rgMarqueeWidthType: TRadioGroup;
     TabNormal: TTabSheet;
     TabMarquee: TTabSheet;
     TabMultiProgress: TTabSheet;
@@ -119,7 +116,7 @@ type
     procedure edMaxYChange(Sender: TObject);
     procedure edMinChange(Sender: TObject);
     procedure edMinYChange(Sender: TObject);
-    procedure edMultiPValueSubChange(Sender: TObject; AByUser: boolean);
+    procedure edValueSubChange(Sender: TObject; AByUser: boolean);
     procedure edCaptionTimerFormatChange(Sender: TObject);
     procedure edValueChange(Sender: TObject; AByUser: boolean);
     procedure edMarqueeWidthChange(Sender: TObject; AByUser: boolean);
@@ -133,6 +130,7 @@ type
     procedure rgCaptionAlignClick(Sender: TObject);
     procedure rgCaptionAlignMClick(Sender: TObject);
     procedure rgMarqueeDirectionClick(Sender: TObject);
+    procedure rgMarqueeWidthTypeClick(Sender: TObject);
     procedure rgMarqueeSpeedClick(Sender: TObject);
   private
     { private declarations }
@@ -180,11 +178,7 @@ end;
 
 procedure TForm1.cbMarqueeWidthChange(Sender: TObject);
 begin
-  if cbMarqueeWidth.checked
-  then BGRAMaxMProgress.MarqueeWidth:= 0
-  else BGRAMaxMProgress.MarqueeWidth:= edMarqueeWidth.Value;
-
-  edMarqueeWidth.Enabled:= not(cbMarqueeWidth.checked);
+  BGRAMaxMProgress.MarqueeWidth:= edMarqueeWidth.Value;
 end;
 
 procedure TForm1.cbCaptionPercentChange(Sender: TObject);
@@ -250,7 +244,9 @@ end;
 
 procedure TForm1.edMaxChange(Sender: TObject);
 begin
-  BGRAMaxMProgress.MaxValue:= edMax.Value;
+  BGRAMaxMProgress.MaxValue:= TFloatSpinEdit(Sender).Value;
+  edMax.Value:= BGRAMaxMProgress.MaxValue;
+  edMax2.Value:= BGRAMaxMProgress.MaxValue;
   edValue.MaxValue:= BGRAMaxMProgress.MaxValue;
   edValue1.MaxValue:= BGRAMaxMProgress.MaxValue;
   edGraphValue.MaxValue:= BGRAMaxMProgress.MaxValue;
@@ -264,7 +260,9 @@ end;
 
 procedure TForm1.edMinChange(Sender: TObject);
 begin
-  BGRAMaxMProgress.MinValue:= edMin.Value;
+  BGRAMaxMProgress.MinValue:= TFloatSpinEdit(Sender).Value;
+  edMin.Value:= BGRAMaxMProgress.MinValue;
+  edMin2.Value:= BGRAMaxMProgress.MinValue;
   edValue.MinValue:= BGRAMaxMProgress.MinValue;
   edValue1.MinValue:= BGRAMaxMProgress.MinValue;
   edGraphValue.MinValue:= BGRAMaxMProgress.MinValue;
@@ -276,10 +274,11 @@ begin
   edGraphValueY.MinValue:= BGRAMaxMProgress.MinYValue;
 end;
 
-procedure TForm1.edMultiPValueSubChange(Sender: TObject; AByUser: boolean);
+procedure TForm1.edValueSubChange(Sender: TObject; AByUser: boolean);
 begin
-  BGRAMaxMProgress.ValueSub:= edMultiPValueSub.Value;
-  edMultiPValueSub.Value:= BGRAMaxMProgress.ValueSub;
+  BGRAMaxMProgress.ValueSub:= TFloatSpinEdit(Sender).Value;
+  edValueSub.Value:= BGRAMaxMProgress.ValueSub;
+  edValueSub1.Value:= BGRAMaxMProgress.ValueSub;
 end;
 
 procedure TForm1.edCaptionTimerFormatChange(Sender: TObject);
@@ -289,7 +288,10 @@ end;
 
 procedure TForm1.edValueChange(Sender: TObject; AByUser: boolean);
 begin
-  BGRAMaxMProgress.Value:= edValue.Value;
+  BGRAMaxMProgress.Value:= TFloatSpinEdit(Sender).Value;
+  edValue.Value:= BGRAMaxMProgress.Value;
+  edValue1.Value:= BGRAMaxMProgress.Value;
+  edValue2.Value:= BGRAMaxMProgress.Value;
 end;
 
 procedure TForm1.edMarqueeWidthChange(Sender: TObject; AByUser: boolean);
@@ -329,6 +331,9 @@ end;
 
 procedure TForm1.PageControl1Change(Sender: TObject);
 begin
+  //Update Controls
+
+
   if (PageControl1.ActivePage.Tag = 4)
   then BGRAMaxMProgress.Height:= 100 //Graph
   else BGRAMaxMProgress.Height:= 34;
@@ -361,6 +366,12 @@ begin
   BGRAMaxMProgress.MarqueeDirection:= TBGRAPBarMarqueeDirection(rgMarqueeDirection.ItemIndex);
 end;
 
+procedure TForm1.rgMarqueeWidthTypeClick(Sender: TObject);
+begin
+  BGRAMaxMProgress.MarqueeWidthType:= TBGRAPBarMarqueeWidthType(rgMarqueeWidthType.ItemIndex);
+//  edMarqueeWidth.Enabled:= (BGRAMaxMProgress.MarqueeWidthType = pbmwFixed);
+end;
+
 procedure TForm1.rgMarqueeSpeedClick(Sender: TObject);
 begin
   BGRAMaxMProgress.MarqueeSpeed:= TBGRAPBarMarqueeSpeed(rgMarqueeSpeed.ItemIndex);