OpMakeStroke Class Reference

This class represents the MakeStroke operation. More...

#include <mkstroke.h>

Inheritance diagram for OpMakeStroke:

SelOperation UndoableOperation Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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.

Detailed Description

This class represents the MakeStroke operation.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/03/97

Definition at line 118 of file mkstroke.h.


Constructor & Destructor Documentation

OpMakeStroke::OpMakeStroke  ) 
 

OpMakeStroke constructor.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/03/97

Definition at line 139 of file mkstroke.cpp.

00139                           : SelOperation()                              
00140 {                              
00141 }


Member Function Documentation

void OpMakeStroke::Do OpDescriptor  )  [virtual]
 

Performs the MakeShapes operation.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/03/97
Parameters:
OpDescriptor (unused) [INPUTS]
- [OUTPUTS]
Returns:
-

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 }           

OpState OpMakeStroke::GetState String_256 UIDescription,
OpDescriptor
[static]
 

For finding the OpMakeStroke's state.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/03/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpMakeStroke

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 }

BOOL OpMakeStroke::Init void   )  [static]
 

OpMakeStroke initialiser method.

Author:
Richard_Millican (Xara Group Ltd) <camelotdev@xara.com>
Date:
04/03/97
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the operation could be successfully initialised FALSE if no more memory could be allocated

Errors: ERROR will be called if there was insufficient memory to allocate the operation.

See also:
-

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 }

virtual BOOL OpMakeStroke::MayChangeNodeBounds  )  const [inline, virtual]
 

Reimplemented from SelOperation.

Definition at line 130 of file mkstroke.h.

00130 { return FALSE; }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:25 2007 for Camelot by  doxygen 1.4.4