Skip to content

Commit b7b5e8f

Browse files
version 3.9.0
- Added UseAnimationLoop property to TStyledTaskDialog - Added UseAnimationInverse property to TStyledTaskDialog - Fixed Test TaskDialog with Animations at design-time
1 parent 9399027 commit b7b5e8f

10 files changed

+1142
-22
lines changed

Demos/Delphi13/StyledComponentsDemo.dproj

Lines changed: 1017 additions & 0 deletions
Large diffs are not rendered by default.

Demos/source/AnimatedButtonsForm.dfm

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,24 @@ object fmAnimatedButtons: TfmAnimatedButtons
732732
6D585DE7F7793BE217B8BD2551176BF3F6C7D3B7EFD375D5A77CBA1FFFFDFF01
733733
DA8C4CA1AC820200}
734734
end
735+
object LoopCheckBox: TCheckBox
736+
Left = 377
737+
Top = 16
738+
Width = 128
739+
Height = 17
740+
Caption = 'Animation in loop'
741+
TabOrder = 7
742+
OnClick = LoopCheckBoxClick
743+
end
744+
object InverseCheckBox: TCheckBox
745+
Left = 377
746+
Top = 39
747+
Width = 154
748+
Height = 17
749+
Caption = 'Animation inverse mode'
750+
TabOrder = 8
751+
OnClick = InverseCheckBoxClick
752+
end
735753
end
736754
object ActionList: TActionList
737755
Images = Images

