Browse Source

Added bcfluentprogressring by hedgehog

Leandro Diaz 7 months ago
parent
commit
49ab324e28

+ 252 - 0
bcfluentprogressring.pas

@@ -0,0 +1,252 @@
+{
+ 2024 by hedgehog
+}
+
+unit BCFluentProgressRing;
+
+{$mode ObjFPC}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Controls, Graphics, ExtCtrls,
+  BGRAGraphicControl, BGRABitmapTypes;
+
+type
+
+  { TBCFluentProgressRing }
+
+  TBCFluentProgressRing = class(TBGRAGraphicControl)
+  private
+    FPeriod: Int64;
+    FIndeterminate: boolean;
+    FStartTickCount: QWord;
+    FAnimationTime: Int64;
+    FTimer: TTimer;
+    FMaxValue: integer;
+    FMinValue: integer;
+    FValue: integer;
+    FLineColor: TColor;
+    FLineBkgColor: TColor;
+    FLineWidth: integer;
+
+    procedure SetIndeterminate(AValue: boolean);
+    procedure SetLineBkgColor(AValue: TColor);
+    procedure SetLineColor(AValue: TColor);
+    procedure SetMaxValue(AValue: integer);
+    procedure SetMinValue(AValue: integer);
+    procedure SetValue(AValue: integer);
+    procedure SetLineWidth(AValue: integer);
+  protected
+    procedure SetEnabled(Value: Boolean); override;
+    procedure SetVisible(Value: Boolean); override;
+    procedure RedrawBitmapContent; override;
+
+    procedure TimerEvent({%H-}Sender: TObject);
+    procedure TimerStart({%H-}Sender: TObject);
+  public
+    constructor Create(AOwner: TComponent); override;
+  published
+    property MinValue: integer read FMinValue write SetMinValue default 0;
+    property MaxValue: integer read FMaxValue write SetMaxValue default 100;
+    property Value: integer read FValue write SetValue default 0;
+    property LineColor: TColor read FLineColor write SetLineColor default
+      TColor($009E5A00);
+    property LineBkgColor: TColor read FLineBkgColor write SetLineBkgColor default
+      TColor($00D3D3D3);
+    property LineWidth: integer read FLineWidth write SetLineWidth default 0;
+    property Indeterminate: boolean read FIndeterminate write SetIndeterminate default false;
+  end;
+
+procedure Register;
+
+implementation
+
+procedure Register;
+begin
+  RegisterComponents('BGRA Controls', [TBCFluentProgressRing]);
+end;
+
+{ TBCFluentProgressRing }
+
+procedure TBCFluentProgressRing.SetMaxValue(AValue: integer);
+begin
+  if FMaxValue = AValue then
+    exit;
+  FMaxValue := AValue;
+  if FValue > FMaxValue then
+    FValue := FMaxValue;
+  if FMinValue > FMaxValue then
+    FMinValue := FMaxValue;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetLineBkgColor(AValue: TColor);
+begin
+  if FLineBkgColor = AValue then
+    Exit;
+  FLineBkgColor := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetIndeterminate(AValue: boolean);
+begin
+  if FIndeterminate=AValue then Exit;
+  FIndeterminate:=AValue;
+  if Enabled and Visible then
+  begin
+    FTimer.Enabled:= FIndeterminate;
+    DiscardBitmap;
+  end;
+end;
+
+procedure TBCFluentProgressRing.SetLineColor(AValue: TColor);
+begin
+  if FLineColor = AValue then
+    Exit;
+  FLineColor := AValue;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetMinValue(AValue: integer);
+begin
+  if FMinValue = AValue then
+    exit;
+  FMinValue := AValue;
+  if FValue < FMinValue then
+    FValue := FMinValue;
+  if FMaxValue < FMinValue then
+    FMaxValue := FMinValue;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetValue(AValue: integer);
+begin
+  if FValue = AValue then
+    exit;
+  FValue := AValue;
+  if FValue < FMinValue then
+    FValue := FMinValue;
+  if FValue > FMaxValue then
+    FValue := FMaxValue;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetLineWidth(AValue: integer);
+begin
+  if FLineWidth = AValue then exit;
+  FLineWidth := AValue;
+  if Visible then DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetEnabled(Value: Boolean);
+begin
+  inherited SetEnabled(Value);
+  FTimer.Enabled := Value and Visible and FIndeterminate;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.SetVisible(Value: Boolean);
+begin
+  inherited SetVisible(Value);
+  FTimer.Enabled := Enabled and Value and FIndeterminate;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.RedrawBitmapContent;
+const
+  pi2= 2*pi;
+  pi15 = pi*1.5;
+var
+  EffectiveSize: integer;
+  EffectiveLineWidth: single;
+  a, da, r: single;
+
+  procedure DoDrawArc(a, b: single; c: TColor);
+  begin
+    Bitmap.Canvas2D.strokeStyle(c);
+    Bitmap.Canvas2D.beginPath;
+    Bitmap.Canvas2D.arc(0, 0, r, a, b, false);
+    Bitmap.Canvas2D.stroke;
+  end;
+
+begin
+  if Width< Height then
+    EffectiveSize:= Width
+  else
+    EffectiveSize:= Height;
+
+  if EffectiveSize<2 then exit;
+
+
+  Bitmap.Canvas2D.resetTransform;
+  Bitmap.Canvas2D.translate(Bitmap.Width/2, Bitmap.Height/2);
+  Bitmap.Canvas2D.rotate(pi15);
+
+
+  if FLineWidth=0 then
+    EffectiveLineWidth:=EffectiveSize / 12
+  else
+    EffectiveLineWidth:= FLineWidth;
+  r:= (EffectiveSize -EffectiveLineWidth)/2;
+
+   Bitmap.Canvas2D.lineWidth:= EffectiveLineWidth;
+  // background line
+  if (FValue < FMaxValue) and (FLineBkgColor<>clNone) then
+    DoDrawArc(0, pi2, FLineBkgColor);
+  Bitmap.Canvas2D.lineCapLCL:= pecRound;
+
+  if FIndeterminate and FTimer.Enabled then
+  begin
+    a:= 3*FAnimationTime*pi2/FPeriod - pi;
+    da:= 2*abs(1 - 2*FAnimationTime/FPeriod);
+    if da>0.005 then
+      DoDrawArc(a-da, a+da, FLineColor);
+  end
+  else if FValue > FMinValue then
+  begin
+    if Enabled then
+      DoDrawArc(0, pi2 * FValue / FMaxValue, FLineColor)
+    else
+      DoDrawArc(0, pi2 * FValue / FMaxValue, clGray);
+  end;
+end;
+
+procedure TBCFluentProgressRing.TimerEvent(Sender: TObject);
+var
+  TickCount: QWord;
+begin
+  TickCount:= GetTickCount64;
+  FAnimationTime:= (TickCount - FStartTickCount) mod FPeriod;
+  DiscardBitmap;
+end;
+
+procedure TBCFluentProgressRing.TimerStart(Sender: TObject);
+begin
+  FStartTickCount:= GetTickCount64;
+  FAnimationTime:=0;
+end;
+
+constructor TBCFluentProgressRing.Create(AOwner: TComponent);
+begin
+  inherited Create(AOwner);
+  FPeriod:= 2400;
+  FTimer:= TTimer.Create(self);
+  FTimer.Interval := 15;
+  FTimer.Enabled := false;
+  FTimer.OnTimer := @TimerEvent;
+  FTimer.OnStartTimer:= @TimerStart;
+
+  with GetControlClassDefaultSize do
+    SetInitialBounds(0, 0, 100, 100);
+  FMaxValue := 100;
+  FMinValue := 0;
+  FValue := 0;
+  FLineWidth:=0;
+  FLineColor := TColor($009E5A00);
+  FLineBkgColor := TColor($00D3D3D3);
+end;
+
+
+end.
+

