OpDetachBlendPath Class Reference

Detached the blend path from each of the selected blends. More...

#include <blndtool.h>

Inheritance diagram for OpDetachBlendPath:

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

Public Member Functions

 OpDetachBlendPath ()
 ~OpDetachBlendPath ()
virtual void Do (OpDescriptor *)
 This function should be over-ridden to perform an operation without passing a parameter.
virtual 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.

Static Public Member Functions

static BOOL Declare ()
 Adds the operation to the list of all known operations.
static OpState GetState (String_256 *Description, OpDescriptor *)
 Find out the state of the operation at the specific time.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDetachBlendPath)

Detailed Description

Detached the blend path from each of the selected blends.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99

Definition at line 600 of file blndtool.h.


Constructor & Destructor Documentation

OpDetachBlendPath::OpDetachBlendPath  )  [inline]
 

Definition at line 606 of file blndtool.h.

00606 {}

OpDetachBlendPath::~OpDetachBlendPath  )  [inline]
 

Definition at line 607 of file blndtool.h.

00607 {}


Member Function Documentation

OpDetachBlendPath::CC_DECLARE_DYNCREATE OpDetachBlendPath   )  [private]
 

BOOL OpDetachBlendPath::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
Returns:
TRUE if all went OK, FALSE otherwise

Definition at line 5312 of file blndtool.cpp.

05313 {
05314     return (RegisterOpDescriptor(
05315                                 0, 
05316                                 _R(IDS_DETACHBLENDPATH),
05317                                 CC_RUNTIME_CLASS(OpDetachBlendPath), 
05318                                 OPTOKEN_DETACHBLENDPATH,
05319                                 OpDetachBlendPath::GetState,
05320                                 0,          /* help ID */
05321                                 _R(IDBBL_DETACHBLENDPATH),  /* bubble ID */
05322                                 0           /* bitmap ID */
05323                                 ));
05324 }

void OpDetachBlendPath::Do OpDescriptor  )  [virtual]
 

This function should be over-ridden to perform an operation without passing a parameter.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/6/94
Parameters:
OpDesc,: A pointer to the OpDescriptor which invoked the operation [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
Operation::DoWithParam

Reimplemented from Operation.

Definition at line 5209 of file blndtool.cpp.

05210 {
05211     SelRange* pSel = GetApplication()->FindSelection();
05212 
05213     BOOL ok = (pSel != NULL);
05214 
05215     if (ok) ok = DoStartSelOp(FALSE,FALSE);
05216 
05217     if (ok)
05218     {
05219         // Get an ObjChangeParam ready so we can tell the selected blends what we hope to do 
05220         // to the them (i.e. effectively remove the blend path "attribute").
05221         ObjChangeFlags cBlendFlags;
05222         cBlendFlags.Attribute = TRUE;
05223         ObjChangeParam BlendChange(OBJCHANGE_STARTING,cBlendFlags,NULL,this);
05224 
05225         Node* pSelNode = pSel->FindFirst();
05226         while (pSelNode != NULL && ok)
05227         {
05228             if (pSelNode->IS_KIND_OF(NodeBlend))
05229             {
05230                 NodeBlend* pNodeBlend = (NodeBlend*)pSelNode;
05231 
05232                         ok = pNodeBlend->AllowOp(&BlendChange);
05233                 if (ok) ok = pNodeBlend->DetachNodeBlendPath(pNodeBlend,NEXT,this);
05234                 if (ok) ok = DoInvalidateNodeRegion(pNodeBlend,TRUE);
05235                 if (ok) ok = pNodeBlend->RotateBlendEndObjectsBack(this);
05236                 if (ok) 
05237                 {   
05238                     // Diccon 9/99 added changeblend action to solve sticky button prob.
05239                     ChangeBlendAction* pAction;
05240                     ChangeBlendOpParam ChangeParam;
05241                     ChangeParam.ChangeType = CHANGEBLEND_BLENDONPATH;
05242                     ChangeParam.NewBlendedOnCurve = FALSE;
05243                     ok = ChangeBlendAction::Init(this,&UndoActions,pNodeBlend,&ChangeParam,&pAction) != AC_FAIL;
05244                 }
05245                 if (ok) ok = DoInvalidateNodeRegion(pNodeBlend,TRUE);
05246             }
05247             pSelNode = pSel->FindNext(pSelNode);
05248         }
05249 
05250         if (ok)
05251         {
05252             // update the effected parents after the change
05253             BlendChange.Define(OBJCHANGE_FINISHED,cBlendFlags,NULL,this);
05254             UpdateChangedNodes(&BlendChange);
05255         }
05256     }
05257 
05258     if (ok)
05259     {
05260         pSel->Update();
05261         // re-render the blobs on the path
05262         /*BlobManager* BlobMgr =*/ GetApplication()->GetBlobManager(); // AB - why does GetBlobManager rerender the paths?
05263     }
05264     else
05265         FailAndExecute();
05266 
05267     End();
05268 }

void OpDetachBlendPath::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:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
Parameters:
- [INPUTS]
The undo string for the operation [OUTPUTS]
Returns:

Errors: -

See also:
-

Reimplemented from Operation.

Definition at line 5406 of file blndtool.cpp.

05407 { 
05408     *OpName = String_256(_R(IDS_DETACHBLENDPATH_UNDO));
05409 }  

OpState OpDetachBlendPath::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/99
Parameters:
Description - GetState fills this string with an approriate description [OUTPUTS] of the current state of the operation
Returns:
The state of the operation, so that menu items (ticks and greying) can be done properly

Definition at line 5341 of file blndtool.cpp.

05342 {
05343     OpState State(FALSE,TRUE); // It's not ticked, but it is greyed by default
05344     
05345     // Get an ObjChangeParam ready so we can tell the selected blend's parents what we hope to do 
05346     // to the blend (i.e. change it's "blend path" attribute")
05347     ObjChangeFlags cFlags;
05348     cFlags.Attribute = TRUE;
05349     ObjChangeParam ObjChange(OBJCHANGE_STARTING,cFlags,NULL,NULL);
05350 
05351     BOOL Denied = FALSE;
05352     SelRange* pSel = GetApplication()->FindSelection();
05353 
05354     if (pSel != NULL)
05355     {
05356         Node* pNode = pSel->FindFirst();
05357         while (pNode != NULL && State.Greyed)
05358         {
05359             if (IS_A(pNode,NodeBlend))
05360             {
05361                 // will the node allow the op to happen? (Don't set op permissions - we're only asking)
05362                 if (pNode->AllowOp(&ObjChange,FALSE))
05363                     State.Greyed = FALSE;       // Yes! we can ungrey
05364                 else
05365                     Denied = TRUE;              // Oooh! we've been denied by at least one selected blend
05366             }
05367             pNode = pSel->FindNext(pNode);
05368         }
05369     }
05370 
05371     UINT32 IDS = 0;
05372     if (State.Greyed)
05373     {
05374         // If we are greyed because we've been denied, get the reason for the denial
05375         if (Denied)
05376             IDS = ObjChange.GetReasonForDenial();
05377         else
05378             IDS = _R(IDS_DETACHBLENDPATH_GREYED);
05379     }
05380 
05381 
05382     if (IDS == 0)
05383         IDS = _R(IDS_DETACHBLENDPATH);
05384 
05385     *Description = String_256(IDS);
05386 
05387     return State;
05388 }


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