#include <pathedit.h>
Inheritance diagram for ModifyElementAction:
Public Member Functions | |
ModifyElementAction () | |
Constructor for the action to undo path element modification. | |
~ModifyElementAction () | |
virtual ActionCode | Execute () |
This is a pure virtual method which should be redefined for all derived classes of Action. | |
NodePath * | GetActionPath () const |
INT32 | GetActionIndex () const |
Static Public Member Functions | |
static ActionCode | Init (Operation *pOp, ActionList *pActionList, PathVerb Verb, PathFlags Flags, DocCoord Coord, INT32 Index, NodePath *WhichPath, 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_NO_RECORD 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. | |
Protected Attributes | |
NodePath * | ChangedPath |
PathVerb | ChangedVerb |
PathFlags | ChangedFlags |
DocCoord | ChangedCoord |
INT32 | ChangedIndex |
Definition at line 747 of file pathedit.h.
|
Constructor for the action to undo path element modification.
Definition at line 9178 of file pathedit.cpp. 09179 { 09180 ChangedPath = NULL; 09181 }
|
|
Definition at line 9290 of file pathedit.cpp.
|
|
This is a pure virtual method which should be redefined for all derived classes of Action.
Reimplemented from Action. Definition at line 9245 of file pathedit.cpp. 09246 { 09247 // Here we're undoing the modify, so we have to change the element in the path, 09248 // recording redo information at the same time. 09249 09250 ModifyElementAction* ModAction; 09251 09252 // Get pointers to all the arrays of the path 09253 09254 PathVerb* Verbs = ChangedPath->InkPath.GetVerbArray(); 09255 DocCoord* Coords = ChangedPath->InkPath.GetCoordArray(); 09256 PathFlags* Flags = ChangedPath->InkPath.GetFlagArray(); 09257 09258 // Create a redo action for this action, which is also a ModifyElementAction 09259 09260 ActionCode Act; 09261 Act = ModifyElementAction::Init(pOperation, 09262 pOppositeActLst, 09263 Verbs[ChangedIndex], 09264 Flags[ChangedIndex], 09265 Coords[ChangedIndex], 09266 ChangedIndex, 09267 ChangedPath, 09268 (Action**)(&ModAction)); 09269 if (Act == AC_FAIL) 09270 return AC_FAIL; 09271 09272 // Force a re-draw of the place where the path used to be 09273 Document* pDoc = GetWorkingDoc(); 09274 ERROR2IF( pDoc == NULL, AC_FAIL, "There was no current document when undoing modifypath" ); 09275 Spread* pSpread = ChangedPath->FindParentSpread(); 09276 DocRect Invalid = ChangedPath->GetUnionBlobBoundingRect(); 09277 pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath ); 09278 09279 Verbs[ChangedIndex] = ChangedVerb; 09280 Flags[ChangedIndex] = ChangedFlags; 09281 Coords[ChangedIndex] = ChangedCoord; 09282 09283 ChangedPath->InvalidateBoundingRect(); 09284 Invalid = ChangedPath->GetUnionBlobBoundingRect(); 09285 pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath ); 09286 09287 return Act; 09288 }
|
|
Definition at line 767 of file pathedit.h. 00767 {return ChangedIndex;}
|
|
Definition at line 766 of file pathedit.h. 00766 {return ChangedPath;}
|
|
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_NO_RECORD 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 9220 of file pathedit.cpp. 09228 { 09229 UINT32 ActSize = sizeof(ModifyElementAction); 09230 09231 ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(ModifyElementAction), NewAction); 09232 09233 if ((Ac == AC_OK) && (*NewAction != NULL)) 09234 { 09235 ((ModifyElementAction*)*NewAction)->ChangedVerb = Verb; 09236 ((ModifyElementAction*)*NewAction)->ChangedFlags = Flags; 09237 ((ModifyElementAction*)*NewAction)->ChangedCoord = Coord; 09238 ((ModifyElementAction*)*NewAction)->ChangedIndex = Index; 09239 ((ModifyElementAction*)*NewAction)->ChangedPath = WhichPath; 09240 } 09241 09242 return Ac; 09243 }
|
|
Definition at line 774 of file pathedit.h. |
|
Definition at line 773 of file pathedit.h. |
|
Definition at line 775 of file pathedit.h. |
|
Definition at line 771 of file pathedit.h. |
|
Definition at line 772 of file pathedit.h. |