Skip to content

Commit 80ecd34

Browse files
version 3.4.1
- Added StyledCategoryButtons Component - Added StyledCategoryButtons Demo - Fixed size of sample Button in Component Editor for StyledButtonGroup
1 parent 3efc59a commit 80ecd34

File tree

106 files changed

+10071
-1854
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+10071
-1854
lines changed

Demos/FAboutForm.pas

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{******************************************************************************}
22
{ }
3-
{ StyledComponents Library }
3+
{ StyledComponents Library }
44
{ }
5-
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
6-
{ Author: Carlo Barazzetta }
7-
{ Contributors: }
5+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
6+
{ Author: Carlo Barazzetta }
7+
{ Contributors: }
88
{ }
9-
{ https://github.com/EtheaDev/StyledComponents }
9+
{ https://github.com/EtheaDev/StyledComponents }
1010
{ }
1111
{******************************************************************************}
1212
{ }
@@ -29,7 +29,8 @@ interface
2929

3030
uses
3131
Vcl.StyledButton, Vcl.Imaging.pngimage, Vcl.ExtCtrls, Vcl.Controls,
32-
System.Classes, Vcl.StdCtrls, Vcl.Forms, Vcl.Graphics;
32+
System.Classes, Vcl.StdCtrls, Vcl.Forms, Vcl.Graphics,
33+
Vcl.ButtonStylesAttributes;
3334

3435
type
3536
TfmAbout = class(TForm)

Demos/StyledButtonGroup/Delphi10.4+/DResources.pas

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{******************************************************************************}
22
{ }
3-
{ TStyledButtonGroup Demo }
4-
{ Comparison TStyledButtonGroup with TButtonGroup }
3+
{ TStyledButtonGroup Demo }
4+
{ Comparison TStyledButtonGroup with TButtonGroup }
55
{ }
6-
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
7-
{ Author: Carlo Barazzetta }
8-
{ Contributors: }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
7+
{ Author: Carlo Barazzetta }
8+
{ Contributors: }
99
{ }
10-
{ https://github.com/EtheaDev/StyledComponents }
10+
{ https://github.com/EtheaDev/StyledComponents }
1111
{ }
1212
{******************************************************************************}
1313
{ }

Demos/StyledButtonGroup/Delphi10.4+/MainForm.dfm

Lines changed: 15 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ object fmMain: TfmMain
22
Left = 0
33
Top = 0
44
Caption = 'StyledButtonGroup Test'
5-
ClientHeight = 534
6-
ClientWidth = 817
5+
ClientHeight = 533
6+
ClientWidth = 813
77
Color = clBtnFace
88
Font.Charset = DEFAULT_CHARSET
99
Font.Color = clWindowText
@@ -15,8 +15,8 @@ object fmMain: TfmMain
1515
TextHeight = 15
1616
object BottomPanel: TPanel
1717
Left = 0
18-
Top = 423
19-
Width = 817
18+
Top = 422
19+
Width = 813
2020
Height = 78
2121
Align = alBottom
2222
TabOrder = 0
@@ -56,6 +56,7 @@ object fmMain: TfmMain
5656
BevelOuter = bvNone
5757
TabOrder = 1
5858
Visible = False
59+
ExplicitWidth = 651
5960
object WidthLabel: TLabel
6061
Left = 20
6162
Top = 15
@@ -153,8 +154,8 @@ object fmMain: TfmMain
153154
object ClientPanel: TPanel
154155
Left = 137
155156
Top = 0
156-
Width = 680
157-
Height = 423
157+
Width = 676
158+
Height = 422
158159
Align = alClient
159160
TabOrder = 1
160161
object StyledButtonGroup: TStyledButtonGroup
@@ -182,7 +183,10 @@ object fmMain: TfmMain
182183
ImageName = 'menu-Blue-grey'
183184
end>
184185
TabOrder = 0
186+
OnButtonClicked = ButtonGroupButtonClicked
185187
StyleDrawType = btRounded
188+
ExplicitLeft = -5
189+
ExplicitTop = 2
186190
end
187191
object StyledButtonGroupBootstrap: TStyledButtonGroup
188192
Left = 138
@@ -215,14 +219,16 @@ object fmMain: TfmMain
215219
StyleAppearance = 'Normal'
216220
end>
217221
TabOrder = 1
222+
OnButtonClicked = ButtonGroupButtonClicked
218223
StyleDrawType = btRounded
219224
StyleFamily = 'Bootstrap'
225+
ExplicitHeight = 420
220226
end
221227
end
222228
object Panel1: TPanel
223229
Left = 0
224-
Top = 501
225-
Width = 817
230+
Top = 500
231+
Width = 813
226232
Height = 33
227233
Align = alBottom
228234
TabOrder = 2
@@ -247,7 +253,7 @@ object fmMain: TfmMain
247253
Left = 0
248254
Top = 0
249255
Width = 137
250-
Height = 423
256+
Height = 422
251257
Align = alLeft
252258
ButtonHeight = 40
253259
ButtonWidth = 100
@@ -270,30 +276,6 @@ object fmMain: TfmMain
270276
TabOrder = 3
271277
OnButtonClicked = ButtonGroupButtonClicked
272278
end
273-
object PopupMenu: TPopupMenu
274-
Left = 525
275-
Top = 275
276-
object New1: TMenuItem
277-
Caption = '&New'
278-
OnClick = PopUpMenuClick
279-
end
280-
object Open1: TMenuItem
281-
Caption = '&Open...'
282-
OnClick = PopUpMenuClick
283-
end
284-
object Save1: TMenuItem
285-
Caption = '&Save'
286-
OnClick = PopUpMenuClick
287-
end
288-
object SaveAs1: TMenuItem
289-
Caption = 'Save &As...'
290-
OnClick = PopUpMenuClick
291-
end
292-
object Exit1: TMenuItem
293-
Caption = 'E&xit'
294-
OnClick = PopUpMenuClick
295-
end
296-
end
297279
object VirtualImageList: TVirtualImageList
298280
Images = <
299281
item

Demos/StyledButtonGroup/Delphi10.4+/MainForm.pas

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{******************************************************************************}
22
{ }
3-
{ TStyledButtonGroup Demo }
4-
{ Comparison TStyledButtonGroup with TButtonGroup }
3+
{ TStyledButtonGroup Demo }
4+
{ Comparison TStyledButtonGroup with TButtonGroup }
55
{ }
6-
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
7-
{ Author: Carlo Barazzetta }
8-
{ Contributors: }
6+
{ Copyright (c) 2022-2024 (Ethea S.r.l.) }
7+
{ Author: Carlo Barazzetta }
8+
{ Contributors: }
99
{ }
10-
{ https://github.com/EtheaDev/StyledComponents }
10+
{ https://github.com/EtheaDev/StyledComponents }
1111
{ }
1212
{******************************************************************************}
1313
{ }
@@ -60,12 +60,6 @@ TfmMain = class(TForm)
6060
tbHeight: TTrackBar;
6161
ShowCaptionCheckBox: TCheckBox;
6262
FullSizeCheckBox: TCheckBox;
63-
PopupMenu: TPopupMenu;
64-
New1: TMenuItem;
65-
Open1: TMenuItem;
66-
Save1: TMenuItem;
67-
SaveAs1: TMenuItem;
68-
Exit1: TMenuItem;
6963
Panel1: TPanel;
7064
cbChangeStyle: TComboBox;
7165
StyleLabel: TLabel;
@@ -80,7 +74,6 @@ TfmMain = class(TForm)
8074
procedure FormCreate(Sender: TObject);
8175
procedure CreateButtonClick(Sender: TObject);
8276
procedure UpdateButtonGroups(Sender: TObject);
83-
procedure PopUpMenuClick(Sender: TObject);
8477
procedure cbChangeStyleSelect(Sender: TObject);
8578
procedure ButtonGroupButtonClicked(Sender: TObject; Index: Integer);
8679
procedure cbCaptionAlignmentSelect(Sender: TObject);
@@ -203,6 +196,7 @@ procedure TfmMain.CreateStyledButtonGroup;
203196
FStyledButtonGroup.Images := VirtualImageList;
204197
FStyledButtonGroup.ButtonWidth := BUTTON_WIDTH;
205198
FStyledButtonGroup.ButtonHeight := BUTTON_HEIGHT;
199+
FStyledButtonGroup.OnButtonClicked := ButtonGroupButtonClicked;
206200
end;
207201

208202
procedure TfmMain.CreateButtonGroup;
@@ -217,6 +211,7 @@ procedure TfmMain.CreateButtonGroup;
217211
FButtonGroup.Images := VirtualImageList;
218212
FButtonGroup.ButtonWidth := BUTTON_WIDTH;
219213
FButtonGroup.ButtonHeight := BUTTON_HEIGHT;
214+
FButtonGroup.OnButtonClicked := ButtonGroupButtonClicked;
220215
end;
221216

222217
procedure TfmMain.CreateButtonGroups;
@@ -259,15 +254,13 @@ procedure TfmMain.FormCreate(Sender: TObject);
259254
ShowCaptionCheckBox.Checked := BUTTONGROUP_SHOW_CAPTIONS;
260255
end;
261256

262-
procedure TfmMain.PopUpMenuClick(Sender: TObject);
263-
begin
264-
ShowMessage((Sender as TMenuItem).Caption);
265-
end;
266-
267257
procedure TfmMain.ButtonGroupButtonClicked(Sender: TObject; Index: Integer);
268258
begin
269-
if Sender is TGrpButtonItem then
270-
ShowMessage(TGrpButtonItem(Sender).Caption);
259+
if Sender is TButtonGroup then
260+
begin
261+
if TButtonGroup(Sender).Items[Index] is TGrpButtonItem then
262+
ShowMessage(TGrpButtonItem(TButtonGroup(Sender).Items[Index]).Caption);
263+
end;
271264
end;
272265

273266
procedure TfmMain.UpdateButtonGroups(Sender: TObject);

Demos/StyledButtonGroup/Delphi10.4+/StyledButtonGroupDemo.dpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ begin
4545
//Example to define a default Rendering Style for Styled Buttons
4646
//TStyledButtonGroup.RegisterDefaultRenderingStyle(btRounded);
4747

48-
Application.CreateForm(TfmMain, fmMain);
4948
Application.CreateForm(TdmResources, dmResources);
49+
Application.CreateForm(TfmMain, fmMain);
5050
Application.Run;
5151
end.

0 commit comments

Comments
 (0)