ExCtrls: Fix some inconsistencies in ProgressBarEx demo.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9345 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
b43dfb5c82
commit
344d9b00e1
@ -12,7 +12,6 @@
|
||||
<XPManifest>
|
||||
<DpiAware Value="True"/>
|
||||
</XPManifest>
|
||||
<Icon Value="0"/>
|
||||
</General>
|
||||
<BuildModes>
|
||||
<Item Name="Default" Default="True"/>
|
||||
|
@ -6,8 +6,8 @@ object Form1: TForm1
|
||||
Caption = 'TProgressBarEx Demo'
|
||||
ClientHeight = 511
|
||||
ClientWidth = 528
|
||||
LCLVersion = '3.99.0.0'
|
||||
OnCreate = FormCreate
|
||||
LCLVersion = '2.3.0.0'
|
||||
object GroupBox1: TGroupBox
|
||||
Left = 106
|
||||
Height = 136
|
||||
@ -26,9 +26,9 @@ object Form1: TForm1
|
||||
Width = 86
|
||||
Caption = 'Normal Style'
|
||||
Checked = True
|
||||
OnChange = rbNormalStyleChange
|
||||
TabOrder = 1
|
||||
TabStop = True
|
||||
OnChange = rbNormalStyleChange
|
||||
end
|
||||
object rbMarqueeStyle: TRadioButton
|
||||
AnchorSideTop.Control = Edit1
|
||||
@ -38,8 +38,8 @@ object Form1: TForm1
|
||||
Top = 31
|
||||
Width = 93
|
||||
Caption = 'Marquee Style'
|
||||
OnChange = rbMarqueeStyleChange
|
||||
TabOrder = 0
|
||||
OnChange = rbMarqueeStyleChange
|
||||
end
|
||||
object ScrollBar1: TScrollBar
|
||||
AnchorSideTop.Control = GroupBox1
|
||||
@ -53,16 +53,14 @@ object Form1: TForm1
|
||||
OnChange = ScrollBar1Change
|
||||
end
|
||||
object Edit1: TEdit
|
||||
AnchorSideTop.Control = ScrollBar1
|
||||
AnchorSideTop.Side = asrBottom
|
||||
Left = 136
|
||||
Height = 23
|
||||
Top = 29
|
||||
Width = 257
|
||||
BorderSpacing.Top = 8
|
||||
OnChange = Edit1Change
|
||||
TabOrder = 3
|
||||
Text = 'Some text...'
|
||||
OnChange = Edit1Change
|
||||
end
|
||||
object lblMarqueeLength: TLabel
|
||||
AnchorSideTop.Control = seMarqueeLength
|
||||
@ -82,9 +80,9 @@ object Form1: TForm1
|
||||
Width = 50
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 8
|
||||
OnChange = seMarqueeLengthChange
|
||||
TabOrder = 4
|
||||
Value = 120
|
||||
OnChange = seMarqueeLengthChange
|
||||
end
|
||||
object lblMarqueeSpeed: TLabel
|
||||
AnchorSideTop.Control = seMarqueeSpeed
|
||||
@ -104,9 +102,9 @@ object Form1: TForm1
|
||||
Width = 50
|
||||
Alignment = taRightJustify
|
||||
BorderSpacing.Top = 4
|
||||
OnChange = seMarqueeSpeedChange
|
||||
TabOrder = 5
|
||||
Value = 8
|
||||
OnChange = seMarqueeSpeedChange
|
||||
end
|
||||
end
|
||||
object btnFont: TButton
|
||||
@ -115,8 +113,8 @@ object Form1: TForm1
|
||||
Top = 344
|
||||
Width = 75
|
||||
Caption = 'Font'
|
||||
OnClick = btnFontClick
|
||||
TabOrder = 1
|
||||
OnClick = btnFontClick
|
||||
end
|
||||
object ProgressBar1: TProgressBar
|
||||
Left = 13
|
||||
@ -184,8 +182,8 @@ object Form1: TForm1
|
||||
Top = 64
|
||||
Width = 164
|
||||
Caption = 'Compare with TProgressBar'
|
||||
OnChange = CheckBox1Change
|
||||
TabOrder = 3
|
||||
OnChange = CheckBox1Change
|
||||
end
|
||||
object rgOrientation: TRadioGroup
|
||||
Left = 105
|
||||
@ -211,8 +209,8 @@ object Form1: TForm1
|
||||
'right to left'
|
||||
'top down'
|
||||
)
|
||||
OnClick = rgOrientationClick
|
||||
TabOrder = 4
|
||||
OnClick = rgOrientationClick
|
||||
end
|
||||
object rgDrawingStyle: TRadioGroup
|
||||
Left = 105
|
||||
@ -239,11 +237,11 @@ object Form1: TForm1
|
||||
'shiny'
|
||||
'bevel'
|
||||
)
|
||||
OnClick = rgDrawingStyleClick
|
||||
TabOrder = 5
|
||||
OnClick = rgDrawingStyleClick
|
||||
end
|
||||
object RadioGroup1: TRadioGroup
|
||||
Left = 104
|
||||
object rgCaption: TRadioGroup
|
||||
Left = 105
|
||||
Height = 88
|
||||
Top = 408
|
||||
Width = 235
|
||||
@ -267,10 +265,10 @@ object Form1: TForm1
|
||||
'Position+Percentage'
|
||||
'Custom text'
|
||||
)
|
||||
OnClick = RadioGroup1Click
|
||||
TabOrder = 6
|
||||
OnClick = rgCaptionClick
|
||||
end
|
||||
object RadioGroup2: TRadioGroup
|
||||
object rgBorder: TRadioGroup
|
||||
Left = 374
|
||||
Height = 88
|
||||
Top = 408
|
||||
@ -295,8 +293,8 @@ object Form1: TForm1
|
||||
'Raised'
|
||||
'Etched'
|
||||
)
|
||||
OnClick = RadioGroup2Click
|
||||
TabOrder = 7
|
||||
OnClick = rgBorderClick
|
||||
end
|
||||
object Button1: TButton
|
||||
Left = 355
|
||||
@ -304,8 +302,8 @@ object Form1: TForm1
|
||||
Top = 61
|
||||
Width = 75
|
||||
Caption = 'AutoSize'
|
||||
OnClick = Button1Click
|
||||
TabOrder = 8
|
||||
OnClick = Button1Click
|
||||
end
|
||||
object FontDialog1: TFontDialog
|
||||
MinFontSize = 0
|
||||
|
@ -26,8 +26,8 @@ type
|
||||
lblMarqueeLength: TLabel;
|
||||
lblMarqueeSpeed: TLabel;
|
||||
ProgressBar1: TProgressBar;
|
||||
RadioGroup1: TRadioGroup;
|
||||
RadioGroup2: TRadioGroup;
|
||||
rgCaption: TRadioGroup;
|
||||
rgBorder: TRadioGroup;
|
||||
rbNormalStyle: TRadioButton;
|
||||
rbMarqueeStyle: TRadioButton;
|
||||
rgOrientation: TRadioGroup;
|
||||
@ -44,8 +44,8 @@ type
|
||||
procedure clbBorderColorColorChanged(Sender: TObject);
|
||||
procedure Edit1Change(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
procedure RadioGroup1Click(Sender: TObject);
|
||||
procedure RadioGroup2Click(Sender: TObject);
|
||||
procedure rgCaptionClick(Sender: TObject);
|
||||
procedure rgBorderClick(Sender: TObject);
|
||||
procedure rbNormalStyleChange(Sender: TObject);
|
||||
procedure rbMarqueeStyleChange(Sender: TObject);
|
||||
procedure rgDrawingStyleClick(Sender: TObject);
|
||||
@ -95,28 +95,41 @@ begin
|
||||
Height := Width;
|
||||
end;
|
||||
|
||||
procedure TForm1.RadioGroup1Click(Sender: TObject);
|
||||
procedure TForm1.rgCaptionClick(Sender: TObject);
|
||||
begin
|
||||
ProgressBarEx.TextMode := TProgressbarTextMode(RadioGroup1.ItemIndex);
|
||||
ProgressBarEx.TextMode := TProgressbarTextMode(rgCaption.ItemIndex);
|
||||
case ProgressBarEx.TextMode of
|
||||
tmValue: ProgressBarEx.Caption := 'Voltage: %d mV';
|
||||
tmPercent: ProgressBarEx.Caption := '%.0f%% complete';
|
||||
tmValueAndPercent: ProgressBarEx.Caption := '%1:.0f%% complete at position %0:d';
|
||||
tmCustom: ProgressBarEx.Caption := Edit1.Text;
|
||||
tmValue:
|
||||
if ProgressBarEx.Style = pbstNormal then
|
||||
ProgressBarEx.Caption := 'Voltage: %d mV'
|
||||
else
|
||||
ProgressBarEx.Caption := '';
|
||||
tmPercent:
|
||||
if ProgressBarEx.Style = pbstNormal then
|
||||
ProgressBarEx.Caption := '%.0f%% complete'
|
||||
else
|
||||
ProgressBarEx.Caption := '';
|
||||
tmValueAndPercent:
|
||||
if ProgressBarEx.Style = pbstNormal then
|
||||
ProgressBarEx.Caption := '%1:.0f%% complete at position %0:d'
|
||||
else
|
||||
ProgressBarEx.Caption := '';
|
||||
tmCustom:
|
||||
ProgressBarEx.Caption := Edit1.Text;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TForm1.RadioGroup2Click(Sender: TObject);
|
||||
procedure TForm1.rgBorderClick(Sender: TObject);
|
||||
begin
|
||||
ProgressBarEx.BorderStyle := TProgressBarBorderStyle(RadioGroup2.ItemIndex);
|
||||
ProgressBarEx.BorderStyle := TProgressBarBorderStyle(rgBorder.ItemIndex);
|
||||
end;
|
||||
|
||||
procedure TForm1.rbNormalStyleChange(Sender: TObject);
|
||||
begin
|
||||
Progressbar1.style := pbstNormal;
|
||||
Progressbar1.Style := pbstNormal;
|
||||
ProgressbarEx.Style := pbstNormal;
|
||||
ProgressbarEx.Caption := IntToStr(ProgressbarEx.Position);
|
||||
Scrollbar1.Position := ProgressbarEx.Position;
|
||||
rgCaptionClick(nil);
|
||||
ProgressbarEx.Position := Scrollbar1.Position;
|
||||
Scrollbar1.Show;
|
||||
end;
|
||||
|
||||
|
@ -515,6 +515,7 @@ begin
|
||||
FTimer.Enabled := true;
|
||||
end;
|
||||
end;
|
||||
Invalidate;
|
||||
end;
|
||||
|
||||
procedure TProgressBarEx.SetTextMode(AValue: TProgressBarTextMode);
|
||||
|
Loading…
Reference in New Issue
Block a user