+ 119 - 114
bgracontrols.lpk

@@ -34,7 +34,7 @@
     <Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
     <License Value="Modified LGPL"/>
     <Version Major="8"/>
-    <Files Count="67">
+    <Files Count="68">
       <Item1>
         <Filename Value="atshapelinebgra.pas"/>
         <HasRegisterProc Value="True"/>
@@ -84,281 +84,286 @@
         <UnitName Value="bcfilters"/>
       </Item10>
       <Item11>
-        <Filename Value="bcgamegrid.pas"/>
+        <Filename Value="bcfluentprogressring.pas"/>
         <HasRegisterProc Value="True"/>
-        <UnitName Value="BCGameGrid"/>
+        <UnitName Value="BCFluentProgressRing"/>
       </Item11>
       <Item12>
-        <Filename Value="bcgradientbutton.pas"/>
+        <Filename Value="bcgamegrid.pas"/>
         <HasRegisterProc Value="True"/>
-        <UnitName Value="BCGradientButton"/>
+        <UnitName Value="BCGameGrid"/>
       </Item12>
       <Item13>
-        <Filename Value="bcimagebutton.pas"/>
+        <Filename Value="bcgradientbutton.pas"/>
         <HasRegisterProc Value="True"/>
-        <UnitName Value="BCImageButton"/>
+        <UnitName Value="BCGradientButton"/>
       </Item13>
       <Item14>
