#include <mkstroke.h>
Inheritance diagram for OpMakeStroke:
Public Member Functions | |
OpMakeStroke () | |
OpMakeStroke constructor. | |
void | Do (OpDescriptor *) |
Performs the MakeShapes operation. | |
virtual BOOL | MayChangeNodeBounds () const |
Static Public Member Functions | |
static BOOL | Init () |
OpMakeStroke initialiser method. | |
static OpState | GetState (String_256 *, OpDescriptor *) |
For finding the OpMakeStroke's state. |
Definition at line 118 of file mkstroke.h.
|
OpMakeStroke constructor.
Definition at line 139 of file mkstroke.cpp. 00139 : SelOperation() 00140 { 00141 }
|
|
Performs the MakeShapes operation.
Reimplemented from Operation. Definition at line 220 of file mkstroke.cpp. 00221 { 00222 // Obtain the current selections 00223 Range Selection = *GetApplication()->FindSelection(); 00224 Node* CurrentNode = Selection.FindFirst(); 00225 BOOL Success = TRUE; 00226 00227 ERROR3IF(CurrentNode == NULL, "Make shapes called with no nodes selected"); 00228 00229 if (CurrentNode != NULL) // No nodes selected so End 00230 { 00231 // Try to record the selection state, don't render the blobs though 00232 if (Success) 00233 Success = DoStartSelOp(FALSE,FALSE); 00234 00235 // First, Make Shapes on everything so they're all simple paths 00236 String_256 Desc("Building new stroke brush..."); 00237 Progress::Start(FALSE, &Desc); 00238 OpDescriptor *pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_MAKE_SHAPES); 00239 if (pOp != NULL) 00240 pOp->Invoke(); 00241 00242 // Second, Group everything 00243 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_GROUP); 00244 if (pOp != NULL) 00245 pOp->Invoke(); 00246 00247 pOp = OpDescriptor::FindOpDescriptor(OPTOKEN_GROUP); 00248 if (pOp != NULL) 00249 pOp->Invoke(); 00250 00251 // Finally, create a new brush 00252 PathStrokerVector::BodgeRipSelection(/*(CommandIndex == 0) ? FALSE :*/ TRUE); 00253 Progress::Stop(); 00254 00255 } 00256 00257 if (!Success) 00258 { 00259 InformError(); 00260 FailAndExecute(); 00261 } 00262 00263 End(); 00264 }
|
|
For finding the OpMakeStroke's state.
Definition at line 191 of file mkstroke.cpp. 00192 { 00193 OpState OpSt; 00194 00195 SelRange *pSelRange = GetApplication()->FindSelection(); 00196 00197 // Set up the ObjChangeParam so we can ask the selected nodes if they mind being deleted 00198 ObjChangeFlags cFlags(TRUE); 00199 ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL); 00200 00201 // Will one or more selected nodes allow this op? 00202 if (!pSelRange->AllowOp(&ObjChange,FALSE)) 00203 OpSt.Greyed = TRUE; 00204 00205 return(OpSt); 00206 }
|
|
OpMakeStroke initialiser method.
Reimplemented from SimpleCCObject. Definition at line 160 of file mkstroke.cpp. 00161 { 00162 return (RegisterOpDescriptor(0, // tool id 00163 _R(IDS_MAKESTROKEOP), // Ops name 00164 CC_RUNTIME_CLASS(OpMakeStroke), // Ops class 00165 OPTOKEN_MAKE_STROKE, // Op token 00166 OpMakeStroke::GetState, // Get state function 00167 0, // help ID 00168 _R(IDBBL_MAKESTROKE), // Bubble help 00169 0, // Bitmap ID 00170 0, // Control ID 00171 SYSTEMBAR_ILLEGAL, // Bar to appear on 00172 TRUE, // Recieve messages 00173 FALSE, // Smart 00174 FALSE, // Clean 00175 0, // One open string ID 00176 GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE)); 00177 }
|
|
Reimplemented from SelOperation. Definition at line 130 of file mkstroke.h. 00130 { return FALSE; }
|