Skip to content

Commit

Permalink
version 3.7.5
Browse files Browse the repository at this point in the history
- Added property HideSystemCloseButton to TStyledTaskDialog
- Added property OnDialogShow
- Fixed wordwrap for StyledBitBtn
  • Loading branch information
carloBarazzetta committed Nov 30, 2024
1 parent 0ec9a81 commit 0de3296
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 30 deletions.
9 changes: 8 additions & 1 deletion README.htm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
</style>
<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>
<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>
<h3>Actual official version: 3.7.4</h3>
<h3>Actual official version: 3.7.5</h3>
<hr />
<h2>A brief description</h2>
<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>
Expand Down Expand Up @@ -347,10 +347,17 @@ <h3>Available from Delphi XE6 to Delphi 12 (32bit and 64bit platforms)</h3>
<p><img src="./Images/SupportingDelphi.jpg" alt="Delphi Support"/></p>
<p>Related links: <a href="https://www.embarcadero.com">embarcadero.com</a> - <a href="https://learndelphi.org">learndelphi.org</a></p>
<h3>RELEASE NOTES</h3>
<p>30 Nov 2024: version 3.7.5</p>
<ul>
<li>Added property HideSystemCloseButton to TStyledTaskDialog</li>
<li>Added property OnDialogShow</li>
<li>Fixed wordwrap for StyledBitBtn</li>
</ul>
<p>10 Nov 2024: version 3.7.4</p>
<ul>
<li>Added tdiQuestion value to show a Question mark in TaskDialog</li>
<li>Use Question Mark (icon ora animation) for MessageDlg and TaskDialog of mtConfirmation type</li>
<li>Fixed Icon Size of Dialogs based on ScaleFactor</li>
<li>Fixed DefaultButton for StyledDialog using MessageDlg and TaskDialog</li>
</ul>
<p>08 Nov 2024: version 3.7.3</p>
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## 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!

### Actual official version: 3.7.4
### Actual official version: 3.7.5