+        <Filename Value="bcimagebutton.pas"/>
+        <HasRegisterProc Value="True"/>
+        <UnitName Value="BCImageButton"/>
+      </Item14>
+      <Item15>
         <Filename Value="bckeyboard.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCKeyboard"/>
-      </Item14>
-      <Item15>
+      </Item15>
+      <Item16>
         <Filename Value="bclabel.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCLabel"/>
-      </Item15>
-      <Item16>
-        <Filename Value="bclistbox.pas"/>
-        <UnitName Value="BCListBox"/>
       </Item16>
       <Item17>
-        <Filename Value="bclistboxex.pas"/>
-        <UnitName Value="BCListBoxEx"/>
+        <Filename Value="bclistbox.pas"/>
+        <UnitName Value="BCListBox"/>
       </Item17>
       <Item18>
+        <Filename Value="bclistboxex.pas"/>
+        <UnitName Value="BCListBoxEx"/>
+      </Item18>
+      <Item19>
         <Filename Value="bcmaterialdesignbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialDesignButton"/>
-      </Item18>
-      <Item19>
+      </Item19>
+      <Item20>
         <Filename Value="bcmaterialedit.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialEdit"/>
-      </Item19>
-      <Item20>
+      </Item20>
+      <Item21>
         <Filename Value="bcmaterialfloatspinedit.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialFloatSpinEdit"/>
-      </Item20>
-      <Item21>
+      </Item21>
+      <Item22>
         <Filename Value="bcmaterialprogressbarmarquee.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialProgressBarMarquee"/>
-      </Item21>
-      <Item22>
+      </Item22>
+      <Item23>
         <Filename Value="bcmaterialspinedit.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMaterialSpinEdit"/>
-      </Item22>
-      <Item23>
+      </Item23>
+      <Item24>
         <Filename Value="bcmdbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMDButton"/>
-      </Item23>
-      <Item24>
+      </Item24>
+      <Item25>
         <Filename Value="bcmdbuttonfocus.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCMDButtonFocus"/>
-      </Item24>
-      <Item25>
+      </Item25>
+      <Item26>
         <Filename Value="bcnumerickeyboard.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCNumericKeyboard"/>
-      </Item25>
-      <Item26>
+      </Item26>
+      <Item27>
         <Filename Value="bcpanel.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCPanel"/>
-      </Item26>
-      <Item27>
+      </Item27>
+      <Item28>
         <Filename Value="bcradialprogressbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCRadialProgressBar"/>
-      </Item27>
-      <Item28>
+      </Item28>
+      <Item29>
         <Filename Value="bcroundedimage.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCRoundedImage"/>
-      </Item28>
-      <Item29>
-        <Filename Value="bcrtti.pas"/>
-        <UnitName Value="BCRTTI"/>
       </Item29>
       <Item30>
-        <Filename Value="bcsamples.pas"/>
-        <UnitName Value="BCSamples"/>
+        <Filename Value="bcrtti.pas"/>
+        <UnitName Value="BCRTTI"/>
       </Item30>
       <Item31>
-        <Filename Value="bcstylesform.pas"/>
-        <UnitName Value="BCStylesForm"/>
+        <Filename Value="bcsamples.pas"/>
+        <UnitName Value="BCSamples"/>
       </Item31>
       <Item32>
