| |
- AtomicUndoAction
- exceptions.Exception(exceptions.BaseException)
-
- CancelUndoCommand
class AtomicUndoAction |
|
Contains several undo commands to be treated as a single undoable operation.
Example:
When deleting several Instruments at once, an AtomicUndoAction
containing the commands to resurrect the Instruments will be created.
When the user requests an undo operation, all of the commands stored
in this object will be rolled back, making the operation appear to be
atomic from the user's perspective. |
|
Methods defined here:
- AddUndoCommand(self, objectString, function, paramList)
- Adds a new undo command to this AtomicUndoAction.
Example:
The parameters passed to this function:
"E2", "Move", [1, 2]
means
'Call Move(1, 2)' on the Event with ID=2
Parameters:
objectString -- the string representing the object and its ID
(ie "E2" for Event with ID == 2).
function -- the name of the function to be called on the object.
paramList -- a list of values to be passed to the function as parameters.
Key, value parameters are not supported.
- GetUndoCommands(self)
- Obtains the list of undo commands held by this AtomicUndoAction.
Returns:
a list of tuples, each of which contains a single undo command.
- StoreToXML(self, doc, node)
- Stores this instance of AtomicUndoAction into an XML node.
Example:
doc = xml.Document()
node = doc.createElement("Action")
doc.appendChild(node)
StoreToXml(doc, node)
will save this AtomicUndoAction in doc, inside node.
Parameters:
doc -- XML document to save this AtomicUndoAction into.
node -- XML node to store this AtomicUndoAction under.
This node's name should be "Action".
- __init__(self)
- Creates a new AtomicUndoAction instance.
|
|