You've already forked lazarus-ccr
ExCtrls/TProgressBarEx: Add border styles, AutoSize, improved captions.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8782 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,26 +1,28 @@
|
||||
object Form1: TForm1
|
||||
Left = 261
|
||||
Height = 465
|
||||
Height = 567
|
||||
Top = 130
|
||||
Width = 473
|
||||
Caption = 'TProgressBarEx Demo'
|
||||
ClientHeight = 465
|
||||
ClientHeight = 567
|
||||
ClientWidth = 473
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '2.3.0.0'
|
||||
object GroupBox1: TGroupBox
|
||||
Left = 105
|
||||
Height = 160
|
||||
Top = 112
|
||||
Left = 106
|
||||
Height = 136
|
||||
Top = 88
|
||||
Width = 347
|
||||
Caption = 'Style'
|
||||
ClientHeight = 140
|
||||
ClientHeight = 116
|
||||
ClientWidth = 343
|
||||
TabOrder = 0
|
||||
object rbNormalStyle: TRadioButton
|
||||
AnchorSideTop.Control = ScrollBar1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 20
|
||||
Height = 19
|
||||
Top = 9
|
||||
Top = 3
|
||||
Width = 86
|
||||
Caption = 'Normal Style'
|
||||
Checked = True
|
||||
@ -29,28 +31,35 @@ object Form1: TForm1
|
||||
TabStop = True
|
||||
end
|
||||
object rbMarqueeStyle: TRadioButton
|
||||
AnchorSideTop.Control = Edit1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 20
|
||||
Height = 19
|
||||
Top = 45
|
||||
Top = 31
|
||||
Width = 93
|
||||
Caption = 'Marquee Style'
|
||||
OnChange = rbMarqueeStyleChange
|
||||
TabOrder = 0
|
||||
end
|
||||
object ScrollBar1: TScrollBar
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
Left = 136
|
||||
Height = 17
|
||||
Top = 11
|
||||
Top = 4
|
||||
Width = 201
|
||||
BorderSpacing.Top = 4
|
||||
PageSize = 0
|
||||
TabOrder = 2
|
||||
OnChange = ScrollBar1Change
|
||||
end
|
||||
object Edit1: TEdit
|
||||
AnchorSideTop.Control = ScrollBar1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 136
|
||||
Height = 23
|
||||
Top = 45
|
||||
Top = 29
|
||||
Width = 201
|
||||
BorderSpacing.Top = 8
|
||||
OnChange = Edit1Change
|
||||
TabOrder = 3
|
||||
Text = 'Some text...'
|
||||
@ -60,16 +69,19 @@ object Form1: TForm1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 136
|
||||
Height = 15
|
||||
Top = 76
|
||||
Top = 62
|
||||
Width = 84
|
||||
Caption = 'Marquee length'
|
||||
end
|
||||
object seMarqueeLength: TSpinEdit
|
||||
AnchorSideTop.Control = rbMarqueeStyle
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 240
|
||||
Height = 23
|
||||
Top = 72
|
||||
Top = 58
|
||||
Width = 50
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 8
|
||||
OnChange = seMarqueeLengthChange
|
||||
TabOrder = 4
|
||||
Value = 120
|
||||
@ -79,25 +91,28 @@ object Form1: TForm1
|
||||
AnchorSideTop.Side = asrCenter
|
||||
Left = 139
|
||||
Height = 15
|
||||
Top = 108
|
||||
Top = 89
|
||||
Width = 81
|
||||
Caption = 'Marquee speed'
|
||||
end
|
||||
object seMarqueeSpeed: TSpinEdit
|
||||
AnchorSideTop.Control = seMarqueeLength
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 240
|
||||
Height = 23
|
||||
Top = 104
|
||||
Top = 85
|
||||
Width = 50
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 4
|
||||
OnChange = seMarqueeSpeedChange
|
||||
TabOrder = 5
|
||||
Value = 8
|
||||
end
|
||||
end
|
||||
object btnFont: TButton
|
||||
Left = 304
|
||||
Left = 310
|
||||
Height = 25
|
||||
Top = 416
|
||||
Top = 344
|
||||
Width = 75
|
||||
Caption = 'Font'
|
||||
OnClick = btnFontClick
|
||||
@ -112,9 +127,9 @@ object Form1: TForm1
|
||||
Visible = False
|
||||
end
|
||||
object clbBackColor: TColorButton
|
||||
Left = 298
|
||||
Left = 305
|
||||
Height = 25
|
||||
Top = 296
|
||||
Top = 232
|
||||
Width = 146
|
||||
BorderWidth = 2
|
||||
ButtonColorAutoSize = False
|
||||
@ -125,9 +140,9 @@ object Form1: TForm1
|
||||
OnColorChanged = clbBackColorColorChanged
|
||||
end
|
||||
object clbBarColor: TColorButton
|
||||
Left = 297
|
||||
Left = 304
|
||||
Height = 25
|
||||
Top = 323
|
||||
Top = 259
|
||||
Width = 146
|
||||
BorderWidth = 2
|
||||
ButtonColorAutoSize = False
|
||||
@ -138,9 +153,9 @@ object Form1: TForm1
|
||||
OnColorChanged = clbBarColorColorChanged
|
||||
end
|
||||
object clbGradientEndColor: TColorButton
|
||||
Left = 297
|
||||
Left = 304
|
||||
Height = 25
|
||||
Top = 351
|
||||
Top = 287
|
||||
Width = 146
|
||||
BorderWidth = 2
|
||||
ButtonColorAutoSize = False
|
||||
@ -151,9 +166,9 @@ object Form1: TForm1
|
||||
OnColorChanged = clbGradientEndColorColorChanged
|
||||
end
|
||||
object clbBorderColor: TColorButton
|
||||
Left = 297
|
||||
Left = 304
|
||||
Height = 25
|
||||
Top = 379
|
||||
Top = 315
|
||||
Width = 146
|
||||
BorderWidth = 2
|
||||
ButtonColorAutoSize = False
|
||||
@ -166,16 +181,16 @@ object Form1: TForm1
|
||||
object CheckBox1: TCheckBox
|
||||
Left = 105
|
||||
Height = 19
|
||||
Top = 80
|
||||
Top = 64
|
||||
Width = 164
|
||||
Caption = 'Compare with TProgressBar'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 3
|
||||
end
|
||||
object rgOrientation: TRadioGroup
|
||||
Left = 104
|
||||
Left = 105
|
||||
Height = 64
|
||||
Top = 280
|
||||
Top = 232
|
||||
Width = 190
|
||||
AutoFill = True
|
||||
Caption = 'Orientation'
|
||||
@ -200,9 +215,9 @@ object Form1: TForm1
|
||||
TabOrder = 4
|
||||
end
|
||||
object rgDrawingStyle: TRadioGroup
|
||||
Left = 104
|
||||
Left = 105
|
||||
Height = 81
|
||||
Top = 360
|
||||
Top = 304
|
||||
Width = 185
|
||||
AutoFill = True
|
||||
Caption = 'Drawing style'
|
||||
@ -227,10 +242,74 @@ object Form1: TForm1
|
||||
OnClick = rgDrawingStyleClick
|
||||
TabOrder = 5
|
||||
end
|
||||
object RadioGroup1: TRadioGroup
|
||||
Left = 105
|
||||
Height = 64
|
||||
Top = 392
|
||||
Width = 185
|
||||
AutoFill = True
|
||||
Caption = 'Caption'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 44
|
||||
ClientWidth = 181
|
||||
Columns = 2
|
||||
ItemIndex = 0
|
||||
Items.Strings = (
|
||||
'None'
|
||||
'Position'
|
||||
'Percentage'
|
||||
'Custom text'
|
||||
)
|
||||
OnClick = RadioGroup1Click
|
||||
TabOrder = 6
|
||||
end
|
||||
object RadioGroup2: TRadioGroup
|
||||
Left = 304
|
||||
Height = 80
|
||||
Top = 376
|
||||
Width = 140
|
||||
AutoFill = True
|
||||
Caption = 'Border'
|
||||
ChildSizing.LeftRightSpacing = 6
|
||||
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
|
||||
ChildSizing.EnlargeVertical = crsHomogenousChildResize
|
||||
ChildSizing.ShrinkHorizontal = crsScaleChilds
|
||||
ChildSizing.ShrinkVertical = crsScaleChilds
|
||||
ChildSizing.Layout = cclLeftToRightThenTopToBottom
|
||||
ChildSizing.ControlsPerLine = 2
|
||||
ClientHeight = 60
|
||||
ClientWidth = 136
|
||||
Columns = 2
|
||||
ItemIndex = 1
|
||||
Items.Strings = (
|
||||
'None'
|
||||
'Flat'
|
||||
'Sunken'
|
||||
'Raised'
|
||||
'Etched'
|
||||
)
|
||||
OnClick = RadioGroup2Click
|
||||
TabOrder = 7
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 355
|
||||
Height = 25
|
||||
Top = 61
|
||||
Width = 75
|
||||
Caption = 'AutoSize'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 8
|
||||
end
|
||||
object FontDialog1: TFontDialog
|
||||
MinFontSize = 0
|
||||
MaxFontSize = 0
|
||||
Left = 408
|
||||
Top = 408
|
||||
Top = 344
|
||||
end
|
||||
end
|
||||
|
@ -14,6 +14,7 @@ type
|
||||
|
||||
TForm1 = class(TForm)
|
||||
btnFont: TButton;
|
||||
Button1: TButton;
|
||||
CheckBox1: TCheckBox;
|
||||
clbBackColor: TColorButton;
|
||||
clbBarColor: TColorButton;
|
||||
@ -25,6 +26,8 @@ type
|
||||
lblMarqueeLength: TLabel;
|
||||
lblMarqueeSpeed: TLabel;
|
||||
ProgressBar1: TProgressBar;
|
||||
RadioGroup1: TRadioGroup;
|
||||
RadioGroup2: TRadioGroup;
|
||||
rbNormalStyle: TRadioButton;
|
||||
rbMarqueeStyle: TRadioButton;
|
||||
rgOrientation: TRadioGroup;
|
||||
@ -33,6 +36,7 @@ type
|
||||
seMarqueeLength: TSpinEdit;
|
||||
seMarqueeSpeed: TSpinEdit;
|
||||
procedure btnFontClick(Sender: TObject);
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure CheckBox1Change(Sender: TObject);
|
||||
procedure clbBackColorColorChanged(Sender: TObject);
|
||||
procedure clbBarColorColorChanged(Sender: TObject);
|
||||
@ -40,6 +44,8 @@ type
|
||||
procedure clbBorderColorColorChanged(Sender: TObject);
|
||||
procedure Edit1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure RadioGroup1Click(Sender: TObject);
|
||||
procedure RadioGroup2Click(Sender: TObject);
|
||||
procedure rbNormalStyleChange(Sender: TObject);
|
||||
procedure rbMarqueeStyleChange(Sender: TObject);
|
||||
procedure rgDrawingStyleClick(Sender: TObject);
|
||||
@ -69,6 +75,7 @@ begin
|
||||
ProgressbarEx.Left := 8;
|
||||
ProgressbarEx.Top := 8;
|
||||
ProgressbarEx.Width := 450;
|
||||
ProgressbarEx.Height := 32;
|
||||
ProgressbarEx.Parent := self;
|
||||
Progressbarex.Position := 75;
|
||||
|
||||
@ -87,6 +94,21 @@ begin
|
||||
Height := Width;
|
||||
end;
|
||||
|
||||
procedure TForm1.RadioGroup1Click(Sender: TObject);
|
||||
begin
|
||||
ProgressBarEx.TextMode := TProgressbarTextMode(RadioGroup1.ItemIndex);
|
||||
case ProgressBarEx.TextMode of
|
||||
tmValue: ProgressBarEx.Caption := 'Voltage: %.0f mV';
|
||||
tmPercent: ProgressBarEx.Caption := '%.1f%% complete';
|
||||
tmCustom: ProgressBarEx.Caption := Edit1.Text;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.RadioGroup2Click(Sender: TObject);
|
||||
begin
|
||||
ProgressBarEx.BorderStyle := TProgressBarBorderStyle(RadioGroup2.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TForm1.rbNormalStyleChange(Sender: TObject);
|
||||
begin
|
||||
Progressbar1.style := pbstNormal;
|
||||
@ -141,6 +163,11 @@ begin
|
||||
ProgressbarEx.Font := FontDialog1.Font;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
ProgressbarEx.AutoSize := true;
|
||||
end;
|
||||
|
||||
procedure TForm1.CheckBox1Change(Sender: TObject);
|
||||
begin
|
||||
Progressbar1.Visible := Checkbox1.Checked;
|
||||
@ -169,8 +196,6 @@ end;
|
||||
procedure TForm1.ScrollBar1Change(Sender: TObject);
|
||||
begin
|
||||
ProgressbarEx.Position := Scrollbar1.Position;
|
||||
ProgressbarEx.Caption := IntToStr(Scrollbar1.Position);
|
||||
|
||||
Progressbar1.Position := Scrollbar1.Position;
|
||||
end;
|
||||
|
||||
|
Reference in New Issue
Block a user