+        <Filename Value="bcstylesform.pas"/>
+        <UnitName Value="BCStylesForm"/>
+      </Item32>
+      <Item33>
         <Filename Value="bcsvgbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCSVGButton"/>
-      </Item32>
-      <Item33>
+      </Item33>
+      <Item34>
         <Filename Value="bcsvgviewer.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCSVGViewer"/>
-      </Item33>
-      <Item34>
+      </Item34>
+      <Item35>
         <Filename Value="bcthememanager.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCThemeManager"/>
-      </Item34>
-      <Item35>
+      </Item35>
+      <Item36>
         <Filename Value="bctoolbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCToolBar"/>
-      </Item35>
-      <Item36>
+      </Item36>
+      <Item37>
         <Filename Value="bctools.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCTools"/>
-      </Item36>
-      <Item37>
+      </Item37>
+      <Item38>
         <Filename Value="bctrackbarupdown.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BCTrackbarUpdown"/>
-      </Item37>
-      <Item38>
+      </Item38>
+      <Item39>
         <Filename Value="bctypes.pas"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BCTypes"/>
-      </Item38>
-      <Item39>
+      </Item39>
+      <Item40>
         <Filename Value="bgracolortheme.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAColorTheme"/>
-      </Item39>
-      <Item40>
-        <Filename Value="bgracontrolsinfo.pas"/>
-        <UnitName Value="bgracontrolsinfo"/>
       </Item40>
       <Item41>
-        <Filename Value="bgracustomdrawn.pas"/>
-        <UnitName Value="BGRACustomDrawn"/>
+        <Filename Value="bgracontrolsinfo.pas"/>
+        <UnitName Value="bgracontrolsinfo"/>
       </Item41>
       <Item42>
-        <Filename Value="bgradrawerflashprogressbar.pas"/>
-        <UnitName Value="BGRADrawerFlashProgressBar"/>
+        <Filename Value="bgracustomdrawn.pas"/>
+        <UnitName Value="BGRACustomDrawn"/>
       </Item42>
       <Item43>
+        <Filename Value="bgradrawerflashprogressbar.pas"/>
+        <UnitName Value="BGRADrawerFlashProgressBar"/>
+      </Item43>
+      <Item44>
         <Filename Value="bgraflashprogressbar.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAFlashProgressBar"/>
-      </Item43>
-      <Item44>
+      </Item44>
+      <Item45>
         <Filename Value="bgragraphiccontrol.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAGraphicControl"/>
-      </Item44>
-      <Item45>
+      </Item45>
+      <Item46>
         <Filename Value="bgraimagelist.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAImageList"/>
-      </Item45>
-      <Item46>
+      </Item46>
+      <Item47>
         <Filename Value="bgraimagemanipulation.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAImageManipulation"/>
-      </Item46>
-      <Item47>
+      </Item47>
+      <Item48>
         <Filename Value="bgraimagetheme.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAImageTheme"/>
-      </Item47>
-      <Item48>
+      </Item48>
+      <Item49>
         <Filename Value="bgraknob.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAKnob"/>
-      </Item48>
-      <Item49>
+      </Item49>
+      <Item50>
         <Filename Value="bgraresizespeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAResizeSpeedButton"/>
-      </Item49>
-      <Item50>
+      </Item50>
+      <Item51>
         <Filename Value="bgrashape.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAShape"/>
-      </Item50>
-      <Item51>
+      </Item51>
+      <Item52>
         <Filename Value="bgraspeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpeedButton"/>
-      </Item51>
-      <Item52>
+      </Item52>
+      <Item53>
         <Filename Value="bgraspriteanimation.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASpriteAnimation"/>
-      </Item52>
-      <Item53>
+      </Item53>
+      <Item54>
         <Filename Value="bgrasvgimagelist.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASVGImageList"/>
-      </Item53>
-      <Item54>
+      </Item54>
+      <Item55>
         <Filename Value="bgrasvgtheme.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRASVGTheme"/>
-      </Item54>
-      <Item55>
+      </Item55>
+      <Item56>
         <Filename Value="bgratheme.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRATheme"/>
