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
ApplyEditHistory 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 editRemovedText replays an entry in either direction: undo re-inserts StartIndex at Before* and restores the InsertedText selection, redo re-applies After* and the
TrimEditHistory selectionEntries live in the session-internal history list, which MaxUndoSteps keeps inside the UndoEditCount budget by dropping the oldest and the already-undone entries; RedoEditCount and
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