Selaa lähdekoodia

Added Marquee and MultiProgress to FlashProgressBar

Massimo Magnano 11 kuukautta sitten
vanhempi
sitoutus
cedb7c4e70

+ 243 - 20
bgradrawerflashprogressbar.pas

@@ -6,9 +6,12 @@ interface
 
 uses
   Classes, {$IFDEF BGRABITMAP_USE_MSEGUI} mclasses, {$ENDIF} SysUtils, Types, BGRABitmap, BGRABitmapTypes, BGRAGraphics, BGRAGradients,
-  Math;
+  Math, fptimer;
 
 type
+  TBGRAPBarStyle = (pbstNormal, pbstMultiProgress, pbstMarquee);
+  TBGRAPBarMarqueeMode = (pbmmToLeft, pbmmToRight);
+  TBGRAPBarMarqueeSpeed = (pbmsSlow, pbmsMedium, pbmsFast);
 
   TBGRAProgressBarRedrawEvent = procedure(Sender: TObject; Bitmap: TBGRABitmap; xpos: integer) of object;
 
@@ -20,28 +23,54 @@ type
     FBackgroundRandomize: boolean;
     FBackgroundRandomizeMaxIntensity: word;
     FBackgroundRandomizeMinIntensity: word;
-    FBarColor: TColor;
+    FBarColor,
+    FBarColorM: TColor;
+    FMarqueeMode: TBGRAPBarMarqueeMode;
+    FMarqueeSpeed: TBGRAPBarMarqueeSpeed;
+    FMarqueeWidth: Word;
     FMaxValue: integer;
     FMinValue: integer;
     FOnChange: TNotifyEvent;
     FRandSeed: integer;
-    FValue: integer;
+    FStyle: TBGRAPBarStyle;
+    FValue,
+    FValueM: integer;
     xpos: integer;
+    marqueeTimer: TFPTimer;
+    marqueeLeft,
+    marqueeRight: Integer;
+
     procedure SetBackgroundRandomize(AValue: boolean);
     procedure SetBackgroundRandomizeMaxIntensity(AValue: word);
     procedure SetBackgroundRandomizeMinIntensity(AValue: word);
     procedure SetBarColor(AValue: TColor);
     procedure SetBackgroundColor(AValue: TColor);
+    procedure SetBarColorM(AValue: TColor);
+    procedure SetMarqueeMode(AValue: TBGRAPBarMarqueeMode);
+    procedure SetMarqueeSpeed(AValue: TBGRAPBarMarqueeSpeed);
+    procedure SetMarqueeWidth(AValue: Word);
     procedure SetMaxValue(AValue: integer);
     procedure SetMinValue(AValue: integer);
     procedure SetRandSeed(AValue: integer);
+    procedure SetStyle(AValue: TBGRAPBarStyle);
     procedure SetValue(AValue: integer);
+    procedure SetValueM(AValue: integer);
+
+  protected
+    marqueeCurMode: TBGRAPBarMarqueeMode;
+
+    procedure MarqueeOnTimer(Sender: TObject);
+
   public
+    constructor Create;
+    destructor Destroy; override;
+
     procedure Draw(ABitmap: TBGRABitmap);
-  public
+
     property OnChange: TNotifyEvent read FOnChange write FOnChange;
     property RandSeed: integer read FRandSeed write SetRandSeed;
     property BarColor: TColor read FBarColor write SetBarColor;
+    property BarColorM: TColor read FBarColorM write SetBarColorM;
     property BackgroundColor: TColor read FBackgroundColor write SetBackgroundColor;
     property BackgroundRandomizeMinIntensity: word
       read FBackgroundRandomizeMinIntensity write SetBackgroundRandomizeMinIntensity;
@@ -50,10 +79,15 @@ type
     property BackgroundRandomize: boolean read FBackgroundRandomize
       write SetBackgroundRandomize;
     property XPosition: integer read xpos;
-  public
+    property Style: TBGRAPBarStyle read FStyle write SetStyle default pbstNormal;
+    property MarqueeWidth: Word read FMarqueeWidth write SetMarqueeWidth default 30;
+    property MarqueeSpeed: TBGRAPBarMarqueeSpeed read FMarqueeSpeed write SetMarqueeSpeed default pbmsMedium;
+    property MarqueeMode: TBGRAPBarMarqueeMode read FMarqueeMode write SetMarqueeMode default pbmmToRight;
+
     property MinValue: integer read FMinValue write SetMinValue;
     property MaxValue: integer read FMaxValue write SetMaxValue;
     property Value: integer read FValue write SetValue;
+    property ValueM: integer read FValueM write SetValueM;
   end;
 
 implementation
@@ -67,8 +101,6 @@ begin
   FBarColor := AValue;
   if Assigned(FOnChange) then
     FOnChange(Self);
-  if Assigned(FOnChange) then
-    FOnChange(Self);
 end;
 
 procedure TBGRADrawerFlashProgressBar.SetBackgroundRandomize(AValue: boolean);
@@ -107,6 +139,41 @@ begin
     FOnChange(Self);
 end;
 
+procedure TBGRADrawerFlashProgressBar.SetBarColorM(AValue: TColor);
+begin
+  if FBarColorM = AValue then
+    Exit;
+  FBarColorM := AValue;
+  if Assigned(FOnChange) then
+    FOnChange(Self);
+end;
+
+procedure TBGRADrawerFlashProgressBar.SetMarqueeMode(AValue: TBGRAPBarMarqueeMode);
+begin
+  if (FMarqueeMode <> AValue) then
+  begin
+    FMarqueeMode:= AValue;
+    marqueeCurMode:= AValue;
+    if Assigned(FOnChange) then FOnChange(Self);
+  end;
+end;
+
+procedure TBGRADrawerFlashProgressBar.SetMarqueeSpeed(AValue: TBGRAPBarMarqueeSpeed);
+begin
+  FMarqueeSpeed:=AValue;
+  case FMarqueeSpeed of
+  pbmsSlow: marqueeTimer.Interval:= 50;
+  pbmsMedium: marqueeTimer.Interval:= 20;
+  pbmsFast: marqueeTimer.Interval:= 10;
+  end;
+end;
+
+procedure TBGRADrawerFlashProgressBar.SetMarqueeWidth(AValue: Word);
+begin
+  if FMarqueeWidth=AValue then Exit;
+  FMarqueeWidth:=AValue;
+end;
+
 procedure TBGRADrawerFlashProgressBar.SetMaxValue(AValue: integer);
 begin
   if FMaxValue = AValue then
