Owns the cell-tree undo/redo stacks and the active-cell snapshot.
More...
#include <TreeUndoManager.h>
|
|
UndoActions & | UndoStack () |
| | The list of tree actions that can be undone.
|
| |
|
const UndoActions & | UndoStack () const |
| |
|
UndoActions & | RedoStack () |
| | The list of undone tree actions that can be redone.
|
| |
|
const UndoActions & | RedoStack () const |
| |
|
void | AppendAction () |
| | Mark the newest undo action as part of the following atomic action.
|
| |
|
void | ClearRedoActionList () |
| | Clear the list of actions that can be redone.
|
| |
|
void | ClearUndoActionList () |
| | Clear the list of actions that can be undone.
|
| |
|
void | ClearBuffers () |
| | Clear both action lists and forget the active-cell snapshot.
|
| |
| void | LimitUndoBuffer (long undoLimit) |
| | Drop actions from the back of the undo list until it is within the limit.
|
| |
| void | CellEntered (GroupCell *group, const wxString &text, long long selStart, long long selEnd) |
| | The cursor has entered a cell: snapshot its contents.
|
| |
| bool | CellLeft (GroupCell *activeCell, const wxString ¤tText, long undoLimit) |
| | The cursor is leaving a cell: record a text-change undo action if needed.
|
| |
|
void | ForgetActiveCell () |
| | Forget the active-cell snapshot (e.g. the next change must not be undoable).
|
| |
|
GroupCell * | ActiveCell () const |
| | The cell the cursor is in, as recorded by CellEntered().
|
| |
|
| static void | DiscardAction (UndoActions *actionList) |
| | Remove one action from an action list.
|
| |
|
static void | AppendAction (UndoActions *actionList) |
| | Mark the newest action of the list as part of the following atomic action.
|
| |
Owns the cell-tree undo/redo stacks and the active-cell snapshot.
Pure state + bookkeeping: this class never touches the worksheet's cell tree itself. Applying an action (the tree surgery) is Worksheet's job; it reaches the stacks via UndoStack()/RedoStack().
The "active cell snapshot" is the text and selection an EditorCell had when the cursor entered it; when the cursor leaves the cell again, the snapshot is compared against the current text to decide whether a text-change undo action has to be recorded (see CellLeft()).
◆ CellEntered()
| void TreeUndoManager::CellEntered |
( |
GroupCell * |
group, |
|
|
const wxString & |
text, |
|
|
long long |
selStart, |
|
|
long long |
selEnd |
|
) |
| |
|
inline |
The cursor has entered a cell: snapshot its contents.
- Parameters
-
| group | The group cell that was entered |
| text | The text its editor currently contains |
| selStart | The editor's selection start (or cursor position) |
| selEnd | The editor's selection end (or cursor position) |
◆ CellLeft()
| bool TreeUndoManager::CellLeft |
( |
GroupCell * |
activeCell, |
|
|
const wxString & |
currentText, |
|
|
long |
undoLimit |
|
) |
| |
|
inline |
The cursor is leaving a cell: record a text-change undo action if needed.
Compares the entry snapshot with the cell's current text; if the text has genuinely changed (more than just appending a ";"), an undo action with the old text and selection is pushed, the undo buffer is limited and the redo list is cleared.
- Parameters
-
| activeCell | The group cell being left |
| currentText | The text its editor contains now |
| undoLimit | The undo-buffer limit to enforce (0 = unlimited) |
- Returns
- true if a text-change action was recorded
◆ DiscardAction()
| static void TreeUndoManager::DiscardAction |
( |
UndoActions * |
actionList | ) |
|
|
inlinestatic |
Remove one action from an action list.
Removes the whole atomic group: trailing actions that are marked as m_partOfAtomicAction belong to the action in front of them and are dropped along with it.
◆ LimitUndoBuffer()
| void TreeUndoManager::LimitUndoBuffer |
( |
long |
undoLimit | ) |
|
|
inline |
Drop actions from the back of the undo list until it is within the limit.
- Parameters
-
| undoLimit | The maximum number of undo actions to keep; 0 = unlimited. |
The documentation for this class was generated from the following file: