OpRemoveMould Class Reference

An undoable operation to remove the mould shape from a mould object. More...

#include <moldtool.h>

Inheritance diagram for OpRemoveMould:

OpMouldLibSel SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 OpRemoveMould ()
 Constructor for remove mould shape 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.
void Do (OpDescriptor *)

Static Public Member Functions

static BOOL Init ()
 Initialise the remove mould operation so that it can be accessed from the interface.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpRemoveMould state.

Detailed Description

An undoable operation to remove the mould shape from a mould object.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95

Definition at line 345 of file moldtool.h.


Constructor & Destructor Documentation

OpRemoveMould::OpRemoveMould  ) 
 

Constructor for remove mould shape operation.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
See also:
-

Definition at line 1640 of file moldtool.cpp.

01641 {
01642     // Dummy constructor
01643 }


Member Function Documentation

void OpRemoveMould::Do OpDescriptor  )  [virtual]
 

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
pointer to an OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: failandexecute will be called if the operation fails in some way, most likely when no memory is available.

Reimplemented from Operation.

Definition at line 1762 of file moldtool.cpp.

01763 {
01764     BeginSlowJob();
01765 
01766     // remember the selection before the operation
01767     if (DoStartSelOp(FALSE,FALSE))
01768     {
01769         // Obtain the current selections 
01770         SelRange* Selected = GetApplication()->FindSelection();
01771         if (Selected)
01772         {
01773             // compile a list of the selected objects
01774             DocRect Bounds = Selected->GetBoundingRect();
01775             List* pNodeList = Selected->MakeListOfNodes();
01776 
01777             // remove all mould objects in the list
01778             BOOL success = DoRemoveAllMoulds(pNodeList);
01779 
01780             // delete all elements in our compiled list
01781             while (!pNodeList->IsEmpty())
01782                 delete (NodeListItem*)(pNodeList->RemoveHead());
01783             delete pNodeList;
01784 
01785             // update the selection
01786             if (success)
01787             {
01788                 // Update all the changed parents.
01789                 ObjChangeFlags cFlags;
01790                 cFlags.MultiReplaceNode = TRUE;
01791                 ObjChangeParam ObjChange(OBJCHANGE_FINISHED,cFlags,NULL,this);
01792                 if (!UpdateChangedNodes(&ObjChange))
01793                     FailAndExecute();                   
01794             }
01795             else
01796                 FailAndExecute();
01797         }
01798         else
01799             FailAndExecute();
01800     }
01801     else
01802         FailAndExecute();
01803 
01804     End();
01805 }

void OpRemoveMould::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:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Reimplemented from Operation.

Definition at line 1737 of file moldtool.cpp.

01738 {
01739     *OpName = String_256(_R(IDS_UNDO_REMOVEMOULD));
01740 }

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

For finding the OpRemoveMould state.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpRemoveMould

Definition at line 1694 of file moldtool.cpp.

01695 {
01696     OpState OpSt;
01697     String_256 DisableReason; 
01698     OpSt.Greyed = TRUE;
01699     
01700 //  if (!IsAMouldSelected(NULL))
01701 //      OpSt.Greyed=TRUE;
01702 
01703     ObjChangeFlags cFlags;
01704     cFlags.MultiReplaceNode = TRUE;
01705     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL);
01706     
01707     SelRange* pSelRange = GetApplication()->FindSelection();
01708     Node* pNode = pSelRange->FindFirst();
01709 
01710     while (pNode != NULL && OpSt.Greyed)
01711     {
01712         if (IS_A(pNode,NodeMould))
01713             OpSt.Greyed = !(pNode->AllowOp(&ObjChange,FALSE));
01714 
01715         pNode = pSelRange->FindNext(pNode);
01716     }
01717 
01718     return (OpSt);   
01719 }

BOOL OpRemoveMould::Init void   )  [static]
 

Initialise the remove mould operation so that it can be accessed from the interface.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

See also:
-

Reimplemented from SimpleCCObject.

Definition at line 1666 of file moldtool.cpp.

01667 {
01668     return (RegisterOpDescriptor(0,                                 // tool ID
01669                                 _R(IDS_REMOVEMOULD),                    // string resource ID
01670                                 CC_RUNTIME_CLASS(OpRemoveMould),    // runtime class for Op
01671                                 OPTOKEN_REMOVEMOULD,                // Ptr to token string
01672                                 OpRemoveMould::GetState,            // GetState function
01673                                 0,                                  // help ID
01674                                 _R(IDBBL_REMOVEMOULD),              // bubble help ID
01675                                 _R(IDC_REMOVEMOULD),                // resource ID
01676                                 _R(IDC_REMOVEMOULD)                 // control ID
01677                                 ));
01678 }               


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