jvcllaz: Add demo for TJvValidateEdit

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6666 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-09-28 21:54:24 +00:00
parent f9640cf3bc
commit 28898c8317
6 changed files with 1298 additions and 0 deletions

View File

@ -0,0 +1,716 @@
object frmValidateEditDemo: TfrmValidateEditDemo
Left = 371
Height = 567
Top = 232
Width = 547
AutoSize = True
BorderStyle = bsDialog
Caption = 'JvValidateEdit Demo'
ClientHeight = 567
ClientWidth = 547
Color = clBtnFace
Constraints.MinHeight = 170
Constraints.MinWidth = 325
DefaultMonitor = dmDesktop
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnCreate = FormCreate
Position = poScreenCenter
LCLVersion = '2.1.0.0'
Scaled = False
object GroupBox1: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 16
Height = 269
Top = 16
Width = 487
AutoSize = True
BorderSpacing.Around = 16
Caption = 'Properties'
ClientHeight = 251
ClientWidth = 483
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 0
object Label1: TLabel
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideTop.Control = GroupBox1
Left = 12
Height = 13
Top = 8
Width = 75
BorderSpacing.Top = 8
Caption = 'Display Format:'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object Label3: TLabel
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideTop.Side = asrBottom
AnchorSideBottom.Control = edCheckChars
Left = 12
Height = 13
Top = 109
Width = 64
Anchors = [akLeft, akBottom]
BorderSpacing.Top = 11
BorderSpacing.Bottom = 4
Caption = 'Check Chars:'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object Label4: TLabel
AnchorSideTop.Control = seDecimalPlaces
AnchorSideTop.Side = asrCenter
Left = 236
Height = 13
Top = 105
Width = 69
Caption = 'Decimal Places'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object Label6: TLabel
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideTop.Control = edDisplayPrefix
AnchorSideTop.Side = asrCenter
Left = 12
Height = 13
Top = 54
Width = 65
Caption = 'Display Prefix'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object Label7: TLabel
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideTop.Control = edDisplaySuffix
AnchorSideTop.Side = asrCenter
Left = 12
Height = 13
Top = 79
Width = 65
Caption = 'Display Suffix'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object cbDisplayFormat: TComboBox
AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
Left = 12
Height = 21
Top = 25
Width = 193
BorderSpacing.Left = 12
BorderSpacing.Top = 4
DropDownCount = 24
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ItemHeight = 13
OnChange = cbDisplayFormatChange
OnKeyPress = cbDisplayFormatKeyPress
ParentFont = False
Style = csDropDownList
TabOrder = 0
end
object chkHasMaxValue: TCheckBox
AnchorSideLeft.Control = chkZeroEmpty
AnchorSideTop.Control = chkZeroEmpty
AnchorSideTop.Side = asrBottom
Left = 221
Height = 19
Top = 52
Width = 85
BorderSpacing.Top = 6
Caption = 'Has Maximum'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = chkHasMaxValueClick
ParentFont = False
TabOrder = 1
end
object chkHasMinValue: TCheckBox
AnchorSideLeft.Control = chkZeroEmpty
AnchorSideTop.Control = edMinValue
AnchorSideTop.Side = asrCenter
Left = 221
Height = 19
Top = 77
Width = 81
Caption = 'Has Minimum'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = chkHasMinValueClick
ParentFont = False
TabOrder = 2
end
object seDecimalPlaces: TSpinEdit
AnchorSideLeft.Control = edMaxValue
AnchorSideTop.Control = edMinValue
AnchorSideTop.Side = asrBottom
Left = 318
Height = 21
Top = 101
Width = 49
BorderSpacing.Top = 4
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
MaxValue = 0
OnChange = seDecimalPlacesChange
ParentFont = False
TabOrder = 3
Value = 2
end
object chkZeroEmpty: TCheckBox
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox1
Left = 221
Height = 19
Top = 27
Width = 89
BorderSpacing.Left = 16
BorderSpacing.Top = 27
Caption = 'Empty if Zero?'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = chkZeroEmptyClick
ParentFont = False
TabOrder = 4
end
object edCheckChars: TEdit
AnchorSideLeft.Control = cbDisplayFormat
AnchorSideTop.Control = btnCheckChars
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = btnCheckChars
Left = 12
Height = 21
Top = 126
Width = 298
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 5
end
object btnCheckChars: TButton
AnchorSideLeft.Control = edMaxValue
AnchorSideTop.Control = seDecimalPlaces
AnchorSideTop.Side = asrBottom
Left = 318
Height = 21
Top = 126
Width = 49
BorderSpacing.Top = 4
Caption = 'Set'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = btnCheckCharsClick
ParentFont = False
TabOrder = 6
end
object edDisplayPrefix: TEdit
AnchorSideLeft.Control = Label6
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbDisplayFormat
AnchorSideTop.Side = asrBottom
Left = 93
Height = 21
Top = 50
Width = 57
BorderSpacing.Left = 16
BorderSpacing.Top = 4
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 7
end
object edDisplaySuffix: TEdit
AnchorSideLeft.Control = edDisplayPrefix
AnchorSideTop.Control = edDisplayPrefix
AnchorSideTop.Side = asrBottom
Left = 93
Height = 21
Top = 75
Width = 57
BorderSpacing.Top = 4
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 8
end
object btnSetDisplayPrefix: TButton
AnchorSideLeft.Control = edDisplayPrefix
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edDisplayPrefix
AnchorSideTop.Side = asrCenter
Left = 158
Height = 21
Top = 50
Width = 47
BorderSpacing.Left = 8
BorderSpacing.Top = 4
Caption = 'Set'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = btnSetDisplayPrefixClick
ParentFont = False
TabOrder = 9
end
object btnSetDisplaySuffix: TButton
AnchorSideLeft.Control = btnSetDisplayPrefix
AnchorSideTop.Control = edDisplaySuffix
AnchorSideTop.Side = asrCenter
Left = 158
Height = 21
Top = 75
Width = 47
BorderSpacing.Top = 3
Caption = 'Set'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = btnSetDisplaySuffixClick
ParentFont = False
TabOrder = 10
end
object edMaxValue: TEdit
AnchorSideLeft.Control = chkHasMaxValue
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = chkHasMaxValue
AnchorSideTop.Side = asrCenter
Left = 318
Height = 21
Top = 51
Width = 49
BorderSpacing.Left = 12
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnExit = edMaxValueExit
ParentFont = False
TabOrder = 11
end
object edMinValue: TEdit
AnchorSideLeft.Control = edMaxValue
AnchorSideTop.Control = edMaxValue
AnchorSideTop.Side = asrBottom
Left = 318
Height = 21
Top = 76
Width = 49
BorderSpacing.Top = 4
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnExit = edMinValueExit
ParentFont = False
TabOrder = 12
end
object GroupBox3: TGroupBox
AnchorSideTop.Control = edCheckChars
AnchorSideTop.Side = asrBottom
Left = 12
Height = 80
Top = 159
Width = 459
AutoSize = True
BorderSpacing.Around = 12
Caption = 'Critical Points'
ClientHeight = 62
ClientWidth = 455
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 13
object Label9: TLabel
AnchorSideLeft.Control = edCPMaxValue
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = colCPAbove
AnchorSideTop.Side = asrCenter
Left = 307
Height = 13
Top = 8
Width = 31
BorderSpacing.Left = 16
Caption = 'Colour'
ParentColor = False
end
object Label11: TLabel
AnchorSideLeft.Control = Label9
AnchorSideTop.Control = colCPBelow
AnchorSideTop.Side = asrCenter
Left = 307
Height = 13
Top = 34
Width = 31
Caption = 'Colour'
ParentColor = False
end
object Label12: TLabel
AnchorSideLeft.Control = cbCPCheckPoints
AnchorSideBottom.Control = cbCPCheckPoints
Left = 12
Height = 13
Top = 12
Width = 65
Anchors = [akLeft, akBottom]
BorderSpacing.Bottom = 4
Caption = 'Check Points:'
ParentColor = False
end
object edCPMaxValue: TEdit
AnchorSideLeft.Control = chkMaxValueIncluded
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox3
Left = 242
Height = 21
Top = 4
Width = 49
BorderSpacing.Left = 16
BorderSpacing.Top = 4
OnExit = edCPMaxValueExit
TabOrder = 0
Text = '10'
end
object colCPAbove: TColorBox
AnchorSideLeft.Control = Label9
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edCPMaxValue
AnchorSideTop.Side = asrCenter
Left = 342
Height = 22
Top = 3
Width = 105
BorderSpacing.Left = 4
ItemHeight = 16
TabOrder = 1
end
object edCPMinValue: TEdit
AnchorSideLeft.Control = edCPMaxValue
AnchorSideTop.Control = edCPMaxValue
AnchorSideTop.Side = asrBottom
Left = 242
Height = 21
Top = 29
Width = 49
BorderSpacing.Top = 4
OnExit = edCPMinValueExit
TabOrder = 2
Text = '-10'
end
object colCPBelow: TColorBox
AnchorSideLeft.Control = colCPAbove
AnchorSideTop.Control = edCPMinValue
Left = 342
Height = 22
Top = 29
Width = 105
BorderSpacing.Right = 8
BorderSpacing.Bottom = 6
ItemHeight = 16
TabOrder = 3
end
object cbCPCheckPoints: TComboBox
AnchorSideLeft.Control = GroupBox3
AnchorSideTop.Control = edCPMinValue
AnchorSideTop.Side = asrCenter
Left = 12
Height = 21
Top = 29
Width = 89
BorderSpacing.Left = 12
BorderSpacing.Bottom = 12
DropDownCount = 24
ItemHeight = 13
OnChange = cbCPCheckPointsChange
Style = csDropDownList
TabOrder = 4
end
object chkMaxValueIncluded: TCheckBox
AnchorSideLeft.Control = chkMinValueIncluded
AnchorSideTop.Control = edCPMaxValue
AnchorSideTop.Side = asrCenter
Left = 113
Height = 19
Top = 5
Width = 113
Caption = 'Max Value Included'
OnClick = chkMaxValueIncludedClick
TabOrder = 5
end
object chkMinValueIncluded: TCheckBox
AnchorSideLeft.Control = cbCPCheckPoints
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edCPMinValue
AnchorSideTop.Side = asrCenter
Left = 113
Height = 19
Top = 30
Width = 109
BorderSpacing.Left = 12
Caption = 'Min Value Included'
OnClick = chkMinValueIncludedClick
TabOrder = 6
end
end
end
object GroupBox2: TGroupBox
AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = GroupBox4
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 16
Height = 124
Top = 395
Width = 487
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Bottom = 16
Caption = 'Set To'
ClientHeight = 106
ClientWidth = 483
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 1
object Label5: TLabel
AnchorSideLeft.Control = GroupBox2
AnchorSideTop.Control = edSetTo
AnchorSideTop.Side = asrCenter
Left = 12
Height = 13
Top = 12
Width = 26
BorderSpacing.Left = 12
Caption = 'Value'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentColor = False
ParentFont = False
end
object edSetTo: TEdit
AnchorSideLeft.Control = Label5
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = GroupBox2
Left = 46
Height = 21
Top = 8
Width = 121
BorderSpacing.Left = 8
BorderSpacing.Top = 8
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 0
end
object rgSetToType: TRadioGroup
AnchorSideLeft.Control = Label5
AnchorSideTop.Control = edSetTo
AnchorSideTop.Side = asrBottom
AnchorSideRight.Side = asrBottom
Left = 12
Height = 49
Top = 41
Width = 258
AutoFill = True
AutoSize = True
BorderSpacing.Top = 12
BorderSpacing.Bottom = 16
BorderSpacing.InnerBorder = 6
Caption = 'as Type'
ChildSizing.LeftRightSpacing = 6
ChildSizing.HorizontalSpacing = 8
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 4
ClientHeight = 31
ClientWidth = 254
Columns = 4
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ItemIndex = 3
Items.Strings = (
'Currency'
'Float'
'Integer'
'Text'
)
ParentFont = False
TabOrder = 1
end
object btnSetTo: TButton
AnchorSideLeft.Control = edSetTo
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edSetTo
AnchorSideTop.Side = asrCenter
Left = 171
Height = 23
Top = 7
Width = 42
AutoSize = True
BorderSpacing.Left = 4
Caption = 'Set'
Default = True
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = btnSetToClick
ParentFont = False
TabOrder = 2
end
object chkAsVariant: TCheckBox
AnchorSideLeft.Control = btnSetTo
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edSetTo
AnchorSideTop.Side = asrCenter
Left = 229
Height = 19
Top = 9
Width = 68
BorderSpacing.Left = 16
Caption = 'as Variant'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 3
end
object btnSetToPI: TButton
AnchorSideLeft.Control = chkAsVariant
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = edSetTo
AnchorSideTop.Side = asrCenter
Left = 313
Height = 23
Top = 7
Width = 66
AutoSize = True
BorderSpacing.Left = 16
Caption = 'Set to pi'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
OnClick = btnSetToPIClick
ParentFont = False
TabOrder = 4
end
end
object GroupBox4: TGroupBox
AnchorSideLeft.Control = GroupBox1
AnchorSideTop.Control = GroupBox1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = GroupBox1
AnchorSideRight.Side = asrBottom
Left = 16
Height = 78
Top = 301
Width = 487
Anchors = [akTop, akLeft, akRight]
AutoSize = True
BorderSpacing.Bottom = 16
Caption = 'Validate Edit'
ClientHeight = 60
ClientWidth = 483
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
Font.Style = [fsBold]
ParentFont = False
TabOrder = 2
object chkValueChanged: TCheckBox
AnchorSideTop.Control = JvValidateEdit
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = JvValidateEdit
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = GroupBox4
AnchorSideBottom.Side = asrBottom
Left = 320
Height = 19
Top = 29
Width = 151
Anchors = [akTop, akRight]
BorderSpacing.Top = 4
BorderSpacing.Bottom = 12
Caption = 'Message on Value Change?'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
ParentFont = False
TabOrder = 0
end
object JvValidateEdit: TJvValidateEdit
AnchorSideLeft.Control = GroupBox4
AnchorSideTop.Control = GroupBox4
AnchorSideRight.Control = GroupBox4
AnchorSideRight.Side = asrBottom
Left = 12
Height = 21
Top = 4
Width = 459
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Left = 12
BorderSpacing.Top = 4
BorderSpacing.Right = 12
CriticalPoints.MaxValue = 10
CriticalPoints.MinValue = -10
CriticalPoints.MaxValueIncluded = False
CriticalPoints.MinValueIncluded = False
DisplayFormat = dfFloat
DecimalPlaces = 2
EditText = '0'
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Shell Dlg 2'
MaxValue = 0
MinValue = 0
ParentFont = False
TabOrder = 1
OnCustomValidate = JvValidateEditCustomValidate
OnValueChanged = JvValidateEditValueChanged
end
end
end