VRFormattedEntryField: Difference between revisions
Created page with "The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the stan..." |
mNo edit summary |
||
Line 1: | Line 1: | ||
The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the standard entry field properties and filtering the keyboard input. | The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the standard entry field properties and filtering the keyboard input. | ||
Three predefined formatted fields are supplied (see FieldType): | Three predefined formatted fields are supplied (see FieldType): | ||
* Date entry field | |||
* Date entry field | * Time entry field | ||
* Time entry field | * Currency entry field | ||
* Currency entry field | Other than these you can define your own entry FieldMask using the available Mask Characters. | ||
Other than these you can define your own entry FieldMask using the available Mask Characters | |||
==Mask Characters== | ==Mask Characters== | ||
To help you define the allowable characters in a Formatted Entry Field, the following characters are defined and reserved for creating input masks. | To help you define the allowable characters in a Formatted Entry Field, the following characters are defined and reserved for creating input masks. | ||
* # Only numeric characters ( 0..9) and punctuation characters are allowed at this position. | |||
* # Only numeric characters ( 0..9) and punctuation characters are allowed at this position. | * @ Any character can be entered at this position. | ||
* @ Any character can be entered at this position. | * | Only non-numeric characters can be entered at this position. | ||
* | Only non-numeric characters can be entered at this position. | |||
==Properties== | ==Properties== | ||
The Formatted Entry Field Object inherits all the properties of the standard Entry Field Object and adds the following properties: | The Formatted Entry Field Object inherits all the properties of the standard Entry Field Object and adds the following properties: | ||
* AllowSpaces | |||
* AllowSpaces | * FieldType | ||
* FieldType | * ForceUpperCase | ||
* ForceUpperCase | * FieldMask | ||
* FieldMask | * SpaceToZero | ||
* SpaceToZero | |||
====AllowSpaces==== | ====AllowSpaces==== | ||
This property specifies whether the <Space> character is allowed in the input string. When set to 0, an error beep will be | This property specifies whether the <Space> character is allowed in the input string. When set to 0, an error beep will be emitted if you type the <Space> character. | ||
; Data Type : Boolean | |||
; Data Type : Boolean | ; Possible Values | ||
* 1 (true) | |||
; Possible Values | * 0 (false) | ||
* 1 (true) | |||
* 0 (false) | |||
====FieldType==== | ====FieldType==== | ||
This property determines what type of entry field is created : | This property determines what type of entry field is created: | ||
* Date the field will be formatted according to the current system date format. | |||
* Date the field will be formatted according to the current system date format. | * Time the field will be formatted according to the current system time format. | ||
* Time the field will be formatted according to the current system time format. | * Currency the field will be formatted according to the current system currency format. | ||
* Currency the field will be formatted according to the current system currency format. | * User Defined the user defines the input FieldMask | ||
* User Defined the user defines the input FieldMask | ; Data Type : String | ||
; Possible Values | |||
; Data Type : String | * Date | ||
* Time | |||
; Possible Values | * Currency | ||
* Date | * User Defined | ||
* Time | |||
* Currency | |||
* User Defined | |||
====ForceUpperCase==== | ====ForceUpperCase==== | ||
This property determines the allowed case of the characters entered into the field. If it is set, all characters typed into the field will be forced to upper case. | This property determines the allowed case of the characters entered into the field. If it is set, all characters typed into the field will be forced to upper case. | ||
; Data Type : Boolean | |||
; Possible Values | |||
* 1 (true) | |||
* 0 (false) | |||
====FieldMask==== | ====FieldMask==== | ||
A string representation containing Mask Characters and literal characters. Input to the field is only allowed over the Mask Characters, all literals will remain untouched by editing. | A string representation containing Mask Characters and literal characters. Input to the field is only allowed over the Mask Characters, all literals will remain untouched by editing. | ||
; Data Type : String | |||
; Data Type : String | ; Possible Values : see Mask Characters | ||
; Possible Values : see Mask Characters | |||
====SpaceToZero==== | ====SpaceToZero==== | ||
This property is | This property is for numeric input fields. If set to 1 all spaces left in the field will be converted to the number 0 when the focus is lost. | ||
; Data Type : Boolean | |||
; Data Type : Boolean | ; Possible Values | ||
* 1 (true) | |||
; Possible Values | * 0 (false) | ||
* 1 (true) | |||
* 0 (false) | |||
==Methods== | ==Methods== | ||
The Formatted Entry Field Object apart from the following specific methods, all the standard Entry Field methods apply. | |||
The Formatted Entry Field Object apart from the following specific methods, all the standard Entry Field methods apply. | * ValidateField | ||
* ValidateField | |||
===ValidateField=== | ===ValidateField=== | ||
This method takes no parameters and only applies to Date or Time fields. It will check whether the contents of the field are valid: | This method takes no parameters and only applies to Date or Time fields. It will check whether the contents of the field are valid: | ||
Months part <= 12 | |||
Months part <= 12 | Days part in range for the month | ||
Days part in range for the month | Hours part <= 23 | ||
Hours part <= 23 | Minutes part <= 59 | ||
Minutes part <= 59 | User defined and Currency fields are not validated, the method always returning TRUE. | ||
User defined and Currency fields are not validated, the method always returning TRUE. | |||
ok = VRMethod( object, "ValidateField"); | ok = VRMethod( object, "ValidateField"); | ||
;Returns | |||
* 1 (true) Field is valid | |||
; Returns | * 0 (false) Field is invalid | ||
* 1 (true) Field is valid | |||
* 0 (false) Field is invalid | |||
[[Category:VRExtras]] | [[Category:VRExtras]] |
Latest revision as of 18:44, 19 March 2018
The Formatted Entry Field Object allows you to control the way data is entered into a VX-REXX Entry Field. The Formatted Entry Field Object achieves this my modifying the standard entry field properties and filtering the keyboard input.
Three predefined formatted fields are supplied (see FieldType):
- Date entry field
- Time entry field
- Currency entry field
Other than these you can define your own entry FieldMask using the available Mask Characters.
Mask Characters
To help you define the allowable characters in a Formatted Entry Field, the following characters are defined and reserved for creating input masks.
- # Only numeric characters ( 0..9) and punctuation characters are allowed at this position.
- @ Any character can be entered at this position.
- | Only non-numeric characters can be entered at this position.
Properties
The Formatted Entry Field Object inherits all the properties of the standard Entry Field Object and adds the following properties:
- AllowSpaces
- FieldType
- ForceUpperCase
- FieldMask
- SpaceToZero
AllowSpaces
This property specifies whether the <Space> character is allowed in the input string. When set to 0, an error beep will be emitted if you type the <Space> character.
- Data Type
- Boolean
- Possible Values
- 1 (true)
- 0 (false)
FieldType
This property determines what type of entry field is created:
- Date the field will be formatted according to the current system date format.
- Time the field will be formatted according to the current system time format.
- Currency the field will be formatted according to the current system currency format.
- User Defined the user defines the input FieldMask
- Data Type
- String
- Possible Values
- Date
- Time
- Currency
- User Defined
ForceUpperCase
This property determines the allowed case of the characters entered into the field. If it is set, all characters typed into the field will be forced to upper case.
- Data Type
- Boolean
- Possible Values
- 1 (true)
- 0 (false)
FieldMask
A string representation containing Mask Characters and literal characters. Input to the field is only allowed over the Mask Characters, all literals will remain untouched by editing.
- Data Type
- String
- Possible Values
- see Mask Characters
SpaceToZero
This property is for numeric input fields. If set to 1 all spaces left in the field will be converted to the number 0 when the focus is lost.
- Data Type
- Boolean
- Possible Values
- 1 (true)
- 0 (false)
Methods
The Formatted Entry Field Object apart from the following specific methods, all the standard Entry Field methods apply.
- ValidateField
ValidateField
This method takes no parameters and only applies to Date or Time fields. It will check whether the contents of the field are valid:
Months part <= 12 Days part in range for the month Hours part <= 23 Minutes part <= 59
User defined and Currency fields are not validated, the method always returning TRUE.
ok = VRMethod( object, "ValidateField");
- Returns
- 1 (true) Field is valid
- 0 (false) Field is invalid