-      </Item55>
-      <Item56>
+      </Item56>
+      <Item57>
         <Filename Value="bgrathemebutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAThemeButton"/>
-      </Item56>
-      <Item57>
+      </Item57>
+      <Item58>
         <Filename Value="bgrathemecheckbox.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAThemeCheckBox"/>
-      </Item57>
-      <Item58>
+      </Item58>
+      <Item59>
         <Filename Value="bgrathemeradiobutton.pas"/>
         <HasRegisterProc Value="True"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="BGRAThemeRadioButton"/>
-      </Item58>
-      <Item59>
+      </Item59>
+      <Item60>
         <Filename Value="bgravirtualscreen.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="BGRAVirtualScreen"/>
-      </Item59>
-      <Item60>
+      </Item60>
+      <Item61>
         <Filename Value="colorspeedbutton.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="ColorSpeedButton"/>
-      </Item60>
-      <Item61>
+      </Item61>
+      <Item62>
         <Filename Value="dtanalogclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="DTAnalogClock"/>
-      </Item61>
-      <Item62>
-        <Filename Value="dtanalogcommon.pas"/>
-        <UnitName Value="DTAnalogCommon"/>
       </Item62>
       <Item63>
+        <Filename Value="dtanalogcommon.pas"/>
+        <UnitName Value="DTAnalogCommon"/>
+      </Item63>
+      <Item64>
         <Filename Value="dtanaloggauge.pas"/>
         <HasRegisterProc Value="True"/>
         <AddToUsesPkgSection Value="False"/>
         <UnitName Value="DTAnalogGauge"/>
-      </Item63>
-      <Item64>
+      </Item64>
+      <Item65>
         <Filename Value="dtthemedclock.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedclock"/>
-      </Item64>
-      <Item65>
+      </Item65>
+      <Item66>
         <Filename Value="dtthemedgauge.pas"/>
         <HasRegisterProc Value="True"/>
         <UnitName Value="dtthemedgauge"/>
-      </Item65>
-      <Item66>
-        <Filename Value="materialcolors.pas"/>
-        <UnitName Value="MaterialColors"/>
       </Item66>
       <Item67>
+        <Filename Value="materialcolors.pas"/>
+        <UnitName Value="MaterialColors"/>
+      </Item67>
+      <Item68>
         <Filename Value="bgrasvgimagelistform/bgrasvgimagelistform.pas"/>
         <UnitName Value="bgrasvgimagelistform"/>
-      </Item67>
+      </Item68>
     </Files>
     <CompatibilityMode Value="True"/>
     <LazDoc Paths="fpdoc"/>

+ 15 - 14
bgracontrols.pas

@@ -9,20 +9,20 @@ interface
 
 uses
   atshapelinebgra, BCButton, BCButtonFocus, BCCheckComboBox, BCComboBox, 
