#include <gridtool.h>
Inheritance diagram for OpGrid:
Public Member Functions | |
OpGrid () | |
NodeGrid * | GetPreOpDisplayedGrid () |
NodeGrid * | GetPostOpDisplayedGrid () |
NodeGrid * | 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. | |
Protected Attributes | |
NodeGrid * | PreOpDisplayedGrid |
NodeGrid * | PostOpDisplayedGrid |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpGrid) |
Definition at line 220 of file gridtool.h.
|
Definition at line 226 of file gridtool.h. 00226 { PreOpDisplayedGrid = PostOpDisplayedGrid = NULL; }
|
|
|
|
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.
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 }
|
|
Definition at line 229 of file gridtool.h. 00229 { return PostOpDisplayedGrid; }
|
|
Definition at line 228 of file gridtool.h. 00228 { return PreOpDisplayedGrid; }
|
|
Definition at line 242 of file gridtool.h. |
|
Definition at line 241 of file gridtool.h. |