#include <gridtool.h>
Inheritance diagram for OpGridDuplicate:
Public Member Functions | |
void | Do (OpDescriptor *) |
Performs the Delete operation. | |
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. | |
Static Public Member Functions | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding OpGridDuplicate's state. | |
Private Attributes | |
BOOL | Plural |
Definition at line 479 of file gridtool.h.
|
Performs the Delete operation.
Reimplemented from Operation. Definition at line 3466 of file gridtool.cpp. 03467 { 03468 // We haven't shown a grid in the infobar yet, so set these to NULL 03469 PreOpDisplayedGrid = NULL; 03470 PostOpDisplayedGrid = NULL; 03471 03472 Spread* SpreadClicked = GridTool::GetSpreadClicked(); 03473 03474 GridInfoBarOp* pGridInfoBarOp = GridTool::GetGridInfoBarOp(); 03475 if (pGridInfoBarOp != NULL) 03476 PreOpDisplayedGrid = pGridInfoBarOp->GetLastGridDisplayed(); 03477 03478 BOOL ok = (SpreadClicked != NULL); 03479 UINT32 SelCount=0; 03480 03481 if (ok) 03482 { 03483 // scan the children of the spread for grids 03484 Node* pNode = SpreadClicked->FindFirstChild(); 03485 while (pNode != NULL && ok) 03486 { 03487 Node* pNodeCurrent = pNode; 03488 pNode = pNode->FindNext(); 03489 03490 if (pNodeCurrent->IsKindOf(CC_RUNTIME_CLASS(NodeGrid))) 03491 { 03492 // we now have a ptr to a grid, so render those blobs 03493 NodeGrid* pGrid = (NodeGrid*)pNodeCurrent; 03494 03495 if (pGrid->IsGridSelected() && !pGrid->IsDefault()) 03496 { 03497 SelCount++; 03498 03499 NodeGrid* pNewGrid = DoDuplicateGrid( pGrid,NEXT,pGrid, 03500 SpreadClicked,SpreadClicked,TRUE, 03501 28346,-28346); 03502 03503 ok = (pNewGrid != NULL); 03504 03505 if (ok) 03506 { 03507 pGrid->SetGridSelected(FALSE); 03508 if (pGrid == PreOpDisplayedGrid) 03509 { 03510 GridTool::DisplayGridInfo(pNewGrid); 03511 PostOpDisplayedGrid = pNewGrid; 03512 } 03513 } 03514 } 03515 } 03516 } 03517 } 03518 03519 if (!ok) 03520 FailAndExecute(); 03521 else 03522 { 03523 NodeGrid::RecalcNumSelectedGrids(SpreadClicked); 03524 pGridInfoBarOp->EnableControls(); 03525 } 03526 03527 Plural = (SelCount > 1); 03528 03529 End(); 03530 }
|
|
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 3549 of file gridtool.cpp. 03550 { 03551 if (Plural) 03552 *OpName = String_256(_R(IDS_GRID_UNDO_DUPS)); 03553 else 03554 *OpName = String_256(_R(IDS_GRID_UNDO_DUP)); 03555 }
|
|
For finding OpGridDuplicate's state.
Definition at line 3445 of file gridtool.cpp. 03446 { 03447 return (OpGridDelete::GetState(UIDescription,NULL)); 03448 }
|
|
Definition at line 489 of file gridtool.h. |