-  BCEffect, bcfilters, BCGameGrid, BCGradientButton, BCImageButton, BCLabel, 
-  BCListBox, BCListBoxEx, BCMaterialDesignButton, BCMaterialEdit, 
-  BCMaterialFloatSpinEdit, BCMaterialProgressBarMarquee, BCMaterialSpinEdit, 
-  BCMDButton, BCMDButtonFocus, BCPanel, BCRadialProgressBar, BCRoundedImage, 
-  BCRTTI, BCSamples, BCStylesForm, BCSVGButton, BCSVGViewer, BCToolBar, 
-  BCTrackbarUpdown, BGRAColorTheme, bgracontrolsinfo, BGRACustomDrawn, 
-  BGRADrawerFlashProgressBar, BGRAFlashProgressBar, BGRAGraphicControl, 
-  BGRAImageList, BGRAImageManipulation, BGRAImageTheme, BGRAKnob, 
-  BGRAResizeSpeedButton, BGRAShape, BGRASpeedButton, BGRASpriteAnimation, 
-  BGRASVGImageList, BGRASVGTheme, BGRATheme, BGRAThemeButton, 
-  BGRAThemeCheckBox, BGRAThemeRadioButton, BGRAVirtualScreen, 
-  ColorSpeedButton, DTAnalogClock, DTAnalogCommon, DTAnalogGauge, 
-  dtthemedclock, dtthemedgauge, MaterialColors, bgrasvgimagelistform, 
-  LazarusPackageIntf;
+  BCEffect, bcfilters, BCFluentProgressRing, BCGameGrid, BCGradientButton, 
+  BCImageButton, BCLabel, BCListBox, BCListBoxEx, BCMaterialDesignButton, 
+  BCMaterialEdit, BCMaterialFloatSpinEdit, BCMaterialProgressBarMarquee, 
+  BCMaterialSpinEdit, BCMDButton, BCMDButtonFocus, BCPanel, 
+  BCRadialProgressBar, BCRoundedImage, BCRTTI, BCSamples, BCStylesForm, 
+  BCSVGButton, BCSVGViewer, BCToolBar, BCTrackbarUpdown, BGRAColorTheme, 
+  bgracontrolsinfo, BGRACustomDrawn, BGRADrawerFlashProgressBar, 
+  BGRAFlashProgressBar, BGRAGraphicControl, BGRAImageList, 
+  BGRAImageManipulation, BGRAImageTheme, BGRAKnob, BGRAResizeSpeedButton, 
+  BGRAShape, BGRASpeedButton, BGRASpriteAnimation, BGRASVGImageList, 
+  BGRASVGTheme, BGRATheme, BGRAThemeButton, BGRAThemeCheckBox, 
+  BGRAThemeRadioButton, BGRAVirtualScreen, ColorSpeedButton, DTAnalogClock, 
+  DTAnalogCommon, DTAnalogGauge, dtthemedclock, dtthemedgauge, MaterialColors, 
+  bgrasvgimagelistform, LazarusPackageIntf;
 
 implementation
 
@@ -33,6 +33,7 @@ begin
   RegisterUnit('BCButtonFocus', @BCButtonFocus.Register);
   RegisterUnit('BCCheckComboBox', @BCCheckComboBox.Register);
   RegisterUnit('BCComboBox', @BCComboBox.Register);
+  RegisterUnit('BCFluentProgressRing', @BCFluentProgressRing.Register);
   RegisterUnit('BCGameGrid', @BCGameGrid.Register);
   RegisterUnit('BCGradientButton', @BCGradientButton.Register);
   RegisterUnit('BCImageButton', @BCImageButton.Register);

+ 77 - 0
test/test_progress_ring/project1.lpi

@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<CONFIG>
+  <ProjectOptions>
+    <Version Value="12"/>
+    <PathDelim Value="\"/>
+    <General>
+      <SessionStorage Value="InProjectDir"/>
+      <Title Value="project1"/>
+      <Scaled Value="True"/>
+      <ResourceType Value="res"/>
+      <UseXPManifest Value="True"/>
+      <XPManifest>
+        <DpiAware Value="True"/>
+      </XPManifest>
+      <Icon Value="0"/>
+    </General>
+    <BuildModes>
+      <Item Name="Default" Default="True"/>
+    </BuildModes>
+    <PublishOptions>
+      <Version Value="2"/>
+      <DestinationDirectory Value="$(TestDir)/publishedproject/bcprogressring"/>
+      <OpenInFileMan Value="True"/>
+      <UseFileFilters Value="True"/>
+    </PublishOptions>
+    <RunParams>
+      <FormatVersion Value="2"/>
+    </RunParams>
+    <RequiredPackages>
+      <Item>
+        <PackageName Value="bgracontrols"/>
+      </Item>
+      <Item>
+        <PackageName Value="LCL"/>
+      </Item>
+    </RequiredPackages>
+    <Units>
+      <Unit>
+        <Filename Value="project1.lpr"/>
+        <IsPartOfProject Value="True"/>
+      </Unit>
+      <Unit>
+        <Filename Value="unit1.pas"/>
+        <IsPartOfProject Value="True"/>
+        <ComponentName Value="Form1"/>
+        <ResourceBaseClass Value="Form"/>
+        <UnitName Value="Unit1"/>
+      </Unit>
+      <Unit>
+        <Filename Value="bcfluentprogressring.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="BCFluentProgressRing"/>
+      </Unit>
+    </Units>
+  </ProjectOptions>
+  <CompilerOptions>
+    <Version Value="11"/>
+    <PathDelim Value="\"/>
+    <Target>
+      <Filename Value="project1"/>
+    </Target>
+    <SearchPaths>
+      <IncludeFiles Value="$(ProjOutDir)"/>
+      <UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
+    </SearchPaths>
+    <Linking>
+      <Debugging>
+        <DebugInfoType Value="dsDwarf2Set"/>
+      </Debugging>
+      <Options>
+        <Win32>
+          <GraphicApplication Value="True"/>
+        </Win32>
+      </Options>
+    </Linking>
+  </CompilerOptions>
+</CONFIG>

