|
wxMaxima
|
Owns the cell-tree undo/redo stacks and the active-cell snapshot. More...
#include <TreeUndoManager.h>
Public Member Functions | |
| 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 | 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) |
| 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 Public Member Functions | |
| 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()).
|
inline |
The cursor has entered a cell: snapshot its contents.
| 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) |
|
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 and the redo list is cleared.
| activeCell | The group cell being left |
| currentText | The text its editor contains now |
|
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.