Cadabra
Computer algebra system for field theory problems
|
Add a text string (can be just a single character) at the point of the cursor.
This action is assumed to be triggered from a user change to the GUI cells, so will not update the GUI itself, only the underlying DTree. However, the revert method will need to update the GUI representation.
#include <Actions.hh>
Public Member Functions | |
ActionInsertText (DataCell::id_t ref_id, int pos, const std::string &) | |
virtual void | execute (DocumentThread &, GUIBase &) override |
Perform the action. More... | |
virtual void | revert (DocumentThread &, GUIBase &) override |
Revert the change to the DTree document and the GUI. More... | |
Public Member Functions inherited from cadabra::ActionBase | |
ActionBase (DataCell::id_t ref_id) | |
virtual bool | undoable () const |
Can this action be undone? More... | |
Private Attributes | |
DTree::iterator | this_cell |
int | insert_pos |
std::string | text |
Additional Inherited Members | |
Protected Attributes inherited from cadabra::ActionBase | |
DataCell::id_t | ref_id |
DTree::iterator | ref |
ActionInsertText::ActionInsertText | ( | DataCell::id_t | ref_id, |
int | pos, | ||
const std::string & | content | ||
) |
|
overridevirtual |
Perform the action.
This should update both the document tree data structure and the GUI. The latter is updated by calling relevant methods on the GUIBase object passed in.
Reimplemented from cadabra::ActionBase.
|
overridevirtual |
Revert the change to the DTree document and the GUI.
Implements cadabra::ActionBase.
|
private |
|
private |
|
private |