Demos/source/AnimatedButtonsForm.pas

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ TfmAnimatedButtons = class(TForm)
2929
cbAnimateAlways: TCheckBox;
3030
cbAnimateOnMouseOver: TCheckBox;
3131
StyledAnimatedButton: TStyledAnimatedButton;
32+
LoopCheckBox: TCheckBox;
33+
InverseCheckBox: TCheckBox;
3234
procedure ButtonClick(Sender: TObject);
3335
procedure FormCreate(Sender: TObject);
3436
procedure VCLButtonKeyDown(Sender: TObject; var Key: Word;
@@ -37,6 +39,8 @@ TfmAnimatedButtons = class(TForm)
3739
procedure ImageAlignmentRadioGroupClick(Sender: TObject);
3840
procedure FormDestroy(Sender: TObject);
3941
procedure AutoAnimationClick(Sender: TObject);
42+
procedure LoopCheckBoxClick(Sender: TObject);
43+
procedure InverseCheckBoxClick(Sender: TObject);
4044
private
4145
FStyleNames: TStringList;
4246
function CreateNewButton(const AParent: TWinControl;
@@ -133,15 +137,9 @@ function TfmAnimatedButtons.CreateNewButton(const AParent: TWinControl; const AL
133137
Result.AutoSizeAnimationMargin := 20;
134138
Result.SetBounds(ALeft,ATop,220,80);
135139
Result.Parent := AParent;
136-
//Result.AnimationWidth := 42;
137-
//Result.AnimationHeight := 42;
138-
//Result.Images := VirtualImageList;
139-
//Result.ImageName := AImageName;
140-
//Result.ImageAlignment := TImageAlignment.iaTop;
141140
LFileName := Format(ExtractFilePath(Application.ExeName)+'..\..\..\..\Animations\%s.json', [LIconName]);
142-
LResName := UpperCase(Format('LOTTIE_%s',[LIconName]));
141+
LResName := UpperCase(Format('STYLEDTASKLOTTIE_%s',[AnsiUpperCase(LIconName)]));
143142
Result.LoadAnimationFromResource(LResName);
144-
//Result.LoadAnimationFromFile(LFileName);
145143
Result.Caption := AImageName;
146144
Result.StyleClass := AStyle;
147145
Result.AutoAnimationTypes := GetAnimTypes;
@@ -209,4 +207,22 @@ procedure TfmAnimatedButtons.ImageAlignmentRadioGroupClick(Sender: TObject);
209207
end);
210208
end;
211209

210+
procedure TfmAnimatedButtons.InverseCheckBoxClick(Sender: TObject);
211+
begin
212+
ProcessButtons(
213+
procedure (AButton: TStyledAnimatedButton)
214+
begin
215+
AButton.AnimationInverse := InverseCheckBox.Checked;
216+
end);
217+
end;
218+
219+
procedure TfmAnimatedButtons.LoopCheckBoxClick(Sender: TObject);
220+
begin
221+
ProcessButtons(
222+
procedure (AButton: TStyledAnimatedButton)
223+
begin
224+
AButton.AnimationLoop := LoopCheckBox.Checked;
225+
end);
226+
end;
227+
212228
end.

README.htm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
</style>
3232
<h1>Delphi VCL StyledComponents <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-yellowgreen.svg" alt="License"/></a></h1>
3333
<h2>Components similar to Delphi VCL Buttons, Toolbar, DbNavigator, BindNavigator, ButtonGroup and CategoryButtons with Custom Graphic Styles, and an advanced, full-customizable TaskDialog, also with animations!</h2>
34-
<h3>Actual official version: 3.8.6</h3>
34+
<h3>Actual official version: 3.9.0</h3>
3535
<hr />
3636
<h2>New Setup for Installation of Components</h2>
3737
<p>From 3.8.1 version a new &ldquo;Installer&rdquo; read-to-use is located in the Release area: <a href="https://github.com/EtheaDev/StyledComponents/releases/latest/download/StyledComponents_Setup.exe">Download the Installer</a>.</p>
@@ -344,6 +344,12 @@ <h3>Available from Delphi XE6 to Delphi 13 (32bit and 64bit platforms)</h3>
344344
<p><img src="./Images/SupportingDelphi.jpg" alt="Delphi Support"/></p>
345345
<p>Related links: <a href="https://www.embarcadero.com">embarcadero.com</a> - <a href="https://learndelphi.org">learndelphi.org</a></p>
346346
<h3>RELEASE NOTES</h3>
347+
<p>17 Oct 2025 - version 3.9.0</p>
348+
<ul>
349+
<li>Added UseAnimationLoop property to TStyledTaskDialog</li>
350+
<li>Added UseAnimationInverse property to TStyledTaskDialog</li>
351+
<li>Fixed Test TaskDialog with Animations at design-time</li>
352+
</ul>
347353
<p>14 Oct 2025 - version 3.8.6</p>
348354
<ul>
349355
<li>Fixed Caption position for StyledCategoryButtons</li>

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Components similar to Delphi VCL Buttons, Toolbar, DbNavigator, BindNavigator, ButtonGroup and CategoryButtons with Custom Graphic Styles, and an advanced, full-customizable TaskDialog, also with animations!
44

5-
### Actual official version: 3.8.6
5+
### Actual official version: 3.9.0
66

77
---
88
## New Setup for Installation of Components
@@ -396,6 +396,12 @@ If you are have Skia4Delphi installed, you can also try the AnimatedTaskDialogDe
396396
Related links: [embarcadero.com](https://www.embarcadero.com) - [learndelphi.org](https://learndelphi.org)
397397

398398
### RELEASE NOTES
399+
400+
17 Oct 2025 - version 3.9.0
401+
- Added UseAnimationLoop property to TStyledTaskDialog
402+
- Added UseAnimationInverse property to TStyledTaskDialog
403+
- Fixed Test TaskDialog with Animations at design-time
404+
399405
14 Oct 2025 - version 3.8.6
400406
- Fixed Caption position for StyledCategoryButtons
401407
- Added standard Component Editor to StyledButtonGroup

source/Skia.Vcl.StyledTaskDialogAnimatedUnit.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ TStyledTaskDialogAnimatedForm = class(TStyledTaskDialogForm)
7171
const ATaskDialogIcon: TTaskDialogIcon); override;
7272
procedure LoadCustomFooterIcon(const AIcon: TIcon;
7373
const ATaskDialogIcon: TTaskDialogIcon); override;
74-
public
7574
end;
7675

7776
implementation
@@ -129,7 +128,8 @@ procedure TStyledTaskDialogAnimatedForm.InternalLoadImage(
129128
LStream := TResourceStream.Create(HInstance, LImageName, RT_RCDATA);
130129
try
131130
AAnimatedImage.LoadFromStream(LStream);
132-
AAnimatedImage.Animation.Loop := False;
131+
AAnimatedImage.Animation.Loop := AnimationLoop;
132+
AAnimatedImage.Animation.Inverse := AnimationInverse;
133133
AAnimatedImage.Animation.Start;
134134
finally
135135
LStream.Free;

source/Vcl.ButtonStylesAttributes.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ interface
5555
;
5656

5757
const
58-
StyledComponentsVersion = '3.8.6';
58+
StyledComponentsVersion = '3.9.0';
5959
DEFAULT_RADIUS = 6;
6060
RESOURCE_SHIELD_ICON = 'STYLED_BUTTON_SHIELD_ADMIN';
6161
DEFAULT_MAX_BADGE_VALUE = 99;

source/Vcl.StyledTaskDialog.pas

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ TStyledTaskDialog = class(TTaskDialog)
9595
FAutoClickDelay: Integer;
9696
FOnFindDialogButton: TOnFindDialogButtonEvent;
9797
FUseAnimations: Boolean;
98+
FUseAnimationLoop: Boolean;
99+
FUseAnimationInverse: Boolean;
98100
FUseMessageDefaultButton: Boolean;
99101
FMessageDefaultButton: TMsgDlgBtn;
100102
FOnDialogShow: TTaskDialogShow;
@@ -110,6 +112,9 @@ TStyledTaskDialog = class(TTaskDialog)
110112
procedure SetUseCommandLinks(const AValue: Boolean);
111113
function GetUseCommandLinks: Boolean;
112114
procedure SetMainIconSize(const AValue: Integer);
115+
procedure SetUseAnimationInverse(const AValue: Boolean);
116+
procedure SetUseAnimationLoop(const AValue: Boolean);
117+
procedure SetUseAnimations(const AValue: Boolean);
113118
strict protected
114119
function DoExecute(ParentWnd: HWND): Boolean; override;
115120
procedure DoOnHelp; override;
@@ -133,7 +138,9 @@ TStyledTaskDialog = class(TTaskDialog)
133138
property AutoClickDelay: Integer read FAutoClickDelay write SetAutoClickDelay default DEFAULT_AUTOCLICK_DELAY;
134139
property DialogButtonsFamily: TStyledButtonFamily read FDialogButtonsFamily write FDialogButtonsFamily stored IsDefaultFamily;
135140
property UseCommandLinks: Boolean read GetUseCommandLinks write SetUseCommandLinks default False;
136-
property UseAnimations: Boolean read FUseAnimations write FUseAnimations default false;
141+
property UseAnimations: Boolean read FUseAnimations write SetUseAnimations default false;
142+
property UseAnimationLoop: Boolean read FUseAnimationLoop write SetUseAnimationLoop default False;
143+
property UseAnimationInverse: Boolean read FUseAnimationInverse write SetUseAnimationInverse default False;
137144
property UseTitleInMessageDlg: Boolean read FUseTitleInMessageDlg write FUseTitleInMessageDlg default True;
138145
property AlphaBlendValue: Byte read FAlphaBlendValue write SetAlphaBlendValue default DEFAULT_STYLEDDIALOG_ALPHABLEND;
139146
property ButtonsWidth: Integer read FButtonsWidth write SetButtonsWidth default DEFAULT_STYLEDDIALOG_BUTTONSWIDTH;
@@ -895,6 +902,26 @@ procedure TStyledTaskDialog.SetAlphaBlendValue(const AValue: Byte);
895902
FAlphaBlendValue := AValue;
896903
end;
897904

905+
procedure TStyledTaskDialog.SetUseAnimationInverse(const AValue: Boolean);
906+
begin
907+
if FUseAnimationInverse <> AValue then
908+
begin
909+
if AValue then
910+
UseAnimations := True;
911+
FUseAnimationInverse := AValue;
912+
end;
913+
end;
914+
915+
procedure TStyledTaskDialog.SetUseAnimationLoop(const AValue: Boolean);
916+
begin
917+
if FUseAnimationLoop <> AValue then
918+
begin
919+
if AValue then
920+
UseAnimations := True;
921+
FUseAnimationLoop := AValue;
922+
end;
923+
end;
924+
898925
procedure TStyledTaskDialog.SetAutoClick(const AValue: Boolean);
899926
begin
900927
FAutoClick := AValue;
@@ -943,6 +970,18 @@ procedure TStyledTaskDialog.SetMainIconSize(const AValue: Integer);
943970
FMainIconSize := AValue;
944971
end;
945972

973+
procedure TStyledTaskDialog.SetUseAnimations(const AValue: Boolean);
974+
begin
975+
if FUseAnimations <> AValue then
976+
begin
977+
if AValue and not AnimatedTaskDialogFormRegistered then
978+
raise EStyledTaskDialogException.CreateFmt(
979+
ERR_DIALOG_FORM_NOT_REGISTERED,
980+
['Skia.Vcl.StyledTaskDialogAnimatedUnit.pas']);
981+
FUseAnimations := AValue;
982+
end;
983+
end;
984+
946985
procedure TStyledTaskDialog.SetUseCommandLinks(const AValue: Boolean);
947986
begin
948987
if AValue then

source/Vcl.StyledTaskDialogFormUnit.dfm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ object StyledTaskDialogForm: TStyledTaskDialogForm
116116
AlignWithMargins = True
117117
Left = 4
118118
Top = 4
119-
Width = 909
119+
Width = 47
120120
Height = 15
121121
Margins.Left = 4
122122
Margins.Top = 4
@@ -240,8 +240,8 @@ object StyledTaskDialogForm: TStyledTaskDialogForm
240240
AlignWithMargins = True
241241
Left = 29
242242
Top = 4
243-
Width = 952
244-
Height = 16
243+
Width = 3
244+
Height = 15
245245
Margins.Top = 4
246246
Margins.Bottom = 4
247247
Align = alClient

source/Vcl.StyledTaskDialogFormUnit.pas

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ TStyledTaskDialogForm = class(TForm)
137137
FTimer: TTimer;
138138
FTickCount: Cardinal;
139139
FMainIconSize: Integer;
140+
FAnimationLoop: Boolean;
141+
FAnimationInverse: Boolean;
140142
//procedure GetIconNameAndIndex(ATaskDialog: TMsgDlgType;
141143
// out AImageName: string; out AImageIndex: Integer); overload;
142144
procedure TaskDialogExpanded(Sender: TObject);
@@ -237,6 +239,10 @@ TStyledTaskDialogForm = class(TForm)
237239
property TextMessage: string read GetText write SetText;
238240
property TitleMessage: string read GetTitle write SetTitle;
239241
property OnTimer: TTaskDlgTimerEvent read FOnTimer write FOnTimer;
242+
243+
//Used by Animated Form
244+
property AnimationLoop: Boolean read FAnimationLoop write FAnimationLoop;
245+
property AnimationInverse: Boolean read FAnimationInverse write FAnimationInverse;
240246
end;
241247

242248
TStyledTaskDialogFormClass = class of TStyledTaskDialogForm;
@@ -250,14 +256,17 @@ procedure UseStyledDialogForm(const AActivate: Boolean);
250256
/// Register the custom StyledTaskDialog passing the Form Class
251257
/// The Form must inherits from TStyledTaskDialogForm
252258
/// </summary>
253-
procedure RegisterTaskDialogFormClass(
254-
AFormClass: TStyledTaskDialogFormClass);
259+
procedure RegisterTaskDialogFormClass(AFormClass: TStyledTaskDialogFormClass);
255260

256261
/// <summary>
257262
/// Unregister the custom StyledTaskDialog to use Standard Task Dialog
258263
/// </summary>
259-
procedure UnRegisterTaskDialogFormClass(
260-
AFormClass: TStyledTaskDialogFormClass);
264+
procedure UnRegisterTaskDialogFormClass(AFormClass: TStyledTaskDialogFormClass);
265+
266+
/// <summary>
267+
/// Returns True if an Animated Task Dialog form is registered
268+
/// </summary>
269+
function AnimatedTaskDialogFormRegistered: Boolean;
261270

262271
implementation
263272

@@ -281,6 +290,11 @@ implementation
281290
_DlgButtonClasses: TButtonClasses;
282291
_DialogPosition: Vcl.Forms.TPosition;
283292

293+
function AnimatedTaskDialogFormRegistered: Boolean;
294+
begin
295+
Result := Assigned(_AnimatedTaskDialogFormClass);
296+
end;
297+
284298
procedure UnRegisterTaskDialogFormClass(
285299
AFormClass: TStyledTaskDialogFormClass);
286300
begin
@@ -1596,12 +1610,16 @@ function TTaskDialogLauncherHandler.DoExecute(ParentWnd: HWND;
15961610

15971611
if ATaskDialog.UseAnimations then
15981612
begin
1599-
if not Assigned(_AnimatedTaskDialogFormClass) then
1613+
if not AnimatedTaskDialogFormRegistered then
16001614
raise EStyledTaskDialogException.CreateFmt(
16011615
ERR_DIALOG_FORM_NOT_REGISTERED,
16021616
['Skia.Vcl.StyledTaskDialogAnimatedUnit.pas'])
16031617
else
1604-
LForm := _AnimatedTaskDialogFormClass.Create(LOwnerForm)
1618+
begin
1619+
LForm := _AnimatedTaskDialogFormClass.Create(LOwnerForm);
1620+
TStyledTaskDialogForm(LForm).AnimationLoop := ATaskDialog.UseAnimationLoop;
1621+
TStyledTaskDialogForm(LForm).AnimationInverse := ATaskDialog.UseAnimationInverse;
1622+
end;
16051623
end
16061624
else
16071625
LForm := _TaskDialogFormClass.Create(LOwnerForm);

0 commit comments

Comments
 (0)