#include <textops.h>
Inheritance diagram for OpReverseStoryPath:
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. |
Definition at line 409 of file textops.h.
|
Definition at line 414 of file textops.h.
|
|
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.
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 }
|
|
The op is greyed if there are no selected "Text on a path" TextStories.
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 }
|
|
Registers the ReversStoryPath 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 }
|