#include <moldtool.h>
Inheritance diagram for OpRemoveMould:
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. |
Definition at line 345 of file moldtool.h.
|
Constructor for remove mould shape operation.
Definition at line 1640 of file moldtool.cpp.
|
|
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 }
|
|
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 1737 of file moldtool.cpp. 01738 { 01739 *OpName = String_256(_R(IDS_UNDO_REMOVEMOULD)); 01740 }
|
|
For finding the OpRemoveMould state.
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 }
|
|
Initialise the remove mould operation so that it can be accessed from the interface.
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 }
|