---
## A brief description
Expand Down Expand Up @@ -403,9 +403,15 @@ If you are have Skia4Delphi installed, you can also try the AnimatedTaskDialogDe
Related links: [embarcadero.com](https://www.embarcadero.com) - [learndelphi.org](https://learndelphi.org)

### RELEASE NOTES
30 Nov 2024: version 3.7.5
- Added property HideSystemCloseButton to TStyledTaskDialog
- Added property OnDialogShow
- Fixed wordwrap for StyledBitBtn

10 Nov 2024: version 3.7.4
- Added tdiQuestion value to show a Question mark in TaskDialog
- Use Question Mark (icon ora animation) for MessageDlg and TaskDialog of mtConfirmation type
- Fixed Icon Size of Dialogs based on ScaleFactor
- Fixed DefaultButton for StyledDialog using MessageDlg and TaskDialog

08 Nov 2024: version 3.7.3
Expand Down
2 changes: 1 addition & 1 deletion source/Vcl.ButtonStylesAttributes.pas
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ interface
;

const
StyledComponentsVersion = '3.7.4';
StyledComponentsVersion = '3.7.5';
DEFAULT_RADIUS = 6;
RESOURCE_SHIELD_ICON = 'STYLED_BUTTON_SHIELD_ADMIN';
DEFAULT_MAX_BADGE_VALUE = 99;
Expand Down
9 changes: 8 additions & 1 deletion source/Vcl.StyledTaskDialog.pas
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ interface
EStyledTaskDialogException = class(Exception);

{$WARN SYMBOL_PLATFORM OFF}
{ TaskDialog based message dialog; requires Windows Vista or later }

type
TTaskDialogShow = procedure(
const AStyledTaskDialogForm: TForm) of Object;

{ TStyledTaskDialog }
[ComponentPlatforms(pidWin32 or pidWin64)]
TStyledTaskDialog = class(TTaskDialog)
Expand All @@ -90,6 +93,8 @@ TStyledTaskDialog = class(TTaskDialog)
FUseAnimations: Boolean;
FUseMessageDefaultButton: Boolean;
FMessageDefaultButton: TMsgDlgBtn;
FDefineDialogSize: TTaskDialogShow;
FHideSystemCloseButton: Boolean;
function IsDefaultFamily: Boolean;
procedure SetAutoClick(const AValue: Boolean);
procedure SetAutoClickDelay(const AValue: Integer);
Expand Down Expand Up @@ -126,6 +131,8 @@ TStyledTaskDialog = class(TTaskDialog)
property ButtonsWidth: Integer read FButtonsWidth write SetButtonsWidth default DEFAULT_STYLEDDIALOG_BUTTONSWIDTH;
property ButtonsHeight: Integer read FButtonsHeight write SetButtonsHeight default DEFAULT_STYLEDDIALOG_BUTTONSHEIGHT;
property Flags: TTaskDialogFlags read GetFlags write SetFlags default [tfAllowDialogCancellation, tfPositionRelativeToWindow];
property HideSystemCloseButton: Boolean read FHideSystemCloseButton write FHideSystemCloseButton default False;
property OnDialogShow: TTaskDialogShow read FDefineDialogSize write FDefineDialogSize;
end;

//Abstraction of a Dialog Launcher
Expand Down
57 changes: 31 additions & 26 deletions source/Vcl.StyledTaskDialogFormUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,6 @@ TStyledTaskDialogForm = class(TForm)
procedure PlayMessageDlgSound;
procedure FocusDefaultButton;
procedure LoadDialogImage;
procedure SetFocusToButton(AStyledButton: TStyledButton);
procedure SetFooterText(const AValue: string);
function GetFooterText: string;
procedure SetVerificationText(const AValue: string);
Expand Down Expand Up @@ -369,7 +368,7 @@ procedure TStyledTaskDialogForm.SetButtons(const AValue: TTaskDialogButtons);
begin
TabOrder := LStyledButton.TabOrder -1;
if LTaskDialogButtonItem.Default then
SetFocusToButton(LStyledButton);
FFocusedButton := LStyledButton;
end;
end;
end;
Expand Down Expand Up @@ -420,15 +419,6 @@ procedure TStyledTaskDialogForm.SetFlags(const AValue: TTaskDialogFlags);
end;
end;

procedure TStyledTaskDialogForm.SetFocusToButton(AStyledButton: TStyledButton);
begin
if AStyledButton.CanFocus then
begin
AStyledButton.SetFocus;
FFocusedButton := AStyledButton;
end;
end;

procedure TStyledTaskDialogForm.SetMainIcon(const AValue: TTaskDialogIcon);
begin
if FMainIcon <> AValue then
Expand Down Expand Up @@ -537,16 +527,17 @@ procedure TStyledTaskDialogForm.FocusDefaultButton;
var
LButton: TStyledButton;
begin
//if not Assigned(FFocusedButton) then
LButton := GetDefaultButton(DefaultButton);
if not Assigned(LButton) then
LButton := FFocusedButton;
if Assigned(LButton) then
begin
LButton := GetDefaultButton(DefaultButton);
if Assigned(LButton) then
SetFocusToButton(LButton);
end;
if Assigned(FFocusedButton) then
begin
FFocusedButton.AutoClick := FAutoClick;
FFocusedButton.AutoClickDelay := FAutoClickDelay;
if LButton.CanFocus and Self.Visible then
begin
LButton.SetFocus;
LButton.AutoClick := FAutoClick;
LButton.AutoClickDelay := FAutoClickDelay;
end;
end;
end;

Expand Down Expand Up @@ -706,6 +697,11 @@ procedure TStyledTaskDialogForm.AdjustWidth;
end;
LFormWidth := LFormWidth + LMargins;
ClientWidth := Max(LWidth, LFormWidth);
//Resize Image based on Scale Factor
ImagePanel.SetBounds(ImagePanel.Left, ImagePanel.Top,
LImageSize, LImageSize);
IconContainer.SetBounds(IconContainer.Left, IconContainer.Top,
LImageSize, LImageSize);
end;

procedure TStyledTaskDialogForm.CalcMessageText(const AExpanded: Boolean);
Expand Down Expand Up @@ -981,7 +977,7 @@ procedure TStyledTaskDialogForm.AddCustomButtons(const AButtons: TTaskDialogButt
begin
LStyledButton.Default := True;
Self.ActiveControl := LStyledButton;
SetFocusToButton(LStyledButton);
FFocusedButton := LStyledButton;
end;
if Assigned(LLastButton) then
begin
Expand Down Expand Up @@ -1018,7 +1014,7 @@ procedure TStyledTaskDialogForm.AddCustomButtons(const AButtons: TTaskDialogButt
if (Self.ActiveControl = nil) and Assigned(LLastButton) and (LLastButton.CanFocus) then
begin
Self.ActiveControl := LLastButton;
SetFocusToButton(LLastButton);
FFocusedButton := LLastButton;
end;
end;

Expand Down Expand Up @@ -1065,6 +1061,8 @@ procedure TStyledTaskDialogForm.AdjustControlsTopPos;
end;

procedure TStyledTaskDialogForm.ShowDialogForm;
var
LStyledDialog: TStyledTaskDialog;
begin
//Initialize components based on ATaskDialog attributes
FTaskDialogExpanded := FTaskDialog.OnExpanded;
Expand All @@ -1076,10 +1074,14 @@ procedure TStyledTaskDialogForm.ShowDialogForm;
DefaultButton := FTaskDialog.DefaultButton;
if FTaskDialog is TStyledTaskDialog then
begin
FUseMessageDefaultButton := TStyledTaskDialog(FTaskDialog).UseMessageDefaultButton;
FMessageDefaultButton := TStyledTaskDialog(FTaskDialog).MessageDefaultButton;
ButtonsWidth := TStyledTaskDialog(FTaskDialog).ButtonsWidth;
ButtonsHeight := TStyledTaskDialog(FTaskDialog).ButtonsHeight;
LStyledDialog := TStyledTaskDialog(FTaskDialog);
//Hide Close button if required
if LStyledDialog.HideSystemCloseButton then
BorderIcons := [];
FUseMessageDefaultButton := LStyledDialog.UseMessageDefaultButton;
FMessageDefaultButton := LStyledDialog.MessageDefaultButton;
ButtonsWidth := LStyledDialog.ButtonsWidth;
ButtonsHeight := LStyledDialog.ButtonsHeight;
end;
Buttons := FTaskDialog.Buttons;
//RadioButtons := FTaskDialog.RadioButtons;
Expand Down Expand Up @@ -1314,6 +1316,9 @@ procedure TStyledTaskDialogForm.FormShow(Sender: TObject);
VerificationCheckBox.Checked := tfVerificationFlagChecked in TaskDialog.Flags;
if Assigned(FTaskDialog.OnDialogCreated) then
FTaskDialog.OnDialogCreated(FTaskDialog);
if (FTaskDialog is TStyledTaskDialog) and
Assigned(TStyledTaskDialog(FTaskDialog).OnDialogShow) then
TStyledTaskDialog(FTaskDialog).OnDialogShow(Self);
finally
Screen.Cursor := crDefault;
end;
Expand Down

0 comments on commit 0de3296

Please sign in to comment.