2016-11-29 09:53:31 +00:00
object frmMain: TfrmMain
Left = 306
2019-05-25 14:09:05 +00:00
Height = 270
2016-11-29 09:53:31 +00:00
Top = 126
2019-05-25 14:09:05 +00:00
Width = 519
AutoSize = True
2016-11-29 09:53:31 +00:00
Caption = 'JvValidators demo'
2019-05-25 14:09:05 +00:00
ClientHeight = 270
ClientWidth = 519
2016-11-29 09:53:31 +00:00
Color = clBtnFace
DefaultMonitor = dmDesktop
Font.Color = clWindowText
OnCreate = FormCreate
2019-05-25 14:09:05 +00:00
OnShow = FormShow
2016-11-29 09:53:31 +00:00
Position = poScreenCenter
2019-05-25 14:09:05 +00:00
LCLVersion = '2.1.0.0'
2016-11-29 09:53:31 +00:00
object Label1: TLabel
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
2016-11-29 09:53:31 +00:00
Left = 16
Height = 15
Top = 16
Width = 167
2019-05-25 14:09:05 +00:00
BorderSpacing.Left = 16
BorderSpacing.Top = 16
2016-11-29 09:53:31 +00:00
Caption = 'This edit must have a(ny) value:'
FocusControl = edRequired
ParentColor = False
end
object Label2: TLabel
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = edRequired
AnchorSideTop.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 15
2019-05-25 14:09:05 +00:00
Top = 66
2016-11-29 09:53:31 +00:00
Width = 233
2019-05-25 14:09:05 +00:00
BorderSpacing.Top = 8
2016-11-29 09:53:31 +00:00
Caption = 'This edit must have more than 9 characters:'
FocusControl = edRequired10Chars
ParentColor = False
end
object Label3: TLabel
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = edRequired10Chars
AnchorSideTop.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 15
2019-05-25 14:09:05 +00:00
Top = 116
2016-11-29 09:53:31 +00:00
Width = 228
2019-05-25 14:09:05 +00:00
BorderSpacing.Top = 8
2016-11-29 09:53:31 +00:00
Caption = 'This edit must match the reg. expr."A.B.C.":'
FocusControl = edRegExpr
ParentColor = False
end
object Label4: TLabel
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = edRegExpr
AnchorSideTop.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 15
2019-05-25 14:09:05 +00:00
Top = 162
2016-11-29 09:53:31 +00:00
Width = 201
2019-05-25 14:09:05 +00:00
BorderSpacing.Top = 8
2016-11-29 09:53:31 +00:00
Caption = 'The value must be between 0 and 100:'
FocusControl = edRange0to100
ParentColor = False
end
object Label5: TLabel
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = edRequired10Chars
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Label1
Left = 281
2016-11-29 09:53:31 +00:00
Height = 15
Top = 16
Width = 35
2019-05-25 14:09:05 +00:00
BorderSpacing.Left = 32
2016-11-29 09:53:31 +00:00
Caption = 'Result:'
ParentColor = False
end
object edRequired: TEdit
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label1
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = edRequired10Chars
AnchorSideRight.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 23
2019-05-25 14:09:05 +00:00
Top = 35
Width = 233
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
2016-11-29 09:53:31 +00:00
TabOrder = 0
end
object edRequired10Chars: TEdit
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label2
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = Label2
AnchorSideRight.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 23
2019-05-25 14:09:05 +00:00
Top = 85
Width = 233
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
2016-11-29 09:53:31 +00:00
TabOrder = 1
end
object edRegExpr: TEdit
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label3
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = edRequired10Chars
AnchorSideRight.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 23
2019-05-25 14:09:05 +00:00
Top = 131
Width = 233
Anchors = [akTop, akLeft, akRight]
2016-11-29 09:53:31 +00:00
TabOrder = 2
end
object edRange0to100: TEdit
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = Label4
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = udRange0to100
2016-11-29 09:53:31 +00:00
Left = 16
Height = 23
2019-05-25 14:09:05 +00:00
Top = 181
Width = 212
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 4
BorderSpacing.Right = 4
2016-11-29 09:53:31 +00:00
TabOrder = 3
Text = '-1'
end
object udRange0to100: TUpDown
2019-05-25 14:09:05 +00:00
AnchorSideRight.Control = edRequired10Chars
AnchorSideRight.Side = asrBottom
Left = 232
2016-11-29 09:53:31 +00:00
Height = 23
2019-05-25 14:09:05 +00:00
Top = 181
Width = 17
Anchors = [akTop, akRight]
2016-11-29 09:53:31 +00:00
Associate = edRange0to100
Max = 200
Min = -100
Position = -1
TabOrder = 4
end
object btnCheck: TButton
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = btnValSum
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnProviderCheck
Left = 356
2016-11-29 09:53:31 +00:00
Height = 25
2019-05-25 14:09:05 +00:00
Top = 228
2016-11-29 09:53:31 +00:00
Width = 137
AutoSize = True
2019-05-25 14:09:05 +00:00
BorderSpacing.Left = 24
BorderSpacing.Right = 16
2016-11-29 09:53:31 +00:00
Caption = 'Use OnValidateFailed'
OnClick = btnCheckClick
TabOrder = 7
end
object btnProviderCheck: TButton
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label1
AnchorSideTop.Control = edRange0to100
AnchorSideTop.Side = asrBottom
2016-11-29 09:53:31 +00:00
Left = 16
Height = 25
2019-05-25 14:09:05 +00:00
Top = 228
2016-11-29 09:53:31 +00:00
Width = 130
AutoSize = True
2019-05-25 14:09:05 +00:00
BorderSpacing.Top = 24
BorderSpacing.Bottom = 16
2016-11-29 09:53:31 +00:00
Caption = 'Use JvErrorIndicator'
OnClick = btnProviderCheckClick
TabOrder = 5
end
object reResults: TMemo
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = Label5
AnchorSideTop.Control = edRequired
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = edRange0to100
AnchorSideBottom.Side = asrBottom
2016-11-29 09:53:31 +00:00
Cursor = crArrow
2019-05-25 14:09:05 +00:00
Left = 281
Height = 169
Top = 35
Width = 212
Anchors = [akTop, akLeft, akBottom]
BorderSpacing.Right = 16
2016-11-29 09:53:31 +00:00
Lines.Strings = (
'This is a demo for the JvValidators component as well as the JvErrorProvider and, to some extent, the JvValidationSummary component.'
''
'By creating and setting up different validators (at run-time in this demo but you can do it at design-time as well), the edit boxes can be checked for validity by a single call to the Validate method. When one of the validators finds that a control doesn''t match the validation criteria, that error can be handled in different ways depending on your needs.'
''
'One option is to just check the boolean return value from Validate and display a standard message box telling the user that a value didn''t match.'
''
'You can also handle the OnValidateFailed event of all validators at once (the TJvValidators event) or for each validator separately (the TJvBaseValidator event). Yet another option is to assign a TJvValidationSummary component to the ValidationSummary property of tJvValidators and handle it''s OnChange event.'
''
'Finally, you can combine the work of the validators with the use of a TJvErrorIndicator.'
''
'For more info on TJvErrorIndicator, see the demo for that component (also included).'
''
'By clicking any of the buttons below, you can see how the different methods described work in real-time.'
''
''
)
OnEnter = reResultsEnter
ParentColor = True
ReadOnly = True
ScrollBars = ssBoth
TabOrder = 8
TabStop = False
WordWrap = False
end
object btnValSum: TButton
2019-05-25 14:09:05 +00:00
AnchorSideLeft.Control = btnProviderCheck
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = btnProviderCheck
Left = 170
2016-11-29 09:53:31 +00:00
Height = 25
2019-05-25 14:09:05 +00:00
Top = 228
2016-11-29 09:53:31 +00:00
Width = 162
AutoSize = True
2019-05-25 14:09:05 +00:00
BorderSpacing.Left = 24
2016-11-29 09:53:31 +00:00
Caption = 'Use JvValidationSummary'
OnClick = btnValSumClick
TabOrder = 6
end
object JvValidators1: TJvValidators
OnValidateFailed = JvValidators1ValidateFailed
2019-05-25 14:09:05 +00:00
left = 408
top = 24
2016-11-29 09:53:31 +00:00
object JvRequiredFieldValidator1: TJvRequiredFieldValidator
ControlToValidate = edRequired
PropertyToValidate = 'Text'
ErrorMessage = 'Value in edRequired cannot be empty'
AllowBlank = False
end
object JvCustomValidator1: TJvCustomValidator
ControlToValidate = edRequired10Chars
PropertyToValidate = 'Text'
ErrorMessage = 'Value in "edRequired10Chars" requires at least 10 characters'
OnValidate = JvCustomValidator1Validate
end
object JvRegularExpressionValidator1: TJvRegularExpressionValidator
ControlToValidate = edRegExpr
PropertyToValidate = 'Text'
ErrorMessage = 'Value in "edRegExpr" does not match "A.B.C."'
ValidationExpression = '^A.B.C.*'
end
object JvRangeValidator1: TJvRangeValidator
ControlToValidate = udRange0to100
PropertyToValidate = 'Position'
ErrorMessage = 'Value in "udRange0to100" must be between 0 and 100'
MinimumValue = 0
MaximumValue = 100
end
end
object JvErrorIndicator1: TJvErrorIndicator
ImageIndex = 0
DefaultUseAnchors = False
2019-05-25 14:09:05 +00:00
left = 408
top = 80
2016-11-29 09:53:31 +00:00
end
object JvValidationSummary1: TJvValidationSummary
OnChange = JvValidationSummary1Change
2019-05-25 14:09:05 +00:00
left = 408
top = 136
2016-11-29 09:53:31 +00:00
end
end