OnTextEdit
Forms, interaction
Description
Occurs before the transient value of the active edit changes through a selection replacement
The callback receives the edit kind, the UTF-16 selection range, the selected text and a mutable replacement string, and it fires after the Widget /K keystroke action has been dispatched and accepted
ReplacementText keystroke action has been dispatched and accepted
Modifying Allow rewrites the text that will be inserted, and setting False to
The replacement is clamped to the field maximum length at complete grapheme boundaries after the callback returns
Declaration
property OnTextEdit: TPDFlibFormSessionTextEditEvent;
Handler parameters
| Sender | Session performing the edit |
|---|---|
| FieldIndex | Base field being edited |
| EditKind | Kind of pending edit, one of fekReplaceSelection, fekCutSelection or fekPasteText |
| SelectionStart | Zero-based UTF-16 start of the normalised selection |
| SelectionLength | UTF-16 length of the normalised selection |
| SelectedText | Text currently covered by the selection |
| ReplacementText | Mutable text about to replace the selection |
| Allow | Veto flag, preset to True and set to False for an atomic rejection |
See also
ReplaceSelection, CutSelection, PasteText, TPDFlibFormEditKind, OnAction, ApplySelectionEdit