![]() |
Cadabra
Computer algebra system for field theory problems
|
Add a cell to the notebook.
#include <Actions.hh>
Public Types | |
enum class | Position { before , after , child } |
Public Member Functions | |
ActionAddCell (DataCell, DataCell::id_t ref_, Position pos_, bool activate=false) | |
virtual | ~ActionAddCell () |
virtual void | execute (DocumentThread &, GUIBase &) override |
Perform the action. | |
virtual void | revert (DocumentThread &, GUIBase &) override |
Revert the change to the DTree document and the GUI. | |
virtual bool | undoable () const override |
Can this action be undone? | |
![]() | |
ActionBase (DataCell::id_t ref_id) | |
Private Attributes | |
DataCell | newcell |
DTree::iterator | newref |
Position | pos |
int | child_num |
bool | activate |
bool | is_replacement |
bool | is_input_form |
Additional Inherited Members | |
![]() | |
DataCell::id_t | ref_id |
std::function< void()> | callback |
If you want a callback once this action has finished, set it here before queuing. | |
![]() | |
DTree::iterator | ref |
ActionAddCell::ActionAddCell | ( | DataCell | cell, |
DataCell::id_t | ref_, | ||
Position | pos_, | ||
bool | activate = false |
||
) |
|
inlinevirtual |
|
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.
The base class just looks up the cell given its id_t
. If your action does not refer to a cell at all, you do not need to call the base class execute
.
Reimplemented from cadabra::ActionBase.
|
overridevirtual |
Revert the change to the DTree document and the GUI.
Implements cadabra::ActionBase.
|
overridevirtual |
Can this action be undone?
Reimplemented from cadabra::ActionBase.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |