TPDFlibFormEditHistoryEntry
Data types, forms, interaction, edit history
Description
Class that captures one undoable text edit made while a form session edits a text field
RecordEditHistory compares the previous and the new edit value, reduces them to their common prefix and suffix, and stores one entry that describes exactly the replaced slice together with the selection anchor and caret before and after the edit
ApplyEditHistory replays an entry in either direction: undo re-inserts RemovedText at StartIndex and restores the Before* selection, redo re-applies InsertedText and the After* selection
Entries live in the session-internal history list, which TrimEditHistory keeps inside the MaxUndoSteps budget by dropping the oldest and the already-undone entries; UndoEditCount and RedoEditCount report the current position within that list
Declaration
TPDFlibFormEditHistoryEntry = class public StartIndex: Integer; RemovedText: WideString; InsertedText: WideString; BeforeAnchor: Integer; BeforeCaret: Integer; AfterAnchor: Integer; AfterCaret: Integer; end;Fields
| StartIndex | Number of leading characters the old and the new value share; the replaced slice begins immediately after them |
|---|---|
| RemovedText | Slice that the edit deleted from the previous edit value |
| InsertedText | Slice that the edit wrote in its place |
| BeforeAnchor | Selection anchor recorded before the edit, in the session selection units |
| BeforeCaret | Selection caret recorded before the edit, in the session selection units |
| AfterAnchor | Selection anchor recorded after the edit, in the session selection units |
| AfterCaret | Selection caret recorded after the edit, in the session selection units |
See also
TPDFlibFormSession, UndoEdit, RedoEdit, CanUndoEdit, ClearEditHistory, UndoEditCount, RedoEditCount, MaxUndoSteps