The following applies when using right-aligned or left-aligned text boxes of the JadeEditMask class.
If the character generated by the key is invalid according to the rules defined in the mask property, a beep is emitted and the character is ignored.
Selecting text that includes literal text and prompt characters includes those characters in any text saved in the clipboard. Deleting or cutting text removes only the characters that can be entered and leaves the literal characters in place.
The Backspace key, when positioned to the right of a literal value, acts like a left arrow key press.
For a left-aligned text box, the following applies.
If the character is valid and the character position has a prompt character displayed or Insert mode is off, that character or prompt is overwritten.
If the entered character is valid, not replacing a prompt, and Insert mode is on (the default value), the character is inserted into the text, shifting the following text along one character up to the start of the next edit type, literal, or the end of the text. For example, for the text '1_/10/2001', where the first two characters are a day number followed by a / date delimiter, entering a 2 before the 1 results in 21/10/2001 (_ is the default prompt character).
Entering a valid character into a field where the next character in the mask is a literal causes the caret to automatically skip to the start of the next character position that can be entered. In the preceding example, entering 21 into the day field of the preceding example automatically positions the caret at the start of the 10/2001 sequence.
Similarly, using the right arrow key skips literal characters unless the Ctrl or Shift key is also held down (selecting text). The left arrow key steps through the text one character at a time, regardless of type, to allow the user to position the caret at any character position.
Deleting a character is the reverse of the above procedure. The deletion stops at the first character that has a different mask type. For example, deleting the 2 in 21/10/2001 results in 1_/10/2001.
If the caret is placed before a literal character, pressing the key for that literal character causes the caret to move to the next position in the text. The literal character cannot be replaced or removed.
If all character positions from the caret up to the next literal are empty and the literal that is entered is invalid at the current position, the caret moves to after the literal. For example, if 1/ is entered in a date field of __/__/__, the caret is positioned after the first / character.
For a right-aligned text box, the following applies.
Characters are entered into right-aligned fields to the left of the current caret position instead of to the right, as is the case for a left-aligned field. After any insertion, the caret remains at the same position in the text.
If the entered character is valid and the character position has a prompt displayed or Insert mode is off, that character is overwritten. The caret remains at the same position.
If the entered character is valid, it is not replacing a prompt, and Insert mode is on (the default value), the character is inserted into the text and the characters to the left are shifted to the start of the current edit field or the preceding literal. For example, entering 5 for text '12/03/_4' when the caret is positioned to the right of the 4 results in 12/03/45 (_ is the default prompt character). On completion, the caret remains after the 5.
Right and left arrow keys operate as they do in a standard TextBox control, moving one character at a time.
When deleting a character, the deletion stops at the first character that has a different edit mask type. For example, deleting the 5 in 12/03/45 results in 12/03/_4.
Because of a Windows limitation, right-aligned text boxes do not scroll horizontally if they are not large enough to display the full text field.
Right-aligned fields are used mostly for numeric-only entry because the caret remains at the same position after entry. Users must use the arrow key to position the caret before a literal segment (that is, the / solidus character in the previous examples).