OpGridDuplicate Class Reference

This class represents the grid Duplicate operation. Currently, it just greys out the menu/button/keypress associated with the op. More...

#include <gridtool.h>

Inheritance diagram for OpGridDuplicate:

OpGrid UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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

Detailed Description

This class represents the grid Duplicate operation. Currently, it just greys out the menu/button/keypress associated with the op.

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

Definition at line 479 of file gridtool.h.


Member Function Documentation

void OpGridDuplicate::Do OpDescriptor  )  [virtual]
 

Performs the Delete operation.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/94
Parameters:
OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

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 }           

void OpGridDuplicate::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/94
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

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 }  

OpState OpGridDuplicate::GetState String_256 UIDescription,
OpDescriptor
[static]
 

For finding OpGridDuplicate's state.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/7/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpGridDuplicate

Errors: -

See also:
-

Definition at line 3445 of file gridtool.cpp.

03446 {
03447     return (OpGridDelete::GetState(UIDescription,NULL));
03448 }


Member Data Documentation

BOOL OpGridDuplicate::Plural [private]
 

Definition at line 489 of file gridtool.h.


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