ModifyFilledAction Class Reference

An action which undoes the modification of a path's filled bit (or redoes it) It can also be used to undo the IsStroked flag as well. More...

#include <pathedit.h>

Inheritance diagram for ModifyFilledAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ModifyFilledAction ()
 Constructor for the action to undo path Filled flag.
 ~ModifyFilledAction ()
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, BOOL UndoFillOrStroke, BOOL FilledFlag, 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
BOOL UndoFilled
BOOL OldFilledState

Detailed Description

An action which undoes the modification of a path's filled bit (or redoes it) It can also be used to undo the IsStroked flag as well.

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

Definition at line 825 of file pathedit.h.


Constructor & Destructor Documentation

ModifyFilledAction::ModifyFilledAction  ) 
 

Constructor for the action to undo path Filled flag.

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

Errors: -

See also:
-

Definition at line 9433 of file pathedit.cpp.

09434 {
09435     UndoFilled = TRUE;
09436     OldFilledState = FALSE;
09437 }

ModifyFilledAction::~ModifyFilledAction  ) 
 

Definition at line 9537 of file pathedit.cpp.

09538 {
09539 }


Member Function Documentation

ActionCode ModifyFilledAction::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 9494 of file pathedit.cpp.

09495 {
09496     // Here we're undoing the modify, so we have to change the element in the path,
09497     // recording redo information at the same time.
09498     
09499     ModifyFilledAction* ModAction;
09500     
09501     // Create a redo action for this action, which is also a ModifyElementAction
09502 
09503     BOOL CurState;
09504     if (UndoFilled)
09505         CurState = ChangedPath->InkPath.IsFilled;
09506     else
09507         CurState = ChangedPath->InkPath.IsStroked;
09508     
09509     ActionCode Act;
09510     Act = ModifyFilledAction::Init(pOperation, 
09511                                     pOppositeActLst, 
09512                                     UndoFilled,
09513                                     CurState,
09514                                     ChangedPath,
09515                                     (Action**)(&ModAction));
09516     if (Act == AC_FAIL)
09517         return AC_FAIL;
09518 
09519     // Force a re-draw of the place where the path used to be
09520     Document* pDoc = GetWorkingDoc();
09521     ERROR2IF( pDoc == NULL, AC_FAIL, "There was no current document when undoing modifypath" );
09522     Spread* pSpread = ChangedPath->FindParentSpread();
09523     DocRect Invalid = ChangedPath->GetUnionBlobBoundingRect();
09524     pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath );
09525 
09526     if (UndoFilled)
09527         ChangedPath->InkPath.IsFilled = OldFilledState;
09528     else
09529         ChangedPath->InkPath.IsStroked = OldFilledState;
09530 
09531     Invalid = ChangedPath->GetUnionBlobBoundingRect();
09532     pDoc->ForceRedraw( pSpread, Invalid, FALSE, ChangedPath );
09533 
09534     return Act;
09535 }

ActionCode ModifyFilledAction::Init Operation pOp,
ActionList pActionList,
BOOL  UndoFillOrStroke,
BOOL  FilledFlag,
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:
21/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 UndoFillOrStroke is TRUE if this action should undo a fill, otherwise a stroke FilledFlag is the state of the flag that must be replaced when undoing WhichPath is the path whose flag we're modifying
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 9473 of file pathedit.cpp.

09479 {
09480     UINT32 ActSize = sizeof(ModifyFilledAction);
09481 
09482     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(ModifyFilledAction), NewAction);
09483     if ((Ac==AC_OK) && (*NewAction != NULL))
09484     {
09485         ((ModifyFilledAction*)*NewAction)->UndoFilled = UndoFillOrStroke;
09486         ((ModifyFilledAction*)*NewAction)->OldFilledState = FilledFlag;
09487         ((ModifyFilledAction*)*NewAction)->ChangedPath = WhichPath;
09488     }
09489 //  if (IsUserName("Jim")) TRACE( _T("Creating ModifyElementAction"));
09490 
09491     return Ac;
09492 }


Member Data Documentation

NodePath* ModifyFilledAction::ChangedPath [protected]
 

Definition at line 841 of file pathedit.h.

BOOL ModifyFilledAction::OldFilledState [protected]
 

Definition at line 843 of file pathedit.h.

BOOL ModifyFilledAction::UndoFilled [protected]
 

Definition at line 842 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