#include <moldenv.h>
Inheritance diagram for RecordEnvelopeAction:
Public Member Functions | |
RecordEnvelopeAction () | |
Constructor for the action to undo envelope modification. | |
~RecordEnvelopeAction () | |
Destructor for the action to undo envelope modification. | |
virtual ActionCode | Execute () |
This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the envelope change action by swapping the current internal definition of the envelope with the contexts of itself. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, MouldEnvelopeBase *pRecEnvelope, Action **NewAction) |
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation. | |
Private Attributes | |
MouldEnvelopeBase * | pCEnvelope |
POINT | RecordArray [24] |
class RecordEnvelopeAction : public Action
Definition at line 299 of file moldenv.h.
|
Constructor for the action to undo envelope modification. RecordEnvelopeAction::RecordEnvelopeAction()
Definition at line 1794 of file moldenv.cpp. 01795 { 01796 pCEnvelope=NULL; 01797 }
|
|
Destructor for the action to undo envelope modification. RecordEnvelopeAction::~RecordEnvelopeAction()
Definition at line 1810 of file moldenv.cpp.
|
|
This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the envelope change action by swapping the current internal definition of the envelope with the contexts of itself.
Reimplemented from Action. Definition at line 1890 of file moldenv.cpp. 01891 { 01892 // try to create a redo record 01893 RecordEnvelopeAction* EnvAction; 01894 ActionCode Act; 01895 Act = RecordEnvelopeAction::Init(pOperation, pOppositeActLst, pCEnvelope, (Action**)(&EnvAction)); 01896 01897 // for undo, simply copy 'this' record over the shape. 01898 // No No , we dont need to check for AC_OK, hands off! we've done all that in the 01899 // init function which tries to record the current state of the envelope 01900 if (pCEnvelope) 01901 pCEnvelope->BuildShape(RecordArray,NULL); 01902 01903 return Act; 01904 }
|
|
This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
Definition at line 1845 of file moldenv.cpp. 01849 { 01850 ActionCode Ac = AC_FAIL; 01851 if (pRecEnvelope!=NULL) 01852 { 01853 UINT32 ActSize = sizeof(RecordEnvelopeAction); 01854 Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(RecordEnvelopeAction), NewAction); 01855 if (Ac==AC_OK) 01856 { 01857 RecordEnvelopeAction* pAct = ((RecordEnvelopeAction*)*NewAction); 01858 if (pAct) 01859 { 01860 // Save a pointer to the Envelope and save the defining shape 01861 pAct->pCEnvelope = pRecEnvelope; 01862 pRecEnvelope->pEnvelope->CopyShape(pAct->RecordArray); 01863 } 01864 } 01865 } 01866 return Ac; 01867 }
|
|
|
|
|