OpAddPathToPath Class Reference

This op will add an element to an existing path within the tree. The new element and context path should be passed into the do function as parameters. More...

#include <penedit.h>

Inheritance diagram for OpAddPathToPath:

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

Public Member Functions

 OpAddPathToPath ()
 OpAddPathToPath constructor.
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 DoAddPathToPath (NodePath *pDestinNode, Path *pAddPath, INT32 index)
 This operation is called to update an existing path. If successful it will create a new node, copy the contents of pElement into it and apply the current attributes to it.

Static Public Member Functions

static BOOL Init ()
 OpAddPathToPath initialiser method.
static OpState GetState (String_256 *, OpDescriptor *)
 For finding the OpAddPathToPath's state.

Detailed Description

This op will add an element to an existing path within the tree. The new element and context path should be passed into the do function as parameters.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/9/94

Definition at line 574 of file penedit.h.


Constructor & Destructor Documentation

OpAddPathToPath::OpAddPathToPath  ) 
 

OpAddPathToPath constructor.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/94
See also:
-

Definition at line 2820 of file penedit.cpp.

02821 {
02822 }


Member Function Documentation

void OpAddPathToPath::DoAddPathToPath NodePath pNode,
Path pElement,
INT32  index
 

This operation is called to update an existing path. If successful it will create a new node, copy the contents of pElement into it and apply the current attributes to it.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/94
Parameters:
pNode = Pointer to nodepath in document to add element to [INPUTS] pElement = Pointer to path element to add index = index within path at which to add the new elements
- [OUTPUTS]

Definition at line 2924 of file penedit.cpp.

02925 {
02926 #ifndef STANDALONE
02927 
02928     BeginSlowJob();
02929 
02930     DoStartSelOp(TRUE,TRUE);
02931     
02932     DocView* pDocView = DocView::GetSelected();
02933     ERROR2IF( pDocView == NULL, (void)0, "There was no selected docview when augmenting a path" );
02934 
02935     // Save the bounds of the path for undo/redo
02936     if (RecalcBoundsAction::DoRecalc(this, &UndoActions, pNode) == AC_FAIL)
02937     {
02938         FailAndExecute();
02939         End();
02940         return;
02941     }
02942 
02943     // Go and copy the edited path to the end of the original
02944 
02945     ExecuteType Exe = AugmentPathWithPath(pElement, pNode, index);
02946     if (Exe != ExeNone)
02947     {
02948         InformError( _R(IDS_OUT_OF_MEMORY), _R(IDS_OK) );
02949         if (Exe == ExeInclusive)
02950             FailAndExecute();
02951         if (Exe == ExeExclusive)
02952             FailAndExecuteAllButLast();
02953         End();
02954         return;
02955     }   
02956 
02957     // Recalculate the path's bounding box
02958     pNode->InvalidateBoundingRect();
02959     
02960     // tell the world that something in the selection has changed 
02961     // so that selection bounds are updated
02962     GetApplication()->FindSelection()->Update(TRUE);
02963 
02964     // record new bounds action undo/redo
02965     if (RecordBoundsAction::DoRecord(this, &UndoActions, pNode) == AC_FAIL)
02966     {
02967         FailAndExecute();
02968         End();
02969         return;
02970     }
02971 
02972 #endif
02973     End();
02974 }

void OpAddPathToPath::GetOpName String_256 OpName  )  [virtual]
 

The GetOpName fn is overridden so that we return back a description appropriate to the type of attribute that the operation applies.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/94
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 2898 of file penedit.cpp.

02899 {
02900     *OpName = String_256(_R(IDS_UNDO_ADDPATHTOPATHOP));
02901 }

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

For finding the OpAddPathToPath's state.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The state of the OpAddPathToPath

Errors: -

See also:
-

Definition at line 2874 of file penedit.cpp.

02875 {
02876     OpState OpSt;
02877     return OpSt;   
02878 }

BOOL OpAddPathToPath::Init void   )  [static]
 

OpAddPathToPath initialiser method.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/10/94
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 2844 of file penedit.cpp.

02845 {
02846     return (RegisterOpDescriptor(0,                                     // tool ID
02847                                 _R(IDS_ADDPATHTOPATHOP),                    // string resource ID
02848                                 CC_RUNTIME_CLASS(OpAddPathToPath),      // runtime class for Op
02849                                 OPTOKEN_ADDPATHTOPATH,                  // Ptr to token string
02850                                 OpAddPathToPath::GetState,              // GetState function
02851                                 0,                                      // help ID = 0
02852                                 _R(IDBBL_ADDPATHTOPATHOP),                  // bubble help ID = 0
02853                                 0                                       // resource ID = 0
02854                                 )); 
02855 
02856 }               


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