jvcllaz: Improved layout of JvSpecialProgress demo

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6992 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-06-01 22:43:17 +00:00
parent 68dec86999
commit 883ecc50a1
2 changed files with 138 additions and 27 deletions

View File

@ -1,10 +1,10 @@
object MainForm: TMainForm object MainForm: TMainForm
Left = 258 Left = 258
Height = 358 Height = 332
Top = 127 Top = 127
Width = 459 Width = 459
Caption = 'JvSpecialProgress Demo' Caption = 'JvSpecialProgress Demo'
ClientHeight = 358 ClientHeight = 332
ClientWidth = 459 ClientWidth = 459
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
@ -15,12 +15,18 @@ object MainForm: TMainForm
Width = 176 Width = 176
end end
object JvSpecialProgress1: TJvSpecialProgress object JvSpecialProgress1: TJvSpecialProgress
AnchorSideLeft.Control = Bevel1
AnchorSideTop.Control = Bevel1 AnchorSideTop.Control = Bevel1
AnchorSideTop.Side = asrCenter AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Bevel1
AnchorSideRight.Side = asrBottom
Left = 32 Left = 32
Height = 15 Height = 15
Top = 27 Top = 27
Width = 150 Width = 152
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 12
BorderSpacing.Right = 12
Caption = 'JvSpecialProgress1' Caption = 'JvSpecialProgress1'
Position = 50 Position = 50
end end
@ -34,64 +40,88 @@ object MainForm: TMainForm
OnChange = ScrollBar1Change OnChange = ScrollBar1Change
end end
object CbStartColor: TColorBox object CbStartColor: TColorBox
Left = 328 AnchorSideLeft.Control = Label1
AnchorSideLeft.Side = asrBottom
Left = 334
Height = 22 Height = 22
Top = 22 Top = 12
Width = 100 Width = 100
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames] Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
BorderSpacing.Left = 32
ItemHeight = 16 ItemHeight = 16
OnChange = CbStartColorChange OnChange = CbStartColorChange
TabOrder = 1 TabOrder = 1
end end
object Label1: TLabel object Label1: TLabel
AnchorSideTop.Control = CbStartColor
AnchorSideTop.Side = asrCenter
Left = 245 Left = 245
Height = 15 Height = 15
Top = 26 Top = 16
Width = 57 Width = 57
Caption = 'Start color:' Caption = 'Start color:'
ParentColor = False ParentColor = False
end end
object Label2: TLabel object Label2: TLabel
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbEndColor
AnchorSideTop.Side = asrCenter
Left = 245 Left = 245
Height = 15 Height = 15
Top = 60 Top = 44
Width = 53 Width = 53
Caption = 'End color:' Caption = 'End color:'
ParentColor = False ParentColor = False
end end
object CbEndColor: TColorBox object CbEndColor: TColorBox
Left = 328 AnchorSideLeft.Control = CbStartColor
AnchorSideTop.Control = CbStartColor
AnchorSideTop.Side = asrBottom
Left = 334
Height = 22 Height = 22
Top = 56 Top = 40
Width = 100 Width = 100
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames] Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
BorderSpacing.Top = 6
ItemHeight = 16 ItemHeight = 16
OnChange = CbEndColorChange OnChange = CbEndColorChange
TabOrder = 2 TabOrder = 2
end end
object CbGradientBlocks: TCheckBox object CbGradientBlocks: TCheckBox
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbEndColor
AnchorSideTop.Side = asrBottom
Left = 245 Left = 245
Height = 19 Height = 19
Top = 96 Top = 74
Width = 102 Width = 102
BorderSpacing.Top = 12
Caption = 'Gradient blocks' Caption = 'Gradient blocks'
OnChange = CbGradientBlocksChange OnChange = CbGradientBlocksChange
TabOrder = 3 TabOrder = 3
end end
object CbSolid: TCheckBox object CbSolid: TCheckBox
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbGradientBlocks
AnchorSideTop.Side = asrBottom
Left = 245 Left = 245
Height = 19 Height = 19
Top = 128 Top = 99
Width = 46 Width = 46
BorderSpacing.Top = 6
Caption = 'Solid' Caption = 'Solid'
OnChange = CbSolidChange OnChange = CbSolidChange
TabOrder = 4 TabOrder = 4
end end
object CbBorder: TCheckBox object CbBorder: TCheckBox
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbSolid
AnchorSideTop.Side = asrBottom
Left = 245 Left = 245
Height = 19 Height = 19
Top = 159 Top = 124
Width = 55 Width = 55
BorderSpacing.Top = 6
Caption = 'Border' Caption = 'Border'
OnChange = CbBorderChange OnChange = CbBorderChange
TabOrder = 5 TabOrder = 5
@ -105,9 +135,12 @@ object MainForm: TMainForm
ParentColor = False ParentColor = False
end end
object CbBorderColor: TColorBox object CbBorderColor: TColorBox
Left = 328 AnchorSideLeft.Control = CbStartColor
AnchorSideTop.Control = Bevel2
AnchorSideTop.Side = asrCenter
Left = 334
Height = 22 Height = 22
Top = 170 Top = 135
Width = 100 Width = 100
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames] Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
ItemHeight = 16 ItemHeight = 16
@ -115,19 +148,27 @@ object MainForm: TMainForm
TabOrder = 6 TabOrder = 6
end end
object CbFlat: TCheckBox object CbFlat: TCheckBox
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbBorder
AnchorSideTop.Side = asrBottom
Left = 245 Left = 245
Height = 19 Height = 19
Top = 184 Top = 149
Width = 39 Width = 39
BorderSpacing.Top = 6
Caption = 'Flat' Caption = 'Flat'
OnChange = CbFlatChange OnChange = CbFlatChange
TabOrder = 7 TabOrder = 7
end end
object CbTextOption: TComboBox object CbTextOption: TComboBox
Left = 328 AnchorSideLeft.Control = CbStartColor
AnchorSideTop.Control = CbTextCentered
AnchorSideTop.Side = asrBottom
Left = 334
Height = 23 Height = 23
Top = 216 Top = 199
Width = 100 Width = 100
BorderSpacing.Top = 6
ItemHeight = 15 ItemHeight = 15
Items.Strings = ( Items.Strings = (
'toCaption' 'toCaption'
@ -140,55 +181,115 @@ object MainForm: TMainForm
Text = 'CbTextOption' Text = 'CbTextOption'
end end
object Label4: TLabel object Label4: TLabel
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbTextOption
AnchorSideTop.Side = asrCenter
Left = 245 Left = 245
Height = 15 Height = 15
Top = 220 Top = 203
Width = 62 Width = 62
Caption = 'Text option:' Caption = 'Text option:'
ParentColor = False ParentColor = False
end end
object CbTextCentered: TCheckBox object CbTextCentered: TCheckBox
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbFlat
AnchorSideTop.Side = asrBottom
Left = 245 Left = 245
Height = 19 Height = 19
Top = 304 Top = 174
Width = 91 Width = 91
BorderSpacing.Top = 6
Caption = 'Text centered' Caption = 'Text centered'
OnChange = CbTextCenteredChange OnChange = CbTextCenteredChange
TabOrder = 9 TabOrder = 9
end end
object EdFormat: TEdit object EdFormat: TEdit
Left = 328 AnchorSideLeft.Control = CbStartColor
AnchorSideTop.Control = CbTextOption
AnchorSideTop.Side = asrBottom
Left = 334
Height = 23 Height = 23
Top = 244 Top = 228
Width = 100 Width = 100
BorderSpacing.Top = 6
TabOrder = 10 TabOrder = 10
Text = '%0:d%% done (%1:d of %2:d).' Text = '%0:d%% done (%1:d of %2:d).'
end end
object LblFormat: TLabel object LblFormat: TLabel
Left = 247 AnchorSideLeft.Control = Label1
AnchorSideTop.Control = EdFormat
AnchorSideTop.Side = asrCenter
Left = 245
Height = 15 Height = 15
Top = 248 Top = 232
Width = 38 Width = 38
Caption = 'Format' Caption = 'Format'
FocusControl = EdFormat FocusControl = EdFormat
ParentColor = False ParentColor = False
end end
object CbTextColor: TColorBox object CbTextColor: TColorBox
Left = 328 AnchorSideLeft.Control = CbStartColor
AnchorSideTop.Control = EdFormat
AnchorSideTop.Side = asrBottom
Left = 334
Height = 22 Height = 22
Top = 272 Top = 257
Width = 100 Width = 100
Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames] Style = [cbStandardColors, cbExtendedColors, cbSystemColors, cbPrettyNames]
BorderSpacing.Top = 6
ItemHeight = 16 ItemHeight = 16
OnChange = CbTextColorChange OnChange = CbTextColorChange
TabOrder = 11 TabOrder = 11
end end
object Label5: TLabel object Label5: TLabel
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = CbTextColor
AnchorSideTop.Side = asrCenter
Left = 245 Left = 245
Height = 15 Height = 15
Top = 276 Top = 261
Width = 54 Width = 54
Caption = 'Text color:' Caption = 'Text color:'
ParentColor = False ParentColor = False
end end
object Bevel2: TBevel
AnchorSideTop.Control = CbBorder
AnchorSideBottom.Control = CbFlat
AnchorSideBottom.Side = asrBottom
Left = 192
Height = 44
Top = 124
Width = 40
Anchors = [akTop, akLeft, akBottom]
Shape = bsSpacer
end
object seHeight: TSpinEdit
AnchorSideLeft.Control = CbTextColor
AnchorSideTop.Control = CbTextColor
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = CbTextColor
AnchorSideRight.Side = asrBottom
Left = 334
Height = 23
Top = 285
Width = 100
Alignment = taRightJustify
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6
OnChange = seHeightChange
TabOrder = 12
Value = 15
end
object LblHeight: TLabel
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = seHeight
AnchorSideTop.Side = asrCenter
Left = 245
Height = 15
Top = 289
Width = 36
Caption = 'Height'
ParentColor = False
end
end end

View File

@ -6,7 +6,7 @@ interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ColorBox, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ColorBox,
ExtCtrls, JvSpecialProgress; ExtCtrls, Spin, JvSpecialProgress;
type type
@ -14,6 +14,7 @@ type
TMainForm = class(TForm) TMainForm = class(TForm)
Bevel1: TBevel; Bevel1: TBevel;
Bevel2: TBevel;
CbBorderColor: TColorBox; CbBorderColor: TColorBox;
CbTextColor: TColorBox; CbTextColor: TColorBox;
CbTextCentered: TCheckBox; CbTextCentered: TCheckBox;
@ -31,8 +32,10 @@ type
Label3: TLabel; Label3: TLabel;
Label4: TLabel; Label4: TLabel;
Label5: TLabel; Label5: TLabel;
LblHeight: TLabel;
LblFormat: TLabel; LblFormat: TLabel;
ScrollBar1: TScrollBar; ScrollBar1: TScrollBar;
seHeight: TSpinEdit;
procedure CbBorderChange(Sender: TObject); procedure CbBorderChange(Sender: TObject);
procedure CbBorderColorChange(Sender: TObject); procedure CbBorderColorChange(Sender: TObject);
procedure CbTextColorChange(Sender: TObject); procedure CbTextColorChange(Sender: TObject);
@ -45,6 +48,7 @@ type
procedure CbTextOptionChange(Sender: TObject); procedure CbTextOptionChange(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure ScrollBar1Change(Sender: TObject); procedure ScrollBar1Change(Sender: TObject);
procedure seHeightChange(Sender: TObject);
private private
FSavedCaption: String; FSavedCaption: String;
@ -66,6 +70,11 @@ begin
JvSpecialProgress1.Position := Scrollbar1.Position; JvSpecialProgress1.Position := Scrollbar1.Position;
end; end;
procedure TMainForm.seHeightChange(Sender: TObject);
begin
JvSpecialProgress1.Height := seHeight.Value;
end;
procedure TMainForm.FormCreate(Sender: TObject); procedure TMainForm.FormCreate(Sender: TObject);
begin begin
FSavedCaption := JvSpecialProgress1.Caption; FSavedCaption := JvSpecialProgress1.Caption;
@ -85,6 +94,7 @@ begin
CbTextColor.Selected := GetDefaultColor(dctFont) CbTextColor.Selected := GetDefaultColor(dctFont)
else else
CbTextColor.Selected := JvSpecialProgress1.Font.Color; CbTextColor.Selected := JvSpecialProgress1.Font.Color;
seHeight.Value := JvSpecialProgress1.Height;
end; end;
procedure TMainForm.CbStartColorChange(Sender: TObject); procedure TMainForm.CbStartColorChange(Sender: TObject);