@@ -140,6 +207,23 @@ begin
   FRandSeed := AValue;
 end;
 
+procedure TBGRADrawerFlashProgressBar.SetStyle(AValue: TBGRAPBarStyle);
+begin
+  if (FStyle <> AValue) then
+  begin
+    if (AValue = pbstMarquee)
+    then begin
+           //if not(csDesigning in ComponentState) then
+           marqueeLeft:= 0;
+           marqueeTimer.Enabled:= True;
+         end
+    else marqueeTimer.Enabled:= False;
+
+    FStyle:= AValue;
+    if Assigned(FOnChange) then FOnChange(Self);
+  end;
+end;
+
 procedure TBGRADrawerFlashProgressBar.SetValue(AValue: integer);
 begin
   if FValue = AValue then
@@ -153,10 +237,56 @@ begin
     FOnChange(Self);
 end;
 
+procedure TBGRADrawerFlashProgressBar.SetValueM(AValue: integer);
+begin
+  if FValueM = AValue then
+    exit;
+  FValueM := AValue;
+  if FValueM < FMinValue then
+    FValueM := FMinValue;
+  if FValueM > FValue then
+    FValueM := FValue;
+  if Assigned(FOnChange) then
+    FOnChange(Self);
+end;
+
+procedure TBGRADrawerFlashProgressBar.MarqueeOnTimer(Sender: TObject);
+begin
+  if (marqueeCurMode = pbmmToRight)
+  then inc(marqueeLeft, 2)
+  else dec(marqueeRight, 2);
+
+  if Assigned(FOnChange) then FOnChange(Self);
+end;
+
+constructor TBGRADrawerFlashProgressBar.Create;
+begin
+  inherited Create;
+
+  FStyle:= pbstNormal;
+  FMarqueeWidth:= 30;
+  FMarqueeSpeed:= pbmsMedium;
+  FMarqueeMode:= pbmmToRight;
+  marqueeCurMode:= pbmmToRight;
+  marqueeLeft:= 0;
+  marqueeRight:= 0;
+  marqueeTimer:= TFPTimer.Create(nil);
+  marqueeTimer.Enabled:= False;
+  marqueeTimer.Interval:= 20;
+  marqueeTimer.OnTimer:= @MarqueeOnTimer;
+end;
+
+destructor TBGRADrawerFlashProgressBar.Destroy;
+begin
+  marqueeTimer.Free;
+  inherited Destroy;
+end;
+
 procedure TBGRADrawerFlashProgressBar.Draw(ABitmap: TBGRABitmap);
 var
   content: TRect;
-  y, tx, ty: integer;
+  y, tx, ty,
+  marqueeOver: integer;
   bgColor: TBGRAPixel;
 
   function ApplyLightness(c: TBGRAPixel; lightness: word): TBGRAPixel;
@@ -164,11 +294,11 @@ var
     Result := GammaCompression(SetLightness(GammaExpansion(c), lightness));
   end;
 
-  procedure DrawBar(bounds: TRect);
+  procedure DrawBar(bounds: TRect; AColor: TColor);
   var
     lCol: TBGRAPixel;
   begin
