Skip to content

Commit 0e94740

Browse files
version 3.7.0
- Outlined Colored Button (standard and SVG) now paint buttons also when focused, same as when "hot" - Use always DrawRectWithGDIPlus - Added AnimateOnType prop for TAnimatedButton: (AnimateOnButton, AnimateOnImage) - Fixed transparent background for StyledButton using DoubleBuffered - Updated Demo
1 parent 6307cc0 commit 0e94740

19 files changed

+302
-113
lines changed

Demos/source/AnimatedButtonsForm.dfm

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ object fmAnimatedButtons: TfmAnimatedButtons
2222
Height = 97
2323
Align = alBottom
2424
TabOrder = 0
25-
ExplicitLeft = 88
26-
ExplicitTop = 216
27-
ExplicitWidth = 702
2825
object ImageAlignmentRadioGroup: TRadioGroup
2926
Left = 1
3027
Top = 1
@@ -43,9 +40,6 @@ object fmAnimatedButtons: TfmAnimatedButtons
4340
'Center')
4441
TabOrder = 0
4542
OnClick = ImageAlignmentRadioGroupClick
46-
ExplicitLeft = 8
47-
ExplicitTop = 6
48-
ExplicitHeight = 91
4943
end
5044
object AutoAnimationRadioGroup: TRadioGroup
5145
Left = 186
@@ -55,9 +49,6 @@ object fmAnimatedButtons: TfmAnimatedButtons
5549
Align = alLeft
5650
Caption = 'AutoAnimationType'
5751
TabOrder = 1
58-
ExplicitLeft = 199
59-
ExplicitTop = -8
60-
ExplicitHeight = 105
6152
end
6253
object cbAnimateOnClick: TCheckBox
6354
Left = 192
@@ -98,17 +89,20 @@ object fmAnimatedButtons: TfmAnimatedButtons
9889
OnClick = AutoAnimationClick
9990
end
10091
object StyledAnimatedButton: TStyledAnimatedButton
101-
Left = 596
102-
Top = 1
103-
Width = 201
104-
Height = 95
92+
AlignWithMargins = True
93+
Left = 544
94+
Top = 11
95+
Width = 243
96+
Height = 75
97+
Margins.Left = 10
98+
Margins.Top = 10
99+
Margins.Right = 10
100+
Margins.Bottom = 10
105101
Align = alRight
106102
Caption = 'Animated &Button'
103+
ImageMargins.Left = 20
107104
TabOrder = 6
108105
StyleRadius = 28
109-
ExplicitLeft = 501
110-
ExplicitTop = 6
111-
ExplicitHeight = 91
112106
AnimationData = {
113107
1F8B0800000000000203ED7DDB92E3C891E5AFC8EA1984C5FDD21F30F3BA66BB
114108
6FB2B6B592BAA4AEED52675B5575CF6864FAF7F5733C4082247807329999D4D8

Demos/source/AnimatedButtonsForm.pas

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function TfmAnimatedButtons.CreateNewButton(const AParent: TWinControl; const AL
131131
LIconName := StringReplace(AImageName,'&','', [rfReplaceAll]);
132132
Result.Name := LIconName;
133133
Result.AutoSizeAnimationMargin := 20;
134-
Result.SetBounds(ALeft,ATop,180,100);
134+
Result.SetBounds(ALeft,ATop,220,80);
135135
Result.Parent := AParent;
136136
//Result.AnimationWidth := 42;
137137
//Result.AnimationHeight := 42;
@@ -178,10 +178,10 @@ procedure TfmAnimatedButtons.FormCreate(Sender: TObject);
178178
Caption := Application.Title;
179179
CreateNewButton(Self, 10, 10,'&Information', 'Primary');
180180
CreateNewButton(Self, 10, 110,'&Warning', 'Danger');
181-
CreateNewButton(Self, 210, 10,'&Error', 'Warning');
182-
CreateNewButton(Self, 210,110,'&Question', 'Info');
183-
CreateNewButton(Self, 410, 10,'&Notify', 'Secondary');
184-
CreateNewButton(Self, 410,110,'&Custom', 'Dark');
181+
CreateNewButton(Self, 250, 10,'&Error', 'Warning');
182+
CreateNewButton(Self, 250,110,'&Question', 'Info');
183+
CreateNewButton(Self, 490, 10,'&Notify', 'Secondary');
184+
CreateNewButton(Self, 490,110,'&Custom', 'Dark');
185185
end;
186186

187187
procedure TfmAnimatedButtons.FormDestroy(Sender: TObject);

Demos/source/MainDemoForm.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ interface
5757

5858
const
5959

60-
MENU_COLLAPSED_WIDTH = 50;
60+
MENU_COLLAPSED_WIDTH = 48;
6161
MENU_EXPANDED_WIDTH = 300;
6262
SETTINGS_EXPANDED_WIDTH = 400;
6363
MENU_LINES_HEIGHT = 40;
@@ -483,13 +483,15 @@ procedure TfrmMain.RealignMainMenu;
483483
LMenuSize := Round(MENU_EXPANDED_WIDTH * GetScaleFactor);
484484
// When Menu is opened, Shows the Captions of Category Buttons
485485
catMenuItems.ButtonOptions := catMenuItems.ButtonOptions + [boShowCaptions];
486+
catMenuItems.ImageAlignment := TImageAlignment.iaLeft;
486487
actMenu.Hint := 'Collapse Menu';
487488
end
488489
else
489490
begin
490491
LMenuSize := Round(MENU_COLLAPSED_WIDTH * GetScaleFactor);
491492
// When Menu is closed, adjust ButtonOptions and Width
492493
catMenuItems.ButtonOptions := catMenuItems.ButtonOptions - [boShowCaptions];
494+
catMenuItems.ImageAlignment := TImageAlignment.iaCenter;
493495
actMenu.Hint := 'Expand Menu';
494496
end;
495497
LeftPanel.SetBounds(0, LTopHeight, LMenuSize, ClientHeight-LTopHeight);
@@ -789,7 +791,6 @@ procedure TfrmMain.ShowError(Sender: TObject; E: Exception);
789791
LTitle: string;
790792
LMessage: string;
791793
LHelpContext: Integer;
792-
LUseTaskDialog: Boolean;
793794
begin
794795
LTitle := GetErrorClassNameDesc(E.ClassName,
795796
E is EAccessViolation);

Demos/source/StyledButtonsForm.dfm

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ object fmStyledButtons: TfmStyledButtons
22
Left = 0
33
Top = 0
44
ActiveControl = ShowEditButton
5-
Caption = 'Styled Buttons Demo'
5+
Caption = 'Styled Buttons - Family/Class/Appearance'
66
ClientHeight = 691
77
ClientWidth = 895
88
Color = clWindow
@@ -1547,13 +1547,15 @@ object fmStyledButtons: TfmStyledButtons
15471547
Height = 318
15481548
Align = alClient
15491549
TabOrder = 2
1550-
object GroupBox4: TGroupBox
1550+
object ClassicNormalGroupBox: TGroupBox
15511551
Left = 0
15521552
Top = 0
15531553
Width = 883
15541554
Height = 47
15551555
Align = alTop
15561556
Caption = 'Normal Classic Buttons (similar to VCL Styled Button)'
1557+
DoubleBuffered = False
1558+
ParentDoubleBuffered = False
15571559
TabOrder = 0
15581560
object ClassicNormalFlowPanel: TFlowPanel
15591561
Left = 2
@@ -1567,13 +1569,15 @@ object fmStyledButtons: TfmStyledButtons
15671569
OnResize = FlowPanelResize
15681570
end
15691571
end
1570-
object GroupBox5: TGroupBox
1572+
object ClassicOutlineGroupBox: TGroupBox
15711573
Left = 0
15721574
Top = 47
15731575
Width = 883
15741576
Height = 56
15751577
Align = alTop
15761578
Caption = 'Outline Classic Buttons (inspired to VCL Styled Button)'
1579+
DoubleBuffered = False
1580+
ParentDoubleBuffered = False
15771581
TabOrder = 1
15781582
object ClassicOutlineFlowPanel: TFlowPanel
15791583
Left = 2
@@ -1611,6 +1615,8 @@ object fmStyledButtons: TfmStyledButtons
16111615
Height = 185
16121616
Align = alTop
16131617
Caption = 'Normal Buttons'
1618+
DoubleBuffered = False
1619+
ParentDoubleBuffered = False
16141620
TabOrder = 0
16151621
object FlowPanelNormal: TFlowPanel
16161622
Left = 2
@@ -1631,6 +1637,8 @@ object fmStyledButtons: TfmStyledButtons
16311637
Height = 185
16321638
Align = alTop
16331639
Caption = 'Outline Buttons'
1640+
DoubleBuffered = False
1641+
ParentDoubleBuffered = False
16341642
TabOrder = 1
16351643
object FlowPanelOutLine: TFlowPanel
16361644
Left = 2
@@ -1667,6 +1675,8 @@ object fmStyledButtons: TfmStyledButtons
16671675
Height = 185
16681676
Align = alTop
16691677
Caption = 'Normal Buttons'
1678+
DoubleBuffered = False
1679+
ParentDoubleBuffered = False
16701680
TabOrder = 0
16711681
object SvgColorNormalFlowPanel: TFlowPanel
16721682
Left = 2
@@ -1687,6 +1697,8 @@ object fmStyledButtons: TfmStyledButtons
16871697
Height = 185
16881698
Align = alTop
16891699
Caption = 'Outline Buttons'
1700+
DoubleBuffered = False
1701+
ParentDoubleBuffered = False
16901702
TabOrder = 1
16911703
object SvgColorOutlineFlowPanel: TFlowPanel
16921704
Left = 2

Demos/source/StyledButtonsForm.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ TfmStyledButtons = class(TForm)
197197
SvgColorOutlineGroupBox: TGroupBox;
198198
SvgColorOutlineFlowPanel: TFlowPanel;
199199
ClassicScrollBox: TScrollBox;
200-
GroupBox4: TGroupBox;
200+
ClassicNormalGroupBox: TGroupBox;
201201
ClassicNormalFlowPanel: TFlowPanel;
202-
GroupBox5: TGroupBox;
202+
ClassicOutlineGroupBox: TGroupBox;
203203
ClassicOutlineFlowPanel: TFlowPanel;
204204
ButtonSplit: TButton;
205205
StyledButtonSplit: TStyledButton;

Demos/source/StyledButtonsFormOld.dfm

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ object fmStyledButtons: TfmStyledButtons
1212
Font.Height = -11
1313
Font.Name = 'Segoe UI'
1414
Font.Style = []
15-
OldCreateOrder = True
1615
ShowHint = True
1716
OnCreate = FormCreate
1817
PixelsPerInch = 96
@@ -1549,13 +1548,15 @@ object fmStyledButtons: TfmStyledButtons
15491548
Height = 318
15501549
Align = alClient
15511550
TabOrder = 2
1552-
object GroupBox4: TGroupBox
1551+
object ClassicNormalGroupBox: TGroupBox
15531552
Left = 0
15541553
Top = 0
15551554
Width = 883
15561555
Height = 47
15571556
Align = alTop
15581557
Caption = 'Normal Classic Buttons (similar to VCL Styled Button)'
1558+
DoubleBuffered = False
1559+
ParentDoubleBuffered = False
15591560
TabOrder = 0
15601561
object ClassicNormalFlowPanel: TFlowPanel
15611562
Left = 2
@@ -1569,13 +1570,15 @@ object fmStyledButtons: TfmStyledButtons
15691570
OnResize = FlowPanelResize
15701571
end
15711572
end
1572-
object GroupBox5: TGroupBox
1573+
object ClassicOutlineGroupBox: TGroupBox
15731574
Left = 0
15741575
Top = 47
15751576
Width = 883
15761577
Height = 56
15771578
Align = alTop
15781579
Caption = 'Outline Classic Buttons (inspired to VCL Styled Button)'
1580+
DoubleBuffered = False
1581+
ParentDoubleBuffered = False
15791582
TabOrder = 1
15801583
object ClassicOutlineFlowPanel: TFlowPanel
15811584
Left = 2
@@ -1613,6 +1616,8 @@ object fmStyledButtons: TfmStyledButtons
16131616
Height = 185
16141617
Align = alTop
16151618
Caption = 'Normal Buttons'
1619+
DoubleBuffered = False
1620+
ParentDoubleBuffered = False
16161621
TabOrder = 0
16171622
object FlowPanelNormal: TFlowPanel
16181623
Left = 2
@@ -1633,6 +1638,8 @@ object fmStyledButtons: TfmStyledButtons
16331638
Height = 185
16341639
Align = alTop
16351640
Caption = 'Outline Buttons'
1641+
DoubleBuffered = False
1642+
ParentDoubleBuffered = False
16361643
TabOrder = 1
16371644
object FlowPanelOutLine: TFlowPanel
16381645
Left = 2
@@ -1669,6 +1676,8 @@ object fmStyledButtons: TfmStyledButtons
16691676
Height = 185
16701677
Align = alTop
16711678
Caption = 'Normal Buttons'
1679+
DoubleBuffered = False
1680+
ParentDoubleBuffered = False
16721681
TabOrder = 0
16731682
object SvgColorNormalFlowPanel: TFlowPanel
16741683
Left = 2
@@ -1689,6 +1698,8 @@ object fmStyledButtons: TfmStyledButtons
16891698
Height = 185
16901699
Align = alTop
16911700
Caption = 'Outline Buttons'
1701+
DoubleBuffered = False
1702+
ParentDoubleBuffered = False
16921703
TabOrder = 1
16931704
object SvgColorOutlineFlowPanel: TFlowPanel
16941705
Left = 2

Demos/source/StyledButtonsFormOld.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,9 @@ TfmStyledButtons = class(TForm)
192192
SvgColorOutlineGroupBox: TGroupBox;
193193
SvgColorOutlineFlowPanel: TFlowPanel;
194194
ClassicScrollBox: TScrollBox;
195-
GroupBox4: TGroupBox;
195+
ClassicNormalGroupBox: TGroupBox;
196196
ClassicNormalFlowPanel: TFlowPanel;
197-
GroupBox5: TGroupBox;
197+
ClassicOutlineGroupBox: TGroupBox;
198198
ClassicOutlineFlowPanel: TFlowPanel;
199199
ButtonSplit: TButton;
200200
StyledButtonSplit: TStyledButton;

Demos/source/StyledDbNavigatorForm.pas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ procedure TfmStyledDbNavigator.StyledDBNavigatorEnableNavBtn(
223223
const ADbNavigator: TCustomStyledDBNavigator; const ABtn: TStyledNavButton;
224224
var AEnabled: Boolean);
225225
begin
226+
//Simple example to disable Delete button (always)
227+
if (ABtn.Index = TNavigateBtn.nbDelete) then
228+
AEnabled := False;
229+
226230
//Simple example to disable all buttons when the Quantity is 3
227231
if AEnabled and (ClientDataSetQuantity.Value = 3) then
228232
AEnabled := False;

README.htm

Lines changed: 8 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.9</h3>
34+
<h3>Actual official version: 3.7.0</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>
@@ -347,6 +347,13 @@ <h3>Available from Delphi XE6 to Delphi 12 (32bit and 64bit platforms)</h3>
347347
<p><img src="./Images/SupportingDelphi.jpg" alt="Delphi Support"/></p>
348348
<p>Related links: <a href="https://www.embarcadero.com">embarcadero.com</a> - <a href="https://learndelphi.org">learndelphi.org</a></p>
349349
<h3>RELEASE NOTES</h3>
350+
<p>20 Oct 2024: version 3.7.0</p>
351+
<ul>
352+
<li>Outlined Colored Button (standard and SVG) now paint buttons also when focused, same as when &ldquo;hot&rdquo;</li>
353+
<li>Use always DrawRectWithGDIPlus</li>
354+
<li>Added AnimateOnType prop for TAnimatedButton: (AnimateOnButton, AnimateOnImage)</li>
355+
<li>Fixed transparent background for StyledButton using DoubleBuffered</li>
356+
</ul>
350357
<p>12 Oct 2024: version 3.6.9</p>
351358
<ul>
352359
<li>Added Expanded button and Panel in StyledTaskDialog Form</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.6.9
5+
### Actual official version: 3.7.0
66

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

405405
### RELEASE NOTES
406+
20 Oct 2024: version 3.7.0
407+
- Outlined Colored Button (standard and SVG) now paint buttons also when focused, same as when "hot"
408+
- Use always DrawRectWithGDIPlus
409+
- Added AnimateOnType prop for TAnimatedButton: (AnimateOnButton, AnimateOnImage)
410+
- Fixed transparent background for StyledButton using DoubleBuffered
411+
406412
12 Oct 2024: version 3.6.9
407413
- Added Expanded button and Panel in StyledTaskDialog Form
408414
- Changed Panel Order in StyledTaskDialog

0 commit comments

Comments
 (0)