UndoColAction Class Reference

Simple BlobbyOp action which restores the colour of a documents page to the colour it was prior to the operation being performed. More...

#include <blobby.h>

Inheritance diagram for UndoColAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 UndoColAction ()
 UndoColAction constructor.
virtual ActionCode Execute ()
 Executes the UndoColAction setting the paper colour to the colour it was prior to the operation being done or redone.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, UINT32 ActionSize, Action **NewAction)
 To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Private Attributes

DocColour Color

Friends

class RedoColAction
class BlobbyOp

Detailed Description

Simple BlobbyOp action which restores the colour of a documents page to the colour it was prior to the operation being performed.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
See also:
BlobbyOp

Definition at line 156 of file blobby.h.


Constructor & Destructor Documentation

UndoColAction::UndoColAction  ) 
 

UndoColAction constructor.

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

Errors: -

See also:
-

Definition at line 330 of file blobby.cpp.

00330                             :Action()
00331 {
00332 }


Member Function Documentation

ActionCode UndoColAction::Execute  )  [virtual]
 

Executes the UndoColAction setting the paper colour to the colour it was prior to the operation being done or redone.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
- [INPUTS]
ActionCode indicating if the action was successfully executed or not [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from Action.

Definition at line 406 of file blobby.cpp.

00407 {
00408     RedoColAction* RedoColAct;
00409     ActionCode ActCode;
00410     // Attempt to initialise the action
00411     if ((ActCode = RedoColAction::Init(pOperation,
00412                                        pOperation->GetRedoActionList(),
00413                                        10,
00414                                        ((Action**)&RedoColAct))) != AC_FAIL) // 10 is bodge
00415         if (RedoColAct != NULL) // Check we are not unwinding
00416             RedoColAct->Color = Page::GetPageColour();
00417 
00418     if (ActCode != AC_FAIL)
00419     {
00420         // The action did not fail to initialise
00421         Page::SetPageColour(Color);               // Set the paper colour to the colour it was
00422                                                   // prior to the operation being done or redone
00423         (DocView::GetSelected())->ForceRedraw();   // Show the new colour
00424     }
00425     return (ActCode);
00426 }

ActionCode UndoColAction::Init Operation *const   pOp,
ActionList pActionList,
UINT32  ActionSize,
Action **  NewAction
[static]
 

To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/8/93
Parameters:
pOp,: The operation to which the action should be added [INPUTS]
pActionList: The action list in the operation object

Size: The size of the action in bytes. This should be the total size of the action (including any objects pointed to by the action).

Parameters:
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
AC_FAIL: There was not enough room in the operation history for the action and the user did not wish to continue. Usually End() should be called in this situation.
AC_NORECORD: There was not enough room in the operation history for the action, but the user requested that he wished to continue without undo.

AC_OK : The action was successfully initialised and added to the operation.

The function simply calls the Action::Init function passing the runtime class of an UndoColAction.

Returns:
Errors: -
See also:
Action::Init

Definition at line 377 of file blobby.cpp.

00381 {
00382 
00383     return(Action::Init(pOp,
00384                         pActionList,
00385                         ActionSize,
00386                         CC_RUNTIME_CLASS(UndoColAction),
00387                         NewAction));
00388 }


Friends And Related Function Documentation

friend class BlobbyOp [friend]
 

Definition at line 160 of file blobby.h.

friend class RedoColAction [friend]
 

Definition at line 159 of file blobby.h.


Member Data Documentation

DocColour UndoColAction::Color [private]
 

Definition at line 170 of file blobby.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:02:38 2007 for Camelot by  doxygen 1.4.4