-    lCol := BarColor;
+    lCol := AColor;
 
     DoubleGradientAlphaFill(ABitmap, bounds,
       ApplyLightness(lCol, 37000), ApplyLightness(lCol, 29000),
@@ -206,19 +336,112 @@ begin
     if tx >= 6 then
       ABitmap.DrawVertLine(content.Right - 1, content.Top, content.Bottom - 1,
         BGRA(0, 0, 0, 32));
-    if FMaxValue > FMinValue then
-    begin
-      xpos := round((FValue - FMinValue) / (FMaxValue - FMinValue) *
-        (content.right - content.left)) + content.left;
-      if xpos > content.left then
-      begin
-        DrawBar(rect(content.left, content.top, xpos, content.bottom));
-        if xpos < content.right then
+
+    Case FStyle of
+      pbstNormal: begin
+        if FMaxValue > FMinValue then
+        begin
+          xpos := round((FValue - FMinValue) / (FMaxValue - FMinValue) *
+                        (content.right - content.left)) + content.left;
+          if xpos > content.left then
+          begin
+            DrawBar(rect(content.left, content.top, xpos, content.bottom), FBarColor);
+            if xpos < content.right then
+            begin
+              ABitmap.SetPixel(xpos, content.top, BGRA(62, 62, 62));
+              ABitmap.SetVertLine(xpos, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+            end;
+          end;
+        end;
+      end;
+      pbstMultiProgress: begin
+        if FMaxValue > FMinValue then
         begin
-          ABitmap.SetPixel(xpos, content.top, BGRA(62, 62, 62));
-          ABitmap.SetVertLine(xpos, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+          xpos := round((FValue - FMinValue) / (FMaxValue - FMinValue) *
+                        (content.right - content.left)) + content.left;
+          if xpos > content.left then
+          begin
+            DrawBar(rect(content.left, content.top, xpos, content.bottom), FBarColor);
+            if xpos < content.right then
+            begin
+              ABitmap.SetPixel(xpos, content.top, BGRA(62, 62, 62));
+              ABitmap.SetVertLine(xpos, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+            end;
+          end;
+
+          xpos := round((FValueM - FMinValue) / (FMaxValue - FMinValue) *
+                        (content.right - content.left)) + content.left;
+          if xpos > content.left then
+          begin
+            DrawBar(rect(content.left, content.top, xpos, content.bottom), FBarColorM);
+            if xpos < content.right then
+            begin
+              ABitmap.SetPixel(xpos, content.top, BGRA(62, 62, 62));
+              ABitmap.SetVertLine(xpos, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+            end;
+          end;
+
         end;
       end;
+      pbstMarquee: begin
+        if (marqueeCurMode = pbmmToRight)
+        then begin
+               if (marqueeLeft >= tx-2) then marqueeLeft:= 2;
+
+               marqueeRight:= marqueeLeft+(FMarqueeWidth-1);
+               marqueeOver:= 0;
+
+               if (marqueeRight > tx-2) then
+               begin
+                 marqueeOver:= marqueeRight-tx+4;
+                 marqueeRight:= tx-2;
+               end;
+
+               DrawBar(rect(marqueeLeft, content.top, marqueeRight, content.bottom), FBarColor);
+               ABitmap.SetPixel(marqueeLeft, content.top, BGRA(62, 62, 62));
+               ABitmap.SetVertLine(marqueeLeft, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+
+               if (marqueeOver = 0)
+               then begin
+                      ABitmap.SetPixel(marqueeRight, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeRight, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                    end
+               else begin
+                      DrawBar(rect(2, content.top, marqueeOver, content.bottom), FBarColor);
+                      ABitmap.SetPixel(marqueeOver, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeOver, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                    end;
+             end
+        else begin
+               if (marqueeRight < 2) then marqueeRight:= tx-2;
+
+               marqueeLeft:= marqueeRight-(FMarqueeWidth-1);
+               marqueeOver:= 0;
+
+               if (marqueeRight < FMarqueeWidth) then
+               begin
+                 marqueeOver:= FMarqueeWidth-abs(marqueeLeft)+1;
+                 marqueeLeft:= tx-2-abs(marqueeLeft);
+               end;
+
+               if (marqueeOver = 0)
+               then begin
+                      DrawBar(rect(marqueeLeft, content.top, marqueeRight, content.bottom), FBarColor);
+                      ABitmap.SetPixel(marqueeLeft, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeLeft, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                      ABitmap.SetPixel(marqueeRight, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeRight, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                    end
+               else begin
+                      DrawBar(rect(2, content.top, marqueeOver, content.bottom), FBarColor);
+                      ABitmap.SetPixel(marqueeOver, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeOver, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                      DrawBar(rect(marqueeLeft, content.top, tx-2, content.bottom), FBarColor);
+                      ABitmap.SetPixel(marqueeLeft, content.top, BGRA(62, 62, 62));
+                      ABitmap.SetVertLine(marqueeLeft, content.top + 1, content.bottom - 1, BGRA(40, 40, 40));
+                    end;
+             end;
+      end;
     end;
   end;
 end;

+ 88 - 4
bgraflashprogressbar.pas

@@ -12,6 +12,8 @@
 - Edivando S. Santos Brasil | [email protected]
   (Compatibility with delphi VCL 11/2018)
 
+- Massimo Magnano
+    2024-12  Added Marquee and MultiProgress
 ***************************** END CONTRIBUTOR(S) *****************************}
 unit BGRAFlashProgressBar;
 
@@ -37,18 +39,30 @@ type
     function GetBackgroundRandomizeMaxIntensity: word;
     function GetBackgroundRandomizeMinIntensity: word;
     function GetBarColor: TColor;
+    function GetBarColorM: TColor;
+    function GetMarqueeMode: TBGRAPBarMarqueeMode;
+    function GetMarqueeSpeed: TBGRAPBarMarqueeSpeed;
+    function GetMarqueeWidth: Word;
     function GetMaxValue: integer;
     function GetMinValue: integer;
+    function GetStyle: TBGRAPBarStyle;
     function GetValue: integer;
+    function GetValueM: integer;
     procedure OnChangeDrawer(Sender: TObject);
     procedure SetBackgroundColor(AValue: TColor);
     procedure SetBackgroundRandomize(AValue: boolean);
     procedure SetBackgroundRandomizeMaxIntensity(AValue: word);
     procedure SetBackgroundRandomizeMinIntensity(AValue: word);
     procedure SetBarColor(AValue: TColor);
+    procedure SetBarColorM(AValue: TColor);
+    procedure SetMarqueeMode(AValue: TBGRAPBarMarqueeMode);
+    procedure SetMarqueeSpeed(AValue: TBGRAPBarMarqueeSpeed);
+    procedure SetMarqueeWidth(AValue: Word);
     procedure SetMaxValue(const AValue: integer);
     procedure SetMinValue(const AValue: integer);
+    procedure SetStyle(AValue: TBGRAPBarStyle);
     procedure SetValue(const AValue: integer);
+    procedure SetValueM(AValue: integer);
   protected
     procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
       WithThemeSpace: boolean); override;
@@ -68,6 +82,8 @@ type
   published
     property Align;
     property Anchors;
+    property Font;
+    property ParentFont;
     property OnClick;
     property OnMouseDown;
     property OnMouseEnter;
@@ -80,12 +96,19 @@ type
     property MinValue: integer Read GetMinValue Write SetMinValue;
     property MaxValue: integer Read GetMaxValue Write SetMaxValue;
     property Value: integer Read GetValue Write SetValue;
+    property ValueM: integer Read GetValueM Write SetValueM;
     property Color; deprecated 'User BarColor instead';
     property BarColor: TColor read GetBarColor write SetBarColor;
+    property BarColorM: TColor read GetBarColorM write SetBarColorM;
     property BackgroundColor: TColor read GetBackgroundColor write SetBackgroundColor;
     property BackgroundRandomizeMinIntensity: word read GetBackgroundRandomizeMinIntensity write SetBackgroundRandomizeMinIntensity;
     property BackgroundRandomizeMaxIntensity: word read GetBackgroundRandomizeMaxIntensity write SetBackgroundRandomizeMaxIntensity;
     property BackgroundRandomize: boolean read GetBackgroundRandomize write SetBackgroundRandomize;
+    property Style: TBGRAPBarStyle read GetStyle write SetStyle default pbstNormal;
+    property MarqueeWidth: Word read GetMarqueeWidth write SetMarqueeWidth default 30;
+    property MarqueeSpeed: TBGRAPBarMarqueeSpeed read GetMarqueeSpeed write SetMarqueeSpeed default pbmsMedium;
+    property MarqueeMode: TBGRAPBarMarqueeMode read GetMarqueeMode write SetMarqueeMode default pbmmToRight;
+
     property OnRedraw: TBGRAProgressBarRedrawEvent read FOnredraw write FOnRedraw;
   end;
 
@@ -107,11 +130,21 @@ begin
   FDrawer.MinValue := AValue;
 end;
 
+procedure TBGRAFlashProgressBar.SetStyle(AValue: TBGRAPBarStyle);
+begin
+  FDrawer.Style:= AValue;
+end;
+
 procedure TBGRAFlashProgressBar.SetValue(const AValue: integer);
 begin
   FDrawer.Value := AValue;
 end;
 
+procedure TBGRAFlashProgressBar.SetValueM(AValue: integer);
+begin
+  FDrawer.ValueM := AValue;
+end;
+
 {$hints off}
 procedure TBGRAFlashProgressBar.CalculatePreferredSize(
   var PreferredWidth, PreferredHeight: integer; WithThemeSpace: boolean);
@@ -154,11 +187,14 @@ begin
   MinValue := 0;
   MaxValue := 100;
   Value := 30;
+  ValueM := 10;
   // Functionality and Style
   Randomize;
   FDrawer.RandSeed := RandSeed;
   // Style
+  Style:=pbstNormal;
   BarColor := BGRA(102, 163, 226);
+  BarColorM := BGRA(200, 200, 60);
   BackgroundColor := BGRA(47,47,47);
   BackgroundRandomize := True;
   BackgroundRandomizeMinIntensity := 4000;
@@ -241,6 +277,26 @@ begin
   Result := FDrawer.BarColor;
 end;
 
+function TBGRAFlashProgressBar.GetBarColorM: TColor;
+begin
+  Result := FDrawer.BarColorM;
+end;
+
+function TBGRAFlashProgressBar.GetMarqueeMode: TBGRAPBarMarqueeMode;
+begin
+  Result := FDrawer.MarqueeMode;
+end;
+
+function TBGRAFlashProgressBar.GetMarqueeSpeed: TBGRAPBarMarqueeSpeed;
+begin
+  Result := FDrawer.MarqueeSpeed;
+end;
+
+function TBGRAFlashProgressBar.GetMarqueeWidth: Word;
+begin
+  Result := FDrawer.MarqueeWidth;
+end;
+
 function TBGRAFlashProgressBar.GetMaxValue: integer;
 begin
   Result := FDrawer.MaxValue;
@@ -251,11 +307,21 @@ begin
   Result := FDrawer.MinValue;
 end;
 
+function TBGRAFlashProgressBar.GetStyle: TBGRAPBarStyle;
+begin
+   Result := FDrawer.Style;
+end;
+
 function TBGRAFlashProgressBar.GetValue: integer;
 begin
   Result := FDrawer.Value;
 end;
 
+function TBGRAFlashProgressBar.GetValueM: integer;
+begin
+  Result := FDrawer.ValueM;
+end;
+
 procedure TBGRAFlashProgressBar.SetBackgroundColor(AValue: TColor);
 begin
   FDrawer.BackgroundColor := AValue;
@@ -266,14 +332,12 @@ begin
   FDrawer.BackgroundRandomize := AValue;
 end;
 
-procedure TBGRAFlashProgressBar.SetBackgroundRandomizeMaxIntensity(AValue: word
-  );
+procedure TBGRAFlashProgressBar.SetBackgroundRandomizeMaxIntensity(AValue: word);
 begin
   FDrawer.BackgroundRandomizeMaxIntensity := AValue;
 end;
 
-procedure TBGRAFlashProgressBar.SetBackgroundRandomizeMinIntensity(AValue: word
-  );
+procedure TBGRAFlashProgressBar.SetBackgroundRandomizeMinIntensity(AValue: word);
 begin
   FDrawer.BackgroundRandomizeMinIntensity := AValue;
 end;
@@ -283,4 +347,24 @@ begin
   FDrawer.BarColor := AValue;
 end;
 
+procedure TBGRAFlashProgressBar.SetBarColorM(AValue: TColor);
+begin
+  FDrawer.BarColorM := AValue;
+end;
+
+procedure TBGRAFlashProgressBar.SetMarqueeMode(AValue: TBGRAPBarMarqueeMode);
+begin
+  FDrawer.MarqueeMode:= AValue;
+end;
+
+procedure TBGRAFlashProgressBar.SetMarqueeSpeed(AValue: TBGRAPBarMarqueeSpeed);
+begin
+  FDrawer.MarqueeSpeed:= AValue;
+end;
+
+procedure TBGRAFlashProgressBar.SetMarqueeWidth(AValue: Word);
+begin
+  FDrawer.MarqueeWidth:= AValue;
+end;
+
 end.

+ 334 - 51
test/test_progressbar/umain.lfm

@@ -1,12 +1,11 @@
 object Form1: TForm1
   Left = 357
-  Height = 240
+  Height = 288
   Top = 179
-  Width = 320
+  Width = 340
   Caption = 'Form1'
-  ClientHeight = 240
-  ClientWidth = 320
-  LCLVersion = '1.2.6.0'
+  ClientHeight = 288
+  ClientWidth = 340
   object BGRAFlashProgressBar1: TBGRAFlashProgressBar
     Left = 8
     Height = 33
@@ -14,27 +13,38 @@ object Form1: TForm1
     Width = 307
     MinValue = 0
     MaxValue = 100
-    Value = 30
-    OnRedraw = BGRAFlashProgressBar1Redraw
+    Value = 50
     Color = 14852966
+    BarColor = 14852966
+    BackgroundColor = 3092271
+    BackgroundRandomizeMinIntensity = 4000
+    BackgroundRandomizeMaxIntensity = 5000
+    BackgroundRandomize = True
+    OnRedraw = BGRAFlashProgressBar1Redraw
   end
   object BGRAFlashProgressBar2: TBGRAFlashProgressBar
     Left = 8
     Height = 33
     Top = 48
     Width = 307
+    OnClick = BGRAFlashProgressBar2Click
     MinValue = 0
     MaxValue = 100
-    Value = 30
-    OnClick = BGRAFlashProgressBar2Click
-    OnRedraw = BGRAFlashProgressBar2Redraw
+    Value = 50
     Color = 14852966
+    BarColor = 14852966
+    BackgroundColor = 3092271
+    BackgroundRandomizeMinIntensity = 4000
+    BackgroundRandomizeMaxIntensity = 5000
+    BackgroundRandomize = True
+    OnRedraw = BGRAFlashProgressBar2Redraw
   end
   object BCTrackbarUpdown1: TBCTrackbarUpdown
     Left = 8
     Height = 26
     Top = 96
-    Width = 182
+    Width = 328
+    AllowNegativeValues = False
     BarExponent = 1
     Increment = 1
     LongTimeInterval = 400
@@ -44,99 +54,59 @@ object Form1: TForm1
     Value = 50
     ShortTimeInterval = 100
     Background.Color = clWindow
-    Background.ColorOpacity = 255
     Background.Gradient1.StartColor = clWhite
-    Background.Gradient1.StartColorOpacity = 255
-    Background.Gradient1.DrawMode = dmSet
     Background.Gradient1.EndColor = clBlack
-    Background.Gradient1.EndColorOpacity = 255
-    Background.Gradient1.ColorCorrection = True
     Background.Gradient1.GradientType = gtLinear
     Background.Gradient1.Point1XPercent = 0
     Background.Gradient1.Point1YPercent = 0
     Background.Gradient1.Point2XPercent = 0
     Background.Gradient1.Point2YPercent = 100
-    Background.Gradient1.Sinus = False
     Background.Gradient2.StartColor = clWhite
-    Background.Gradient2.StartColorOpacity = 255
-    Background.Gradient2.DrawMode = dmSet
     Background.Gradient2.EndColor = clBlack
-    Background.Gradient2.EndColorOpacity = 255
-    Background.Gradient2.ColorCorrection = True
     Background.Gradient2.GradientType = gtLinear
     Background.Gradient2.Point1XPercent = 0
     Background.Gradient2.Point1YPercent = 0
     Background.Gradient2.Point2XPercent = 0
     Background.Gradient2.Point2YPercent = 100
-    Background.Gradient2.Sinus = False
     Background.Gradient1EndPercent = 35
     Background.Style = bbsColor
-    ButtonBackground.Color = clBlack
-    ButtonBackground.ColorOpacity = 255
     ButtonBackground.Gradient1.StartColor = clBtnShadow
-    ButtonBackground.Gradient1.StartColorOpacity = 255
-    ButtonBackground.Gradient1.DrawMode = dmSet
     ButtonBackground.Gradient1.EndColor = clBtnFace
-    ButtonBackground.Gradient1.EndColorOpacity = 255
-    ButtonBackground.Gradient1.ColorCorrection = True
     ButtonBackground.Gradient1.GradientType = gtLinear
     ButtonBackground.Gradient1.Point1XPercent = 0
     ButtonBackground.Gradient1.Point1YPercent = -50
     ButtonBackground.Gradient1.Point2XPercent = 0
     ButtonBackground.Gradient1.Point2YPercent = 50
-    ButtonBackground.Gradient1.Sinus = False
     ButtonBackground.Gradient2.StartColor = clBtnFace
-    ButtonBackground.Gradient2.StartColorOpacity = 255
-    ButtonBackground.Gradient2.DrawMode = dmSet
     ButtonBackground.Gradient2.EndColor = clBtnShadow
-    ButtonBackground.Gradient2.EndColorOpacity = 255
-    ButtonBackground.Gradient2.ColorCorrection = True
     ButtonBackground.Gradient2.GradientType = gtLinear
     ButtonBackground.Gradient2.Point1XPercent = 0
     ButtonBackground.Gradient2.Point1YPercent = 50
     ButtonBackground.Gradient2.Point2XPercent = 0
     ButtonBackground.Gradient2.Point2YPercent = 150
-    ButtonBackground.Gradient2.Sinus = False
     ButtonBackground.Gradient1EndPercent = 50
     ButtonBackground.Style = bbsGradient
     ButtonDownBackground.Color = clBtnShadow
-    ButtonDownBackground.ColorOpacity = 255
     ButtonDownBackground.Gradient1.StartColor = clWhite
-    ButtonDownBackground.Gradient1.StartColorOpacity = 255
-    ButtonDownBackground.Gradient1.DrawMode = dmSet
     ButtonDownBackground.Gradient1.EndColor = clBlack
-    ButtonDownBackground.Gradient1.EndColorOpacity = 255
-    ButtonDownBackground.Gradient1.ColorCorrection = True
     ButtonDownBackground.Gradient1.GradientType = gtLinear
     ButtonDownBackground.Gradient1.Point1XPercent = 0
     ButtonDownBackground.Gradient1.Point1YPercent = 0
     ButtonDownBackground.Gradient1.Point2XPercent = 0
     ButtonDownBackground.Gradient1.Point2YPercent = 100
-    ButtonDownBackground.Gradient1.Sinus = False
     ButtonDownBackground.Gradient2.StartColor = clWhite
-    ButtonDownBackground.Gradient2.StartColorOpacity = 255
-    ButtonDownBackground.Gradient2.DrawMode = dmSet
     ButtonDownBackground.Gradient2.EndColor = clBlack
-    ButtonDownBackground.Gradient2.EndColorOpacity = 255
-    ButtonDownBackground.Gradient2.ColorCorrection = True
     ButtonDownBackground.Gradient2.GradientType = gtLinear
     ButtonDownBackground.Gradient2.Point1XPercent = 0
     ButtonDownBackground.Gradient2.Point1YPercent = 0
     ButtonDownBackground.Gradient2.Point2XPercent = 0
     ButtonDownBackground.Gradient2.Point2YPercent = 100
-    ButtonDownBackground.Gradient2.Sinus = False
     ButtonDownBackground.Gradient1EndPercent = 35
     ButtonDownBackground.Style = bbsColor
     Border.Color = clWindowText
-    Border.ColorOpacity = 255
-    Border.LightColor = clWhite
-    Border.LightOpacity = 255
-    Border.LightWidth = 0
     Border.Style = bboSolid
-    Border.Width = 1
     Rounding.RoundX = 1
     Rounding.RoundY = 1
-    Rounding.RoundOptions = []
     Font.Color = clWindowText
     Font.Name = 'Arial'
     HasTrackBar = True
@@ -145,4 +115,317 @@ object Form1: TForm1
     TabStop = True
     UseDockManager = False
   end
+  object BGRASpeedButton1: TBGRASpeedButton
+    Left = 8
+    Height = 22
+    Top = 192
+    Width = 64
+    Caption = 'Marquee'
+    OnClick = BGRASpeedButton1Click
+  end
+  object BGRAMaxMProgress: TBGRAFlashProgressBar
+    Left = 8
+    Height = 33
+    Top = 152
+    Width = 307
+    MinValue = 0
+    MaxValue = 100
+    Value = 30
+    Color = 14852966
+    BarColor = 14852966
+    BackgroundColor = 3092271
+    BackgroundRandomizeMinIntensity = 4000
+    BackgroundRandomizeMaxIntensity = 5000
+    BackgroundRandomize = True
+  end
+  object BGRASpeedButton2: TBGRASpeedButton
+    Left = 8
+    Height = 22
+    Top = 216
+    Width = 80
+    Caption = 'Right / Left'
+    OnClick = BGRASpeedButton2Click
+  end
+  object rgMarqueeSpeed: TRadioGroup
+    Left = 88
+    Height = 65
+    Top = 192
+    Width = 79
+    AutoFill = True
+    Caption = 'Speed'
+    ChildSizing.LeftRightSpacing = 6
+    ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
+    ChildSizing.EnlargeVertical = crsHomogenousChildResize
+    ChildSizing.ShrinkHorizontal = crsScaleChilds
+    ChildSizing.ShrinkVertical = crsScaleChilds
+    ChildSizing.Layout = cclLeftToRightThenTopToBottom
+    ChildSizing.ControlsPerLine = 1
+    ClientHeight = 45
+    ClientWidth = 75
+    ItemIndex = 1
+    Items.Strings = (
+      'Slow'
+      'Medium'
+      'Fast'
+    )
+    TabOrder = 1
+    OnClick = rgMarqueeSpeedClick
+  end
+  object edMarqueeWidth: TBCTrackbarUpdown
+    Left = 13
+    Height = 26
+    Top = 256
+    Width = 75
+    AllowNegativeValues = False
+    BarExponent = 1
+    Increment = 1
+    LongTimeInterval = 400
+    MinValue = 30
+    MaxValue = 100
+    OnChange = edMarqueeWidthChange
+    Value = 30
+    ShortTimeInterval = 100
+    Background.Color = clWindow
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    ButtonBackground.Gradient1.StartColor = clBtnShadow
+    ButtonBackground.Gradient1.EndColor = clBtnFace
+    ButtonBackground.Gradient1.GradientType = gtLinear
+    ButtonBackground.Gradient1.Point1XPercent = 0
+    ButtonBackground.Gradient1.Point1YPercent = -50
+    ButtonBackground.Gradient1.Point2XPercent = 0
+    ButtonBackground.Gradient1.Point2YPercent = 50
+    ButtonBackground.Gradient2.StartColor = clBtnFace
+    ButtonBackground.Gradient2.EndColor = clBtnShadow
+    ButtonBackground.Gradient2.GradientType = gtLinear
+    ButtonBackground.Gradient2.Point1XPercent = 0
+    ButtonBackground.Gradient2.Point1YPercent = 50
+    ButtonBackground.Gradient2.Point2XPercent = 0
+    ButtonBackground.Gradient2.Point2YPercent = 150
+    ButtonBackground.Gradient1EndPercent = 50
+    ButtonBackground.Style = bbsGradient
+    ButtonDownBackground.Color = clBtnShadow
+    ButtonDownBackground.Gradient1.StartColor = clWhite
+    ButtonDownBackground.Gradient1.EndColor = clBlack
+    ButtonDownBackground.Gradient1.GradientType = gtLinear
+    ButtonDownBackground.Gradient1.Point1XPercent = 0
+    ButtonDownBackground.Gradient1.Point1YPercent = 0
+    ButtonDownBackground.Gradient1.Point2XPercent = 0
+    ButtonDownBackground.Gradient1.Point2YPercent = 100
+    ButtonDownBackground.Gradient2.StartColor = clWhite
+    ButtonDownBackground.Gradient2.EndColor = clBlack
+    ButtonDownBackground.Gradient2.GradientType = gtLinear
+    ButtonDownBackground.Gradient2.Point1XPercent = 0
+    ButtonDownBackground.Gradient2.Point1YPercent = 0
+    ButtonDownBackground.Gradient2.Point2XPercent = 0
+    ButtonDownBackground.Gradient2.Point2YPercent = 100
+    ButtonDownBackground.Gradient1EndPercent = 35
+    ButtonDownBackground.Style = bbsColor
+    Border.Color = clWindowText
+    Border.Style = bboSolid
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Font.Color = clWindowText
+    Font.Name = 'Arial'
+    HasTrackBar = True
+    ArrowColor = clBtnText
+    TabOrder = 2
+    TabStop = True
+    UseDockManager = False
+  end
+  object Label1: TLabel
+    Left = 9
+    Height = 15
+    Top = 241
+    Width = 38
+    Caption = 'Width :'
+  end
+  object BGRASpeedButton3: TBGRASpeedButton
+    Left = 193
+    Height = 22
+    Top = 192
+    Width = 79
+    Caption = 'MultiProgress'
+    OnClick = BGRASpeedButton3Click
+  end
+  object edMultiPValue: TBCTrackbarUpdown
+    Left = 248
+    Height = 26
+    Top = 216
+    Width = 72
+    AllowNegativeValues = False
+    BarExponent = 1
+    Increment = 1
+    LongTimeInterval = 400
+    MinValue = 0
+    MaxValue = 100
+    OnChange = edMultiPValueChange
+    Value = 30
+    ShortTimeInterval = 100
+    Background.Color = clWindow
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    ButtonBackground.Gradient1.StartColor = clBtnShadow
+    ButtonBackground.Gradient1.EndColor = clBtnFace
+    ButtonBackground.Gradient1.GradientType = gtLinear
+    ButtonBackground.Gradient1.Point1XPercent = 0
+    ButtonBackground.Gradient1.Point1YPercent = -50
+    ButtonBackground.Gradient1.Point2XPercent = 0
+    ButtonBackground.Gradient1.Point2YPercent = 50
+    ButtonBackground.Gradient2.StartColor = clBtnFace
+    ButtonBackground.Gradient2.EndColor = clBtnShadow
+    ButtonBackground.Gradient2.GradientType = gtLinear
+    ButtonBackground.Gradient2.Point1XPercent = 0
+    ButtonBackground.Gradient2.Point1YPercent = 50
+    ButtonBackground.Gradient2.Point2XPercent = 0
+    ButtonBackground.Gradient2.Point2YPercent = 150
+    ButtonBackground.Gradient1EndPercent = 50
+    ButtonBackground.Style = bbsGradient
+    ButtonDownBackground.Color = clBtnShadow
+    ButtonDownBackground.Gradient1.StartColor = clWhite
+    ButtonDownBackground.Gradient1.EndColor = clBlack
+    ButtonDownBackground.Gradient1.GradientType = gtLinear
+    ButtonDownBackground.Gradient1.Point1XPercent = 0
+    ButtonDownBackground.Gradient1.Point1YPercent = 0
+    ButtonDownBackground.Gradient1.Point2XPercent = 0
+    ButtonDownBackground.Gradient1.Point2YPercent = 100
+    ButtonDownBackground.Gradient2.StartColor = clWhite
+    ButtonDownBackground.Gradient2.EndColor = clBlack
+    ButtonDownBackground.Gradient2.GradientType = gtLinear
+    ButtonDownBackground.Gradient2.Point1XPercent = 0
+    ButtonDownBackground.Gradient2.Point1YPercent = 0
+    ButtonDownBackground.Gradient2.Point2XPercent = 0
+    ButtonDownBackground.Gradient2.Point2YPercent = 100
+    ButtonDownBackground.Gradient1EndPercent = 35
+    ButtonDownBackground.Style = bbsColor
+    Border.Color = clWindowText
+    Border.Style = bboSolid
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Font.Color = clWindowText
+    Font.Name = 'Arial'
+    HasTrackBar = True
+    ArrowColor = clBtnText
+    TabOrder = 3
+    TabStop = True
+    UseDockManager = False
+  end
+  object Label2: TLabel
+    Left = 199
+    Height = 15
+    Top = 223
+    Width = 34
+    Caption = 'Value :'
+  end
+  object Label3: TLabel
+    Left = 199
+    Height = 15
+    Top = 251
+    Width = 48
+    Caption = 'Value M :'
+  end
+  object edMultiPValueM: TBCTrackbarUpdown
+    Left = 248
+    Height = 26
+    Top = 244
+    Width = 72
+    AllowNegativeValues = False
+    BarExponent = 1
+    Increment = 1
+    LongTimeInterval = 400
+    MinValue = 0
+    MaxValue = 100
+    OnChange = edMultiPValueMChange
+    Value = 10
+    ShortTimeInterval = 100
+    Background.Color = clWindow
+    Background.Gradient1.StartColor = clWhite
+    Background.Gradient1.EndColor = clBlack
+    Background.Gradient1.GradientType = gtLinear
+    Background.Gradient1.Point1XPercent = 0
+    Background.Gradient1.Point1YPercent = 0
+    Background.Gradient1.Point2XPercent = 0
+    Background.Gradient1.Point2YPercent = 100
+    Background.Gradient2.StartColor = clWhite
+    Background.Gradient2.EndColor = clBlack
+    Background.Gradient2.GradientType = gtLinear
+    Background.Gradient2.Point1XPercent = 0
+    Background.Gradient2.Point1YPercent = 0
+    Background.Gradient2.Point2XPercent = 0
+    Background.Gradient2.Point2YPercent = 100
+    Background.Gradient1EndPercent = 35
+    Background.Style = bbsColor
+    ButtonBackground.Gradient1.StartColor = clBtnShadow
+    ButtonBackground.Gradient1.EndColor = clBtnFace
+    ButtonBackground.Gradient1.GradientType = gtLinear
+    ButtonBackground.Gradient1.Point1XPercent = 0
+    ButtonBackground.Gradient1.Point1YPercent = -50
+    ButtonBackground.Gradient1.Point2XPercent = 0
+    ButtonBackground.Gradient1.Point2YPercent = 50
+    ButtonBackground.Gradient2.StartColor = clBtnFace
+    ButtonBackground.Gradient2.EndColor = clBtnShadow
+    ButtonBackground.Gradient2.GradientType = gtLinear
+    ButtonBackground.Gradient2.Point1XPercent = 0
+    ButtonBackground.Gradient2.Point1YPercent = 50
+    ButtonBackground.Gradient2.Point2XPercent = 0
+    ButtonBackground.Gradient2.Point2YPercent = 150
+    ButtonBackground.Gradient1EndPercent = 50
+    ButtonBackground.Style = bbsGradient
+    ButtonDownBackground.Color = clBtnShadow
+    ButtonDownBackground.Gradient1.StartColor = clWhite
+    ButtonDownBackground.Gradient1.EndColor = clBlack
+    ButtonDownBackground.Gradient1.GradientType = gtLinear
+    ButtonDownBackground.Gradient1.Point1XPercent = 0
+    ButtonDownBackground.Gradient1.Point1YPercent = 0
+    ButtonDownBackground.Gradient1.Point2XPercent = 0
+    ButtonDownBackground.Gradient1.Point2YPercent = 100
+    ButtonDownBackground.Gradient2.StartColor = clWhite
+    ButtonDownBackground.Gradient2.EndColor = clBlack
+    ButtonDownBackground.Gradient2.GradientType = gtLinear
+    ButtonDownBackground.Gradient2.Point1XPercent = 0
+    ButtonDownBackground.Gradient2.Point1YPercent = 0
+    ButtonDownBackground.Gradient2.Point2XPercent = 0
+    ButtonDownBackground.Gradient2.Point2YPercent = 100
+    ButtonDownBackground.Gradient1EndPercent = 35
+    ButtonDownBackground.Style = bbsColor
+    Border.Color = clWindowText
+    Border.Style = bboSolid
+    Rounding.RoundX = 1
+    Rounding.RoundY = 1
+    Font.Color = clWindowText
+    Font.Name = 'Arial'
+    HasTrackBar = True
+    ArrowColor = clBtnText
+    TabOrder = 4
+    TabStop = True
+    UseDockManager = False
+  end
 end

+ 62 - 2
test/test_progressbar/umain.pas

@@ -5,8 +5,9 @@ unit umain;
 interface
 
 uses
-  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
-  BGRAFlashProgressBar, BCTrackbarUpdown, BGRABitmap, BGRABitmapTypes;
+  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, ExtCtrls, StdCtrls,
+  BGRAFlashProgressBar, BCTrackbarUpdown, BGRASpeedButton, BGRABitmap, BGRABitmapTypes,
+  BGRADrawerFlashProgressBar;
 
 type
 
@@ -14,14 +15,32 @@ type
 
   TForm1 = class(TForm)
     BCTrackbarUpdown1: TBCTrackbarUpdown;
+    BGRASpeedButton3: TBGRASpeedButton;
+    edMarqueeWidth: TBCTrackbarUpdown;
     BGRAFlashProgressBar1: TBGRAFlashProgressBar;
     BGRAFlashProgressBar2: TBGRAFlashProgressBar;
+    BGRAMaxMProgress: TBGRAFlashProgressBar;
+    BGRASpeedButton1: TBGRASpeedButton;
+    BGRASpeedButton2: TBGRASpeedButton;
+    edMultiPValue: TBCTrackbarUpdown;
+    edMultiPValueM: TBCTrackbarUpdown;
+    Label1: TLabel;
+    Label2: TLabel;
+    Label3: TLabel;
+    rgMarqueeSpeed: TRadioGroup;
     procedure BCTrackbarUpdown1Change(Sender: TObject; AByUser: boolean);
     procedure BGRAFlashProgressBar1Redraw(Sender: TObject; Bitmap: TBGRABitmap;
       xpos: integer);
     procedure BGRAFlashProgressBar2Click(Sender: TObject);
     procedure BGRAFlashProgressBar2Redraw(Sender: TObject; Bitmap: TBGRABitmap;
       xpos: integer);
+    procedure BGRASpeedButton1Click(Sender: TObject);
+    procedure BGRASpeedButton2Click(Sender: TObject);
+    procedure BGRASpeedButton3Click(Sender: TObject);
+    procedure edMultiPValueMChange(Sender: TObject; AByUser: boolean);
+    procedure edMultiPValueChange(Sender: TObject; AByUser: boolean);
+    procedure edMarqueeWidthChange(Sender: TObject; AByUser: boolean);
+    procedure rgMarqueeSpeedClick(Sender: TObject);
   private
     { private declarations }
   public
@@ -48,6 +67,47 @@ begin
   Bitmap.Rectangle(1, 1, xpos + 1, Bitmap.Height - 1, BGRAWhite, BGRABlack, dmSet);
 end;
 
+procedure TForm1.BGRASpeedButton1Click(Sender: TObject);
+begin
+  BGRAMaxMProgress.Style:= pbstMarquee;
+end;
+
+procedure TForm1.BGRASpeedButton2Click(Sender: TObject);
+begin
+  if (BGRAMaxMProgress.MarqueeMode = pbmmToRight)
+  then BGRAMaxMProgress.MarqueeMode:= pbmmToLeft
+  else BGRAMaxMProgress.MarqueeMode:= pbmmToRight;
+end;
+
+procedure TForm1.BGRASpeedButton3Click(Sender: TObject);
+begin
+  BGRAMaxMProgress.Style:= pbstMultiProgress;
+end;
+
+procedure TForm1.edMultiPValueMChange(Sender: TObject; AByUser: boolean);
+begin
+  if AByUser then
+  begin
+    BGRAMaxMProgress.ValueM:= edMultiPValueM.Value;
+    edMultiPValueM.Value:= BGRAMaxMProgress.ValueM;
+  end;
+end;
+
+procedure TForm1.edMultiPValueChange(Sender: TObject; AByUser: boolean);
+begin
+  BGRAMaxMProgress.Value:= edMultiPValue.Value;
+end;
+
+procedure TForm1.edMarqueeWidthChange(Sender: TObject; AByUser: boolean);
+begin
+  BGRAMaxMProgress.MarqueeWidth:= edMarqueeWidth.Value;
+end;
+
+procedure TForm1.rgMarqueeSpeedClick(Sender: TObject);
+begin
+  BGRAMaxMProgress.MarqueeSpeed:= TBGRAPBarMarqueeSpeed(rgMarqueeSpeed.ItemIndex);
+end;
+
 procedure TForm1.BCTrackbarUpdown1Change(Sender: TObject; AByUser: boolean);
 begin
   BGRAFlashProgressBar1.Value := BCTrackbarUpdown1.Value;