#include <gridtool.h>
Inheritance diagram for OpGridChange:
Public Member Functions | |
OpGridChange () | |
Constructor. | |
~OpGridChange () | |
Destructor. | |
void | GetOpName (String_256 *OpName) |
The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies. | |
void | DoChangeSelectedGrids (ChangeGrid *pChangeGrid) |
Changes all the selected grids using the given ChangeGrid object. | |
BOOL | DoChangeGrid (NodeGrid *pOldGrid, ChangeGrid *pChangeGrid) |
Changes the given grid to reflect the default grid values of the grid tool. | |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Find out the state of the operation at the specific time. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpGridChange) | |
Private Attributes | |
UINT32 | ChangeGridUndoIDS |
Definition at line 375 of file gridtool.h.
|
Constructor.
Definition at line 2493 of file gridtool.cpp.
|
|
Destructor.
Definition at line 2507 of file gridtool.cpp.
|
|
|
|
Adds the operation to the list of all known operations.
Definition at line 2523 of file gridtool.cpp. 02524 { 02525 return (RegisterOpDescriptor( 02526 0, 02527 _R(IDS_GRID_TOOL), 02528 CC_RUNTIME_CLASS(OpGridChange), 02529 OPTOKEN_GRIDCHANGE, 02530 OpGridChange::GetState, 02531 0, /* help ID */ 02532 _R(IDBBL_NOOP), /* bubble ID */ 02533 0 /* bitmap ID */ 02534 )); 02535 }
|
|
Changes the given grid to reflect the default grid values of the grid tool.
Definition at line 2661 of file gridtool.cpp. 02662 { 02663 DocRect DummyRect; 02664 NodeGrid* pNewGrid; 02665 BOOL ok = TRUE; 02666 02667 switch (pChangeGrid->GetGridType(pOldGrid)) 02668 { 02669 case RECTANGULAR : ALLOC_WITH_FAIL(pNewGrid,(new NodeGridRect()),this); break; 02670 case ISOMETRIC : ALLOC_WITH_FAIL(pNewGrid,(new NodeGridIso()), this); break; 02671 } 02672 02673 ok = (pNewGrid != NULL); 02674 if (ok) ok = DoInsertNewNode(pNewGrid,pOldGrid,NEXT,TRUE); 02675 if (ok) ok = DoInvalidateNodeRegion(pOldGrid, TRUE); 02676 if (ok) ok = DoHideNode(pOldGrid,TRUE); 02677 02678 if (ok) 02679 { 02680 pNewGrid->SetGridParams(pOldGrid->GetDivisions(), 02681 pOldGrid->GetSubdivisions(), 02682 pOldGrid->GetUnits()); 02683 02684 pChangeGrid->Change(pNewGrid); 02685 PostOpDisplayedGrid = pNewGrid; 02686 02687 pNewGrid->SetBoundingRect(pOldGrid->GetBoundingRect()); 02688 pNewGrid->SetGridSelected(pOldGrid->IsGridSelected()); 02689 pNewGrid->SetDefault(pOldGrid->IsDefault()); 02690 } 02691 02692 return (ok); 02693 }
|
|
Changes all the selected grids using the given ChangeGrid object.
Definition at line 2595 of file gridtool.cpp. 02596 { 02597 // We haven't shown a grid in the infobar yet, so set these to NULL 02598 PreOpDisplayedGrid = NULL; 02599 PostOpDisplayedGrid = NULL; 02600 02601 Spread* SpreadClicked = GridTool::GetSpreadClicked(); 02602 02603 GridInfoBarOp* pGridInfoBarOp = GridTool::GetGridInfoBarOp(); 02604 if (pGridInfoBarOp != NULL) 02605 PreOpDisplayedGrid = pGridInfoBarOp->GetLastGridDisplayed(); 02606 02607 BOOL ok = (SpreadClicked != NULL); 02608 if (ok) ok = (pChangeGrid != NULL); 02609 02610 if (ok) 02611 { 02612 // scan the children of the spread for grids 02613 Node* pNode = SpreadClicked->FindFirstChild(); 02614 while (pNode != NULL && ok) 02615 { 02616 Node* pNodeCurrent = pNode; 02617 pNode = pNode->FindNext(); 02618 02619 if (pNodeCurrent->IsKindOf(CC_RUNTIME_CLASS(NodeGrid))) 02620 { 02621 // we now have a ptr to a grid, so render those blobs 02622 NodeGrid* pGrid = (NodeGrid*)pNodeCurrent; 02623 02624 if (pGrid->IsGridSelected()) 02625 { 02626 GridTool::ForceRedraw(pGrid); 02627 ok = DoChangeGrid(pGrid,pChangeGrid); 02628 } 02629 } 02630 } 02631 } 02632 02633 if (!ok) 02634 FailAndExecute(); 02635 else 02636 { 02637 ChangeGridUndoIDS = pChangeGrid->GetUndoIDS(); 02638 if (PostOpDisplayedGrid != NULL) 02639 GridTool::DisplayGridInfo(PostOpDisplayedGrid); 02640 } 02641 02642 delete pChangeGrid; 02643 02644 End(); 02645 }
|
|
The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.
Reimplemented from Operation. Definition at line 2576 of file gridtool.cpp. 02577 { 02578 *OpName = String_256(ChangeGridUndoIDS); 02579 }
|
|
Find out the state of the operation at the specific time.
Definition at line 2552 of file gridtool.cpp. 02553 { 02554 OpState Grid; 02555 02556 return Grid; 02557 }
|
|
Definition at line 394 of file gridtool.h. |