Skip to content

Commit d477034

Browse files
version 3.6.5
- Fixed Dialog buttons with with DPI > 100% - Added FindDialogButton to TStyledTaskDialog - Updated packages for Delphi 12.2
1 parent a10a60e commit d477034

15 files changed

+129
-66
lines changed
Binary file not shown.
Binary file not shown.

Demos/StyledTaskDlgDemo/MainFormUnit.dfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ object MainForm: TMainForm
480480
Width = 196
481481
Height = 195
482482
Anchors = [akLeft, akTop, akBottom]
483-
ItemHeight = 17
483+
ItemHeight = 13
484484
TabOrder = 1
485485
end
486486
object DefaultButtonComboBox: TComboBox

Demos/StyledTaskDlgDemo/MainFormUnit.pas

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ TMainForm = class(TForm)
114114
procedure ShowSelection(const AModalResult: TModalResult);
115115
procedure BuildStyleList;
116116
procedure InitializeDialogs;
117+
function EnableAndFocusOKButton(const ATaskDialog: TCustomTaskDialog): Boolean;
117118
protected
118119
procedure Loaded; override;
119120
public
@@ -131,6 +132,7 @@ implementation
131132
System.TypInfo
132133
, Winapi.ShellAPI
133134
, Vcl.Themes
135+
, Vcl.StyledButton
134136
, Vcl.StyledCmpMessages
135137
, Vcl.StyledCmpStrUtils
136138
, Vcl.StyledTaskDialogFormUnit;
@@ -487,7 +489,7 @@ procedure TMainForm.TaskDialogDialogConstructed(Sender: TObject);
487489

488490
procedure TMainForm.TaskDialogDialogCreated(Sender: TObject);
489491
begin
490-
;
492+
EnableAndFocusOKButton(Sender as TCustomTaskDialog);
491493
end;
492494

493495
procedure TMainForm.TaskDialogDialogDestroyed(Sender: TObject);
@@ -533,12 +535,40 @@ procedure TMainForm.TaskDialogTimer(Sender: TObject; TickCount: Cardinal; var Re
533535
TaskDialog.Execute(Self.Handle);
534536
end;
535537

538+
function TMainForm.EnableAndFocusOKButton(const ATaskDialog: TCustomTaskDialog): Boolean;
539+
var
540+
LOKButton: TStyledButton;
541+
begin
542+
//Example to enable/disable OK Button based on Verification Flag Checked
543+
//This is possible only with TStyledTaskDialog!
544+
Result := False;
545+
if ATaskDialog is TStyledTaskDialog then
546+
begin
547+
LOKButton := TStyledTaskDialog(ATaskDialog).FindDialogButton(mrOK);
548+
if Assigned(LOKButton) then
549+
begin
550+
LOKButton.Enabled := tfVerificationFlagChecked in ATaskDialog.Flags;
551+
if LOKButton.CanFocus then
552+
LOKButton.SetFocus;
553+
Result := True;
554+
end;
555+
end;
556+
end;
557+
536558
procedure TMainForm.TaskDialogVerificationClicked(Sender: TObject);
559+
var
560+
LTaskDialog: TCustomTaskDialog;
537561
begin
538-
if tfVerificationFlagChecked in (Sender as TTaskDialog).Flags then
539-
ShowMessage('Verification Click TRUE')
540-
else
541-
ShowMessage('Verification Click FALSE');
562+
LTaskDialog := Sender as TCustomTaskDialog;
563+
//In this examples, for StyledTaskDialog, clicking on Verification checkbox
564+
//enable/disable OK Button
565+
if not EnableAndFocusOKButton(LTaskDialog) then
566+
begin
567+
if tfVerificationFlagChecked in LTaskDialog.Flags then
568+
ShowMessage('Verification Click TRUE')
569+
else
570+
ShowMessage('Verification Click FALSE');
571+
end;
542572
end;
543573

544574
initialization
Binary file not shown.

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.6.4</h3>
34+
<h3>Actual official version: 3.6.5</h3>
3535
<hr />
3636
<h2>A brief description</h2>
3737
<p><strong>StyledComponents</strong> is a set of VCL components for Delphi (32 and 64 bit) that allow you to overcome the limits imposed by standard VCL components, maintaining 100% compatibility of the properties.</p>
@@ -344,6 +344,12 @@ <h3>Available from Delphi XE6 to Delphi 12 (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>16 Sep 2024: version 3.6.5</p>
348+
<ul>
349+
<li>Fixed Dialog buttons with with DPI > 100%</li>
350+
<li>Added FindDialogButton to TStyledTaskDialog</li>
351+
<li>Updated packages for Delphi 12.2</li>
352+
</ul>
347353
<p>26 Aug 2024: version 3.6.4</p>
348354
<ul>
349355
<li>Fixed memory leak in Vcl.ButtonStylesAttributes.pas</li>

README.md

Lines changed: 6 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.6.4
5+
### Actual official version: 3.6.5
66

77
---
88
## A brief description
@@ -397,6 +397,11 @@ If you are have Skia4Delphi installed, you can also try the AnimatedTaskDialogDe
397397
Related links: [embarcadero.com](https://www.embarcadero.com) - [learndelphi.org](https://learndelphi.org)
398398

399399
### RELEASE NOTES
400+
16 Sep 2024: version 3.6.5
401+
- Fixed Dialog buttons with with DPI > 100%
402+
- Added FindDialogButton to TStyledTaskDialog
403+
- Updated packages for Delphi 12.2
404+
400405
26 Aug 2024: version 3.6.4
401406
- Fixed memory leak in Vcl.ButtonStylesAttributes.pas
402407

packages/D12/StyledAnimatedComponents.dproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
<PropertyGroup>
33
<ProjectGuid>{18935916-9466-4807-98CC-6A91C06F1F85}</ProjectGuid>
44
<MainSource>StyledAnimatedComponents.dpk</MainSource>
5-
<ProjectVersion>20.1</ProjectVersion>
5+
<ProjectVersion>20.2</ProjectVersion>
66
<FrameworkType>VCL</FrameworkType>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Release</Config>
99
<Platform Condition="'$(Platform)'==''">Win32</Platform>
1010
<TargetedPlatforms>3</TargetedPlatforms>
1111
<AppType>Package</AppType>
12+
<ProjectName Condition="'$(ProjectName)'==''">StyledAnimatedComponents</ProjectName>
1213
</PropertyGroup>
1314
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
1415
<Base>true</Base>

packages/D12/StyledComponents.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<ProjectGuid>{F870FD7C-4984-4784-8B29-4CDB55E64524}</ProjectGuid>
44
<MainSource>StyledComponents.dpk</MainSource>
5-
<ProjectVersion>20.1</ProjectVersion>
5+
<ProjectVersion>20.2</ProjectVersion>
66
<FrameworkType>VCL</FrameworkType>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Release</Config>

packages/D12/dclStyledAnimatedComponents.dproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<ProjectGuid>{EBF448F0-3AF1-4B95-B1AD-5874F1BABAEC}</ProjectGuid>
44
<MainSource>dclStyledAnimatedComponents.dpk</MainSource>
5-
<ProjectVersion>20.1</ProjectVersion>
5+
<ProjectVersion>20.2</ProjectVersion>
66
<FrameworkType>VCL</FrameworkType>
77
<Base>True</Base>
88
<Config Condition="'$(Config)'==''">Release</Config>

0 commit comments

Comments
 (0)