#include <moldtool.h>
Inheritance diagram for OpDetachMould:
Public Member Functions | |
OpDetachMould () | |
Constructor for Detach mould 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 detach mould operation so that it can be accessed from the interface. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpDetachMould state. |
Definition at line 495 of file moldtool.h.
|
Constructor for Detach mould operation.
Definition at line 2724 of file moldtool.cpp.
|
|
Reimplemented from Operation. Definition at line 2828 of file moldtool.cpp. 02829 { 02830 BeginSlowJob(); 02831 02832 // Note, I only spent the whole afternoon trying to work out why DoStartSelOp(XX,YY) 02833 // Was completely screwing up the selection here. Anyway, the solution was to 02834 // derive this op from UndoableOperation, not SelOperation which solved the problem 02835 // immediately. The morel is, if the selection is not changing, dont use SelOperation! 02836 // + It stops lots of flashing of blobs too. 02837 02838 // Scan the selection 02839 SelRange* Selected = GetApplication()->FindSelection(); 02840 Node* pNode = Selected->FindFirst(); 02841 while (pNode) 02842 { 02843 if (pNode->GetRuntimeClass() == CC_RUNTIME_CLASS(NodeMould)) 02844 { 02845 NodeMould* pMould = (NodeMould*)pNode; 02846 02847 SaveDetachAction* pSaveDetAct; 02848 ALLOC_WITH_FAIL(pSaveDetAct, (new SaveDetachAction), this); 02849 if (pSaveDetAct==NULL) 02850 { 02851 FailAndExecute(); End(); return; 02852 } 02853 02854 if ((pSaveDetAct->Save(this, pMould))==AC_FAIL) 02855 { 02856 FailAndExecute(); End(); return; 02857 } 02858 02859 // toggle the detach type 02860 pMould->ToggleDetachFlag(); 02861 02862 if (!pMould->IsDetached()) 02863 { 02864 if (!DoInvalidateNodeRegion(pMould,TRUE)) 02865 { 02866 FailAndExecute(); End(); return; 02867 } 02868 02869 if (pMould->StartSaveContext(this,REC_REBUILD)!=CC_OK) 02870 { 02871 FailAndExecute(); End(); return; 02872 } 02873 02874 if (pMould->RemouldAll(this)!=CC_OK) 02875 { 02876 FailAndExecute(); End(); return; 02877 } 02878 02879 if (pMould->EndSaveContext(this,REC_REBUILD)!=CC_OK) 02880 { 02881 FailAndExecute(); End(); return; 02882 } 02883 } 02884 } 02885 pNode = Selected->FindNext(pNode); 02886 } 02887 02888 End(); 02889 }
|
|
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 2806 of file moldtool.cpp. 02807 { 02808 *OpName = String_256(_R(IDS_UNDO_DETACHMOULD)); 02809 }
|
|
For finding the OpDetachMould state.
Definition at line 2777 of file moldtool.cpp. 02778 { 02779 OpState OpSt; 02780 String_256 DisableReason; 02781 02782 NodeMould* pLastMould; 02783 INT32 nmoulds = MouldInfoBarOp::SelInfo(&pLastMould); 02784 02785 // Set the detach operation tick and grey fields correctly 02786 OpSt.Greyed = (nmoulds==0); 02787 OpSt.Ticked = ((nmoulds==1) && pLastMould->IsDetached()); 02788 02789 return (OpSt); 02790 }
|
|
Initialise the detach mould operation so that it can be accessed from the interface.
Reimplemented from SimpleCCObject. Definition at line 2750 of file moldtool.cpp. 02751 { 02752 return (RegisterOpDescriptor(0, // tool ID 02753 _R(IDS_DETACHMOULD), // string resource ID 02754 CC_RUNTIME_CLASS(OpDetachMould), // runtime class for Op 02755 OPTOKEN_DETACHMOULD, // Ptr to token string 02756 OpDetachMould::GetState, // GetState function 02757 0, // help ID 02758 _R(IDBBL_DETACHMOULD), // bubble help ID 02759 0 02760 )); 02761 }
|