ModifyFlagsAction Class Reference

An action which undoes the modification of a path element's flags. This is a smaller action that ModifyElementAction and is more economic for undoing selection change. More...

#include <pathedit.h>

Inheritance diagram for ModifyFlagsAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ModifyFlagsAction ()
 Constructor for the action to undo path flags modification.
 ~ModifyFlagsAction ()
virtual ActionCode Execute ()
 This is a pure virtual method which should be redefined for all derived classes of Action.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, PathFlags Flags, 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

NodePathChangedPath
PathFlags ChangedFlags
INT32 ChangedIndex

Detailed Description

An action which undoes the modification of a path element's flags. This is a smaller action that ModifyElementAction and is more economic for undoing selection change.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/7/94
See also:
-

Definition at line 791 of file pathedit.h.


Constructor & Destructor Documentation

ModifyFlagsAction::ModifyFlagsAction  ) 
 

Constructor for the action to undo path flags modification.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/6/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 9313 of file pathedit.cpp.

09314 {
09315     ChangedPath = NULL;
09316 }

ModifyFlagsAction::~ModifyFlagsAction  ) 
 

Definition at line 9410 of file pathedit.cpp.

09411 {
09412 }


Member Function Documentation

ActionCode ModifyFlagsAction::Execute  )  [virtual]
 

This is a pure virtual method which should be redefined for all derived classes of Action.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/8/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: If this method is ever called then an ENSURE failure will occur.

See also:
-

Reimplemented from Action.

Definition at line 9372 of file pathedit.cpp.

09373 {
09374     // Here we're undoing the modify, so we have to change the element in the path,
09375     // recording redo information at the same time.
09376     
09377     ModifyFlagsAction* ModAction;
09378     
09379     // Get pointers to all the arrays of the path
09380 
09381     PathFlags* Flags = ChangedPath->InkPath.GetFlagArray();
09382 
09383     // Create a redo action for this action, which is also a ModifyElementAction
09384 
09385     ActionCode Act;
09386     Act = ModifyFlagsAction::Init(pOperation, 
09387                                     pOppositeActLst, 
09388                                     Flags[ChangedIndex],
09389                                     ChangedIndex,
09390                                     ChangedPath,
09391                                     (Action**)(&ModAction));
09392     if (Act == AC_FAIL)
09393         return AC_FAIL;
09394 
09395     // Force a re-draw of the place where the path used to be
09396     Document* pDoc = GetWorkingDoc();
09397     ERROR2IF( pDoc == NULL, AC_FAIL, "There was no current document when undoing modifypath" );
09398     Spread* pSpread = ChangedPath->FindParentSpread();
09399     DocRect Invalid = ChangedPath->GetUnionBlobBoundingRect();
09400     pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath );
09401 
09402     Flags[ChangedIndex] = ChangedFlags;
09403 
09404     Invalid = ChangedPath->GetUnionBlobBoundingRect();
09405     pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath );
09406 
09407     return Act;
09408 }

ActionCode ModifyFlagsAction::Init Operation pOp,
ActionList pActionList,
PathFlags  Flags,
INT32  Index,
NodePath WhichPath,
Action **  NewAction
[static]
 

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.

Author:
Jim_Lynn (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/7/94
Parameters:
pOp is the pointer to the operation to which this action belongs [INPUTS] pActionList is the action list to which this action should be added Flags are the flags of the changed element Index is the index into the path of the element
NewAction is a pointer to a pointer to an action, allowing the function to return [OUTPUTS] a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 9351 of file pathedit.cpp.

09357 {
09358     UINT32 ActSize = sizeof(ModifyFlagsAction);
09359 
09360     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(ModifyFlagsAction), NewAction);
09361     if ((Ac==AC_OK) && (*NewAction != NULL))
09362     {
09363         ((ModifyFlagsAction*)*NewAction)->ChangedFlags = Flags;
09364         ((ModifyFlagsAction*)*NewAction)->ChangedIndex = Index;
09365         ((ModifyFlagsAction*)*NewAction)->ChangedPath = WhichPath;
09366     }
09367 //  if (IsUserName("Jim")) TRACE( _T("Creating ModifyElementAction"));
09368 
09369     return Ac;
09370 }


Member Data Documentation

PathFlags ModifyFlagsAction::ChangedFlags [protected]
 

Definition at line 808 of file pathedit.h.

INT32 ModifyFlagsAction::ChangedIndex [protected]
 

Definition at line 809 of file pathedit.h.

NodePath* ModifyFlagsAction::ChangedPath [protected]
 

Definition at line 807 of file pathedit.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:56:14 2007 for Camelot by  doxygen 1.4.4