OpReverseStoryPath Class Reference

This operation should be used to hide a particular TextStory. More...

#include <textops.h>

Inheritance diagram for OpReverseStoryPath:

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

Public Member Functions

 OpReverseStoryPath ()
virtual void Do (OpDescriptor *)
 Called when the user selects the "Reverse TextStory path" option. Reverses the path for all selected TextStories on a path, so it (and the text) goes the other way.

Static Public Member Functions

static BOOL Init ()
 Registers the ReversStoryPath operation.
static OpState GetState (String_256 *, OpDescriptor *)
 The op is greyed if there are no selected "Text on a path" TextStories.

Detailed Description

This operation should be used to hide a particular TextStory.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/04/95

Definition at line 409 of file textops.h.


Constructor & Destructor Documentation

OpReverseStoryPath::OpReverseStoryPath  )  [inline]
 

Definition at line 414 of file textops.h.

00414 {};                             


Member Function Documentation

void OpReverseStoryPath::Do OpDescriptor  )  [virtual]
 

Called when the user selects the "Reverse TextStory path" option. Reverses the path for all selected TextStories on a path, so it (and the text) goes the other way.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Parameters:
(Unused) [INPUTS]

Reimplemented from Operation.

Definition at line 2252 of file textops.cpp.

02253 {
02254     SelRange* pSelection = GetApplication()->FindSelection();
02255     Node* pNode = pSelection->FindFirst();
02256     BOOL ok = TRUE;
02257 
02258     if (ok && (pNode != NULL))
02259         ok = DoStartTextOp(NULL);
02260 
02261     while (ok && (pNode != NULL))
02262     {
02263         if (IS_A(pNode,TextStory))
02264         {
02265             NodePath* pPath = ((TextStory*)pNode)->GetTextPath();
02266 
02267             if (pPath != NULL)
02268             {
02269                 ObjChangeParam ObjEdit(OBJCHANGE_STARTING,ObjChangeFlags(),NULL,this);
02270                 if (pNode->AllowOp(&ObjEdit))
02271                     ok = ReversePathAction::DoReversePath(this, &UndoActions, (TextStory*)pNode); 
02272             }
02273         }
02274 
02275         pNode = pSelection->FindNext(pNode);
02276     }
02277 
02278     // Tell the parents of the edited nodes
02279     if (ok)
02280     {
02281         ObjChangeParam ObjChange(OBJCHANGE_FINISHED,ObjChangeFlags(),NULL,this);
02282         ok = UpdateChangedNodes(&ObjChange);
02283     }
02284 
02285     // Do a SelChange so the text tool updates it's blobs
02286     if (ok)
02287         pSelection->Update();
02288 
02289 
02290     if (!ok)
02291     {
02292         FailAndExecute();
02293         InformError();
02294     }
02295 
02296     End();
02297 }

OpState OpReverseStoryPath::GetState String_256 ,
OpDescriptor
[static]
 

The op is greyed if there are no selected "Text on a path" TextStories.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Parameters:
(unused) [INPUTS]
Returns:
The tick/grey state of this operation

Definition at line 2214 of file textops.cpp.

02215 {
02216     OpState State;
02217     State.Greyed = FALSE;
02218 
02219     SelRange* Selection = GetApplication()->FindSelection();
02220     Node* pNode = Selection->FindFirst();
02221 
02222     while (pNode != NULL)
02223     {
02224         if (IS_A(pNode,TextStory))
02225         {
02226             TextStory* pTS = (TextStory*)pNode;
02227             if (pTS->GetTextPath()==NULL /*|| pTS->IsWordWrapping()*/)
02228             {
02229                 State.Greyed = TRUE;
02230                 break;
02231             }
02232         }
02233 
02234         pNode = Selection->FindNext(pNode);
02235     }
02236 
02237     return State;
02238 }

BOOL OpReverseStoryPath::Init void   )  [static]
 

Registers the ReversStoryPath operation.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
Returns:
TRUE/FALSE for successful initialisation of this operation

Reimplemented from SimpleCCObject.

Definition at line 2194 of file textops.cpp.

02195 {
02196     return (RegisterOpDescriptor(0,
02197                             _R(IDS_REVERSEPATHOP),
02198                             CC_RUNTIME_CLASS(OpReverseStoryPath),
02199                             OPTOKEN_REVERSESTORYPATH,
02200                             OpReverseStoryPath::GetState)); 
02201 }


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