InvalidateRectAction Class Reference

When executed this action will Force a redraw of a bounding rectangle over a certain spread. More...

#include <moldedit.h>

Inheritance diagram for InvalidateRectAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 InvalidateRectAction ()
 InvalidateRectAction constructor.
virtual ActionCode Execute ()
 Executes the InvalidateRectAction which invalidates a rectangular region of the current document.

Static Public Member Functions

static ActionCode DoRecord (Operation *const pOp, const DocRect &Rect, Spread *pSpread)
 This simple action saves away a rectangle on the undo, which will be invalidated during execution of undo and redo.
static ActionCode Init (Operation *const pOp, ActionList *pActionList, const DocRect &Rect, Spread *pSpread, Action **NewAction)
 This simple action invalidates a rectangular region.

Private Attributes

DocRect InvalidRect
SpreadInvalidSpread

Detailed Description

When executed this action will Force a redraw of a bounding rectangle over a certain spread.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95
See also:
-

Definition at line 287 of file moldedit.h.


Constructor & Destructor Documentation

InvalidateRectAction::InvalidateRectAction  ) 
 

InvalidateRectAction constructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95

Definition at line 1271 of file moldedit.cpp.

01272 {
01273     InvalidSpread=NULL;
01274 }


Member Function Documentation

ActionCode InvalidateRectAction::DoRecord Operation *const   pOp,
const DocRect Rect,
Spread pSpread
[static]
 

This simple action saves away a rectangle on the undo, which will be invalidated during execution of undo and redo.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95
Parameters:
pOp = The operation to which the action should be added [INPUTS] Rect = The rectangle to save pSpread = The rectangles spread
- [OUTPUTS]
Returns:
ActionCode: one of AC_OK, AC_NORESTORE, AC_FAIL

Definition at line 1297 of file moldedit.cpp.

01300 {
01301     InvalidateRectAction* InvRctAct;  
01302     // Attempt to initialise the next action    
01303     return InvalidateRectAction::Init(pOp, pOp->GetUndoActionList(), Rect, pSpread, (Action**)(&InvRctAct));
01304 }

ActionCode InvalidateRectAction::Execute  )  [virtual]
 

Executes the InvalidateRectAction which invalidates a rectangular region of the current document.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95
Parameters:
- [INPUTS]
Returns:
ActionCode indicating if the action was successfully executed or not

Reimplemented from Action.

Definition at line 1361 of file moldedit.cpp.

01362 {
01363     InvalidateRectAction* InvRctAct;  
01364     ActionCode Ac;  
01365     // Attempt to initialise the next action    
01366     Ac = InvalidateRectAction::Init(pOperation, pOppositeActLst, InvalidRect, InvalidSpread, (Action**)(&InvRctAct));
01367     
01368     if (Ac!=AC_FAIL)
01369     {   
01370         // The action was successfully initialised   
01371         Document* pDocument = Document::GetCurrent();
01372         ENSURE(pDocument!=NULL, "There was no current document in InvalidateRectAction" );
01373         if (pDocument!=NULL)
01374             pDocument->ForceRedraw(InvalidSpread, InvalidRect);
01375 
01376     }
01377     return Ac;
01378 }   

ActionCode InvalidateRectAction::Init Operation *const   pOp,
ActionList pActionList,
const DocRect Rect,
Spread pSpread,
Action **  NewAction
[static]
 

This simple action invalidates a rectangular region.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/01/95
Parameters:
pOp,: The operation to which the action should be added [INPUTS] pActionList: The action list in the operation object pSpread: The rectangles spread
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
ActionCode: one of AC_OK, AC_NORESTORE, AC_FAIL

Definition at line 1327 of file moldedit.cpp.

01332 {       
01333     ActionCode Ac = (Action::Init(pOp,
01334                                   pActionList,
01335                                   sizeof(InvalidateRectAction), 
01336                                   CC_RUNTIME_CLASS(InvalidateRectAction), 
01337                                   NewAction));
01338     if (*NewAction != NULL)
01339     {
01340         ((InvalidateRectAction*)(*NewAction))->InvalidRect = Rect;
01341         ((InvalidateRectAction*)(*NewAction))->InvalidSpread = pSpread; 
01342     }
01343     return (Ac); 
01344 } 


Member Data Documentation

DocRect InvalidateRectAction::InvalidRect [private]
 

Definition at line 307 of file moldedit.h.

Spread* InvalidateRectAction::InvalidSpread [private]
 

Definition at line 308 of file moldedit.h.


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