#include <textacts.h>
Inheritance diagram for ReversePathAction:
Public Member Functions | |
ReversePathAction () | |
Constructor - initialises the member variables. | |
~ReversePathAction () | |
Destructor. | |
virtual ActionCode | Execute () |
Called during undo/redo to reverse the path inside a TextStory Inserts a similar action into the opposite action list then reverses the path. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *, ActionList *, TextStory *) |
static BOOL | DoReversePath (Operation *pOp, ActionList *, TextStory *) |
Definition at line 212 of file textacts.h.
|
Constructor - initialises the member variables.
Definition at line 416 of file textacts.cpp.
|
|
Destructor.
Definition at line 428 of file textacts.cpp.
|
|
Definition at line 509 of file textacts.cpp. 00510 { 00511 // Check the parameters 00512 ERROR2IF(pOp == NULL, FALSE, "The operation pointer is NULL"); 00513 ERROR2IF(pActionList == NULL, FALSE, "The action list pointer is NULL"); 00514 ERROR2IF(pTextStory == NULL, FALSE, "The TextStory pointer is NULL"); 00515 ERROR3IF(pTextStory->GetTextPath() == NULL, "TextStory was not on a path"); 00516 00517 // Insert an action to restore the path on undo (just reverse it back) 00518 ActionCode ActCode; 00519 ActCode = ReversePathAction::Init(pOp, pActionList, pTextStory); 00520 00521 // Now reverse the path 00522 if (ActCode != AC_FAIL) 00523 pTextStory->ReverseTextOnPath(); 00524 00525 return (ActCode != AC_FAIL); 00526 }
|
|
Called during undo/redo to reverse the path inside a TextStory Inserts a similar action into the opposite action list then reverses the path.
Reimplemented from Action. Definition at line 441 of file textacts.cpp. 00442 { 00443 // Check the member variables 00444 ERROR2IF(pStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00445 ERROR2IF(pOperation == NULL, AC_FAIL, "The operation pointer is NULL(!)"); 00446 00447 // Insert an action to reverse the path again on redo 00448 ActionCode ActCode; 00449 ActCode = ReversePathAction::Init(pOperation, pOppositeActLst, pStory); 00450 00451 // Now reverse the path 00452 if (ActCode != AC_FAIL) 00453 pStory->ReverseTextOnPath(); 00454 00455 return ActCode; 00456 }
|
|
Definition at line 474 of file textacts.cpp. 00475 { 00476 // Check the parameters 00477 ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL"); 00478 ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL"); 00479 ERROR2IF(pTextStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00480 00481 // Create a new action and insert it in the action list 00482 UINT32 ActSize = sizeof(ReversePathAction); 00483 ReversePathAction* pNewAction = NULL; 00484 ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(ReversePathAction), (Action**)&pNewAction); 00485 00486 // Set the members of the new action 00487 if ((Ac == AC_OK) && (pNewAction != NULL)) 00488 pNewAction->pStory = pTextStory; 00489 00490 return Ac; 00491 }
|