OpGrid Class Reference

Base class all grid operations are derived from. More...

#include <gridtool.h>

Inheritance diagram for OpGrid:

UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject OpGridChange OpGridCopy OpGridCut OpGridDelete OpGridDuplicate OpGridNewResize OpGridPaste OpGridSelection List of all members.

Public Member Functions

 OpGrid ()
NodeGridGetPreOpDisplayedGrid ()
NodeGridGetPostOpDisplayedGrid ()
NodeGridDoDuplicateGrid (NodeGrid *pGrid, AttachNodeDirection AttDir, Node *pContextNode, Spread *pSrcSpread, Spread *pDestSpread, BOOL FRedraw, INT32 XDelta=0, INT32 YDelta=0)
 Duplicates the given grid and sticks it in a document node tree Should be called from an operation's Do function as undo information is generated.

Protected Attributes

NodeGridPreOpDisplayedGrid
NodeGridPostOpDisplayedGrid

Private Member Functions

 CC_DECLARE_DYNCREATE (OpGrid)

Detailed Description

Base class all grid operations are derived from.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/7/94

Definition at line 220 of file gridtool.h.


Constructor & Destructor Documentation

OpGrid::OpGrid  )  [inline]
 

Definition at line 226 of file gridtool.h.


Member Function Documentation

OpGrid::CC_DECLARE_DYNCREATE OpGrid   )  [private]
 

NodeGrid * OpGrid::DoDuplicateGrid NodeGrid pGrid,
AttachNodeDirection  AttDir,
Node pContextNode,
Spread pSrcSpread,
Spread pDestSpread,
BOOL  FRedraw,
INT32  XDelta = 0,
INT32  YDelta = 0
 

Duplicates the given grid and sticks it in a document node tree Should be called from an operation's Do function as undo information is generated.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/94
Parameters:
pGrid,[INPUTS] AttDir, pContextNode, pSrcSpread, pDestSpread, FRedraw, XDelta, YDelta
- [OUTPUTS]
Returns:
ptr the new grid which is a duplicate of the given grid Returns NULL if unable to duplicate the node
See also:
-

Definition at line 1562 of file gridtool.cpp.

01570 {
01571     BOOL        ok=FALSE;
01572     NodeGrid*   pNewGrid;
01573     DocRect     OldRect,NewRect;
01574 
01575     OldRect = pGrid->GetBoundingRect();
01576     NewRect = OldRect;
01577     NewRect.Translate(XDelta,YDelta);
01578 
01579     switch (pGrid->GetGridType())
01580     {
01581         case RECTANGULAR    : ALLOC_WITH_FAIL(pNewGrid,(new NodeGridRect()),this); break;
01582         case ISOMETRIC      : ALLOC_WITH_FAIL(pNewGrid,(new NodeGridIso()), this); break;
01583     }
01584 
01585     ok = (pNewGrid != NULL);
01586     if (ok) ok = DoInsertNewNode(pNewGrid,pContextNode,AttDir,TRUE);
01587     if (ok) ok = DoInvalidateNodeRegion(pNewGrid, TRUE);
01588     if (ok) ok = DoInvalidateNodeRegion(pGrid,    TRUE);
01589 
01590     if (ok)
01591     {
01592         pNewGrid->SetGridParams(pGrid->GetDivisions(),pGrid->GetSubdivisions(),pGrid->GetUnits());
01593         pNewGrid->SetGridSelected(pGrid->IsGridSelected());
01594         NodeGrid::RecalcNumSelectedGrids(pDestSpread);
01595 
01596         if (FRedraw)
01597         {
01598             GridTool::ForceRedraw(pSrcSpread, OldRect);
01599             GridTool::ForceRedraw(pDestSpread,NewRect);
01600         }
01601 
01602         if (!FRedraw) GridTool::RenderAllGridBlobs(pNewGrid);
01603         pNewGrid->SetBoundingRect(NewRect);
01604         if (!FRedraw) GridTool::RenderAllGridBlobs(pNewGrid);
01605     }
01606 
01607     if (!ok) 
01608         return (NULL); 
01609     else 
01610         return (pNewGrid);
01611 }

NodeGrid* OpGrid::GetPostOpDisplayedGrid  )  [inline]
 

Definition at line 229 of file gridtool.h.

00229 { return PostOpDisplayedGrid; }

NodeGrid* OpGrid::GetPreOpDisplayedGrid  )  [inline]
 

Definition at line 228 of file gridtool.h.

00228 { return PreOpDisplayedGrid; }


Member Data Documentation

NodeGrid* OpGrid::PostOpDisplayedGrid [protected]
 

Definition at line 242 of file gridtool.h.

NodeGrid* OpGrid::PreOpDisplayedGrid [protected]
 

Definition at line 241 of file gridtool.h.


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