#include <mkshapes.h>
Inheritance diagram for OpMakeShapes:
Public Member Functions | |
OpMakeShapes () | |
OpMakeShapes constructor. | |
void | Do (OpDescriptor *) |
Performs the MakeShapes operation. | |
Static Public Member Functions | |
static BOOL | Init () |
OpMakeShapes initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpMakeShapes's state. |
Definition at line 120 of file mkshapes.h.
|
OpMakeShapes constructor.
Definition at line 134 of file mkshapes.cpp. 00134 : SelOperation() 00135 { 00136 }
|
|
Performs the MakeShapes operation.
Reimplemented from Operation. Definition at line 219 of file mkshapes.cpp. 00220 { 00221 // Obtain the current selections 00222 Range Selection(*GetApplication()->FindSelection()); 00223 RangeControl rg = Selection.GetRangeControlFlags(); 00224 rg.PromoteToParent = TRUE; 00225 Selection.Range::SetRangeControl(rg); 00226 00227 // change the selection flags 00228 00229 Node* CurrentNode = Selection.FindFirst(); 00230 BOOL Success = TRUE; 00231 00232 ERROR3IF(CurrentNode == NULL, "Make shapes called with no nodes selected"); 00233 00234 if (CurrentNode != NULL) // No nodes selected so End 00235 { 00236 // We need to invalidate the region 00237 if (Success) 00238 Success = DoInvalidateNodesRegions(Selection, TRUE, FALSE, FALSE, FALSE); // Don't recache 00239 00240 // Try to record the selection state, don't render the blobs though 00241 if (Success) 00242 Success = DoStartSelOp(FALSE,FALSE); 00243 00244 // The DoMakeShapes function does all the work 00245 while (Success && CurrentNode!=NULL) 00246 { 00247 Node* Next = Selection.FindNext(CurrentNode); 00248 00249 // BODGE - since the group is selected and won't be replaced by anything else, no need to reselect it 00250 // this fixes a bug where make shapes on grouped text stories/molds/blends don't leave the parent group 00251 // selected but selects the objects inside! 00252 BOOL reselect = !IS_A(CurrentNode,NodeGroup) && !IS_A(CurrentNode,NodeBlend); 00253 // BOOL ok = TRUE; 00254 00255 00256 ObjChangeFlags cFlags(TRUE); 00257 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 00258 if (CurrentNode->AllowOp(&ObjChange)) 00259 { 00260 BecomeA BecomeAPath(BECOMEA_REPLACE,CC_RUNTIME_CLASS(NodePath), this, reselect); 00261 BecomeAPath.SetResultsStayInPlace(TRUE); 00262 Success = CurrentNode->DoBecomeA(&BecomeAPath); 00263 } 00264 00265 CurrentNode = Next; 00266 } 00267 00268 // We need to invalidate the region again for the new positions 00269 GetApplication()->FindSelection()->Update(); 00270 if (Success) 00271 Success = DoInvalidateNodesRegions(*GetApplication()->FindSelection(), TRUE); 00272 } 00273 00274 if (!Success) 00275 { 00276 InformError(); 00277 FailAndExecute(); 00278 } 00279 00280 End(); 00281 }
|
|
For finding the OpMakeShapes's state.
Definition at line 186 of file mkshapes.cpp. 00187 { 00188 OpState OpSt; 00189 00190 SelRange Sel(*(GetApplication()->FindSelection())); 00191 RangeControl rg = Sel.GetRangeControlFlags(); 00192 rg.PromoteToParent = TRUE; 00193 Sel.Range::SetRangeControl(rg); 00194 00195 00196 // Set up the ObjChangeParam so we can ask the selected nodes if they mind being deleted 00197 ObjChangeFlags cFlags(TRUE); 00198 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 00199 00200 // Will one or more selected nodes allow this op? 00201 if (!Sel.AllowOp(&ObjChange,FALSE)) 00202 OpSt.Greyed = TRUE; 00203 00204 return(OpSt); 00205 }
|
|
OpMakeShapes initialiser method.
Reimplemented from SimpleCCObject. Definition at line 155 of file mkshapes.cpp. 00156 { 00157 return (RegisterOpDescriptor(0, // tool id 00158 _R(IDS_MAKESHAPESOP), // Ops name 00159 CC_RUNTIME_CLASS(OpMakeShapes), // Ops class 00160 OPTOKEN_MAKE_SHAPES, // Op token 00161 OpMakeShapes::GetState, // Get state function 00162 0, // help ID 00163 _R(IDBBL_MAKESHAPES), // Bubble help 00164 0, // Bitmap ID 00165 0, // Control ID 00166 SYSTEMBAR_ILLEGAL, // Bar to appear on 00167 TRUE, // Recieve messages 00168 FALSE, // Smart 00169 FALSE, // Clean 00170 0, // One open string ID 00171 GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE)); 00172 }
|