+ 25 - 0
test/test_progress_ring/project1.lpr

@@ -0,0 +1,25 @@
+program project1;
+
+{$mode objfpc}{$H+}
+
+uses
+  {$IFDEF UNIX}
+  cthreads,
+  {$ENDIF}
+  {$IFDEF HASAMIGA}
+  athreads,
+  {$ENDIF}
+  Interfaces, // this includes the LCL widgetset
+  Forms, Unit1, BCFluentProgressRing
+  { you can add units after this };
+
+{$R *.res}
+
+begin
+  RequireDerivedFormResource:=True;
+  Application.Scaled:=True;
+  Application.Initialize;
+  Application.CreateForm(TForm1, Form1);
+  Application.Run;
+end.
+

+ 42 - 0
test/test_progress_ring/unit1.lfm

@@ -0,0 +1,42 @@
+object Form1: TForm1
+  Left = 560
+  Height = 228
+  Top = 364
+  Width = 454
+  Caption = 'Form1'
+  ClientHeight = 228
+  ClientWidth = 454
+  DesignTimePPI = 120
+  OnCreate = FormCreate
+  LCLVersion = '2.2.6.0'
+  object CheckBox1: TCheckBox
+    Left = 216
+    Height = 24
+    Top = 48
+    Width = 117
+    Caption = 'Indeterminate'
+    OnChange = CheckBox1Change
+    TabOrder = 0
+  end
+  object TrackBar1: TTrackBar
+    Left = 208
+    Height = 31
+    Top = 8
+    Width = 237
+    Max = 100
+    OnChange = TrackBar1Change
+    Position = 75
+    TabOrder = 1
+  end
+  object CheckBox2: TCheckBox
+    Left = 216
+    Height = 24
+    Top = 84
+    Width = 78
+    Caption = 'Enabled'
+    Checked = True
+    OnChange = CheckBox2Change
+    State = cbChecked
+    TabOrder = 2
+  end
+end

+ 66 - 0
test/test_progress_ring/unit1.pas

@@ -0,0 +1,66 @@
+unit Unit1;
+
+{$mode objfpc}{$H+}
+
+interface
+
+uses
+  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
+  BCMaterialProgressBarMarquee, BCFluentProgressRing;
+
+type
+
+  { TForm1 }
+
+  TForm1 = class(TForm)
+    CheckBox1: TCheckBox;
+    CheckBox2: TCheckBox;
+    TrackBar1: TTrackBar;
+    procedure CheckBox1Change(Sender: TObject);
+    procedure CheckBox2Change(Sender: TObject);
+    procedure FormCreate(Sender: TObject);
+    procedure TrackBar1Change(Sender: TObject);
+  private
+    ring: TBCFluentProgressRing;
+  public
+
+  end;
+
+var
+  Form1: TForm1;
+
+implementation
+
+{$R *.lfm}
+
+{ TForm1 }
+
+procedure TForm1.FormCreate(Sender: TObject);
+begin
+  ring:= TBCFluentProgressRing.Create(self);
+  ring.Width:= 180;
+  ring.Height:= 180;
+  ring.Left:= 10;
+  ring.top:= 10;
+  ring.Value:= 75;
+  ring.Parent:= self;
+
+end;
+
+procedure TForm1.TrackBar1Change(Sender: TObject);
+begin
+  ring.Value:= TrackBar1.Position;
+end;
+
+procedure TForm1.CheckBox1Change(Sender: TObject);
+begin
+  ring.Indeterminate:= CheckBox1.Checked;
+end;
+
+procedure TForm1.CheckBox2Change(Sender: TObject);
+begin
+  ring.Enabled:= CheckBox2.Checked;
+end;
+
+end.
+