#include <opdupbar.h>
Inheritance diagram for OpDelBar:
Public Member Functions | |
OpDelBar () | |
void | DoWithParam (OpDescriptor *token, OpParam *pOpParam) |
Static Public Member Functions | |
static BOOL | Init () |
OpDelBar initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the operations state. | |
static BOOL | DelBar (const StringBase &BarName, INT32 State, UndoableOperation *pOp) |
Definition at line 227 of file opdupbar.h.
|
Definition at line 960 of file opdupbar.cpp. 00960 : CarbonCopyOp() 00961 { 00962 }
|
|
Definition at line 1053 of file opdupbar.cpp. 01054 { 01055 String_256 templayer; 01056 Layer * pLayer = NULL; 01057 01058 // Prepare an ObjChangeParam so we can mark which nodes will allow this op to happen to them 01059 ObjChangeFlags cFlags; 01060 cFlags.DeleteNode = TRUE; 01061 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,pOp); 01062 01063 List BarList; 01064 01065 templayer.Load(_R(IDS_ROLLOVER_DEFAULT)); 01066 pLayer = SliceHelper::FindLayerCalled(templayer); 01067 Layer * pDefLayer = pLayer; 01068 if ((State == 0 || State == 5 ) && pLayer) 01069 SliceHelper::BuildListOfNodesInBar(&BarList, pLayer, BarName); 01070 01071 templayer.Load(_R(IDS_ROLLOVER_MOUSE)); 01072 pLayer = SliceHelper::FindLayerCalled(templayer); 01073 if ((State == 1 || State == 5 ) && pLayer) 01074 SliceHelper::BuildListOfNodesInBar(&BarList, pLayer, BarName); 01075 01076 templayer.Load(_R(IDS_ROLLOVER_CLICKED)); 01077 pLayer = SliceHelper::FindLayerCalled(templayer); 01078 if ((State == 2 || State == 5 ) && pLayer) 01079 SliceHelper::BuildListOfNodesInBar(&BarList, pLayer, BarName); 01080 01081 templayer.Load(_R(IDS_ROLLOVER_SELECTED)); 01082 pLayer = SliceHelper::FindLayerCalled(templayer); 01083 if ((State == 3 || State == 5 ) && pLayer) 01084 SliceHelper::BuildListOfNodesInBar(&BarList, pLayer, BarName); 01085 01086 templayer.Load(_R(IDS_BACK_BAR)); 01087 pLayer = SliceHelper::FindLayerCalled(templayer); 01088 if ((State == 4 || State == 5 ) && pLayer) 01089 SliceHelper::BuildListOfNodesInBar(&BarList, pLayer, BarName); 01090 01091 01092 01093 01094 // loop through all nodes in the list to delete 01095 NodeListItem *pNodeListItem = (NodeListItem *)BarList.GetHead(); 01096 01097 while (pNodeListItem) 01098 { 01099 NodeListItem *pNextNodeListItem = (NodeListItem *)BarList.GetNext(pNodeListItem); 01100 01101 Node * pNode = pNodeListItem->pNode->FindParent(); 01102 01103 if (pNode && pNode->AllowOp(&ObjChange)) 01104 { 01105 pOp->DoInvalidateNodeRegion((NodeRenderableBounded*) pNode, TRUE, FALSE); 01106 pOp->DoHideNode(pNode, TRUE); 01107 } 01108 01109 // tidy up the list as we go along 01110 BarList.RemoveItem((NodeListItem *)pNodeListItem); 01111 delete pNodeListItem; 01112 01113 pNodeListItem = pNextNodeListItem; 01114 } 01115 01116 ObjChange.Define(OBJCHANGE_FINISHED,cFlags,NULL,pOp); 01117 pOp->UpdateChangedNodes(&ObjChange); 01118 01119 BROADCAST_TO_ALL(SelChangingMsg(SelChangingMsg::NONCOLOURATTCHANGED)); 01120 01121 return TRUE; 01122 }
|
|
Reimplemented from Operation. Definition at line 1032 of file opdupbar.cpp. 01033 { 01034 if (DoStartSelOp(FALSE,TRUE)) // Try to record the selection state 01035 { 01036 // Delete the bar 01037 DelBar(((OpParamDelBar *)pOpParam)->m_BarName, ((OpParamDelBar *)pOpParam)->m_State, this); 01038 01039 // end the op 01040 End(); 01041 01042 DialogBarOp::SetSystemStateChanged(); 01043 DialogBarOp::UpdateStateOfAllBars(); 01044 01045 } 01046 else 01047 { 01048 FailAndExecute(); 01049 End(); 01050 } 01051 }
|
|
For finding the operations state.
Reimplemented from CarbonCopyOp. Definition at line 1007 of file opdupbar.cpp. 01008 { 01009 OpState OpSt; 01010 01011 // if we don't allow it 01012 OpSt.Greyed = TRUE; 01013 Spread* pSpread = Document::GetSelectedSpread(); 01014 if (pSpread && !pSpread->FindActiveLayer()->IsFrame()) 01015 OpSt.Greyed = FALSE; 01016 01017 return(OpSt); 01018 }
|
|
OpDelBar initialiser method.
Reimplemented from SimpleCCObject. Definition at line 977 of file opdupbar.cpp. 00978 { 00979 return (RegisterOpDescriptor(0, 00980 _R(IDS_DEL_BAR), 00981 CC_RUNTIME_CLASS(OpDelBar), 00982 OPTOKEN_DELBAROP, 00983 OpDelBar::GetState, 00984 0, // help ID 00985 0, // bubble help 00986 0, // resource ID 00987 0, // control ID 00988 SYSTEMBAR_ILLEGAL, // Bar ID 00989 TRUE, // Receive messages 00990 FALSE, 00991 FALSE, 00992 0, 00993 (GREY_WHEN_NO_CURRENT_DOC | DONT_GREY_WHEN_SELECT_INSIDE) )); 00994 }
|