#include <textops.h>
Inheritance diagram for OpDragStoryIndent:
Public Member Functions | |
OpDragStoryIndent () | |
Constructor - inits member variables. | |
~OpDragStoryIndent () | |
Destructor. | |
BOOL | DoDrag (DocCoord Anchor, Spread *pSpread, ClickModifiers ClickMods, TextStory *pStory) |
Starts a drag operation to move the path indent position for a text story. | |
virtual void | DragPointerMove (DocCoord PointerPos, ClickModifiers ClickMods, Spread *pSpread, BOOL bSolidDrag) |
Starts a drag operation to move the path indent position for a text story. | |
virtual void | DragFinished (DocCoord PointerPos, ClickModifiers ClickMods, Spread *pSpread, BOOL Success, BOOL bSolidDrag) |
Completes the drag operation, stores the new path indent in the story. | |
virtual void | RenderDragBlobs (DocRect, Spread *, BOOL bSolidDrag) |
Renders the EOR drag blobs, either putting them on or taking them off. Also renders the story's object blobs. | |
Static Public Member Functions | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Get state function. Never ticked, Never greyed. | |
Protected Member Functions | |
virtual DocCoord | GetOtherIndent ()=0 |
virtual DocCoord | GetThisIndent ()=0 |
virtual BOOL | DoIndentChange ()=0 |
virtual DocCoord | InternalConstrain (DocCoord Current, ClickModifiers ClickMods)=0 |
virtual BOOL | SetCurrentPos (DocCoord MousePos, ClickModifiers ClickMods)=0 |
void | RenderDraggingBlobs (DocRect, Spread *) |
Renders the EOR drag blob for the margin being dragged. | |
BOOL | GetLeftHandLength (MILLIPOINT *pResult) |
Gets the length along the path from the start of the path to the current pos. | |
BOOL | GetRightHandLength (MILLIPOINT *pResult) |
Gets the length along the path from the end of the path to the current pos. | |
Static Protected Member Functions | |
static BOOL | GetLeftHandLength (DocCoord Coord, NodePath *pPath, MILLIPOINT *pResult) |
Gets the length along the path from the start of the path to the given point. | |
static BOOL | GetRightHandLength (DocCoord Coord, NodePath *pPath, MILLIPOINT *pResult) |
Gets the length along the path from the end of the path to the given point. | |
Protected Attributes | |
DocCoord | mStartPoint |
DocCoord | mCurrentBlobPos |
Spread * | mpStartSpread |
TextStory * | mpDragStory |
NodePath * | mpStoryPath |
Private Member Functions | |
CC_DECLARE_DYNAMIC (OpDragStoryIndent) |
Definition at line 785 of file textops.h.
|
Constructor - inits member variables.
Definition at line 4968 of file textops.cpp. 04969 { 04970 mpStartSpread = NULL; 04971 mpDragStory = NULL; 04972 mpStoryPath = NULL; 04973 }
|
|
Destructor.
Definition at line 4984 of file textops.cpp.
|
|
|
|
Starts a drag operation to move the path indent position for a text story.
Definition at line 5019 of file textops.cpp. 05020 { 05021 ERROR2IF((pSpread == NULL) || (pStory == NULL), FALSE, "NULL entry param"); 05022 ERROR3IF(pSpread != pStory->FindParentSpread(), "Spread pointer didn't point to the spread the story was on. Is this bad?"); 05023 BOOL ok = TRUE; 05024 05025 // Record the initial parameters for later use 05026 mStartPoint = Anchor; 05027 mpStartSpread = pSpread; 05028 mpDragStory = pStory; 05029 mpStoryPath = pStory->GetTextPath(); 05030 05031 // Get the initial indent along the line 05032 if (ok) 05033 { 05034 SetCurrentPos(mStartPoint, ClickMods); 05035 mStartPoint = mCurrentBlobPos; 05036 } 05037 05038 // Put the drag blobs on for the first time 05039 DocRect Empty; 05040 Empty.MakeEmpty(); 05041 RenderDragBlobs(Empty, mpStartSpread, FALSE); 05042 05043 // Start the drag going 05044 if (ok) 05045 ok = StartDrag( DRAGTYPE_AUTOSCROLL ); 05046 05047 return ok; 05048 }
|
|
Implemented in OpDragStoryPathLeftIndent, OpDragStoryPathRightIndent, OpDragStoryNonPathLeftIndent, and OpDragStoryNonPathRightIndent. |
|
Completes the drag operation, stores the new path indent in the story.
Reimplemented from Operation. Definition at line 5105 of file textops.cpp. 05106 { 05107 BOOL ok = TRUE; 05108 05109 // Take the drag blob off 05110 DocRect Empty; 05111 Empty.MakeEmpty(); 05112 RenderDragBlobs(Empty, mpStartSpread, bSolidDrag); 05113 05114 BeginSlowJob(); 05115 EndDrag(); 05116 05117 if (Success) 05118 { 05119 if (ok) 05120 ok = DoStartTextOp(mpDragStory, TRUE, TRUE); 05121 05122 // Ask the story if it minds being altered (also does reformatting for us) 05123 if (ok) 05124 { 05125 ObjChangeParam ObjInsert(OBJCHANGE_STARTING, ObjChangeFlags(), NULL, this); 05126 ok = mpDragStory->AllowOp(&ObjInsert); 05127 } 05128 05129 // Store the current indent in undo history 05130 if (ok) 05131 ok = StorePathIndentAction::DoStoreIndent(this, &UndoActions, mpDragStory); 05132 05133 if (ok) 05134 ok = DoIndentChange(); 05135 05136 GetApplication()->FindSelection()->Update(); 05137 05138 // Tell the story we have finished fiddling with it (reformats for us) 05139 if (ok) 05140 { 05141 ObjChangeParam ObjChange(OBJCHANGE_FINISHED, ObjChangeFlags(), NULL, this); 05142 ok = UpdateChangedNodes(&ObjChange); 05143 } 05144 } 05145 05146 if (!ok) 05147 FailAndExecute(); 05148 05149 End(); 05150 }
|
|
Starts a drag operation to move the path indent position for a text story.
Reimplemented from Operation. Definition at line 5061 of file textops.cpp. 05062 { 05063 // Salary check 05064 if ((mpStartSpread == NULL) || (mpDragStory == NULL)) 05065 { 05066 ERROR3("A pointer was NULL"); 05067 return; 05068 } 05069 05070 // If drag has moved onto a different spread, convert the coord to be relative to the original spread. 05071 if (pSpread != mpStartSpread) 05072 PointerPos = MakeRelativeToSpread(mpStartSpread, pSpread, PointerPos); 05073 05074 // Take the previous blobs off 05075 DocRect Empty; 05076 Empty.MakeEmpty(); 05077 RenderDraggingBlobs(Empty, mpStartSpread); 05078 05079 // Get the new distance along the path 05080 SetCurrentPos(PointerPos, ClickMods); 05081 05082 // Put the blob back on 05083 RenderDraggingBlobs(Empty, mpStartSpread); 05084 05085 // Set the status line to be helpful 05086 if (mpStoryPath==NULL) 05087 { 05088 String_256 HelpString(_R(IDS_TEXTTOOL_DRAGSTORYHANDLE)); 05089 GetApplication()->UpdateStatusBarText(&HelpString); 05090 } 05091 }
|
|
Gets the length along the path from the start of the path to the current pos.
Definition at line 5227 of file textops.cpp. 05228 { 05229 return GetLeftHandLength(mCurrentBlobPos, mpStoryPath, pResult); 05230 }
|
|
Gets the length along the path from the start of the path to the given point.
Definition at line 5262 of file textops.cpp. 05263 { 05264 ERROR2IF(pResult==NULL, FALSE, "NULL output parameter"); 05265 *pResult = 0; 05266 ERROR2IF(pPath==NULL, FALSE, "NULL path pointer"); 05267 05268 return pPath->InkPath.GetDistanceToPoint(Coord, pResult); 05269 }
|
|
Implemented in OpDragStoryPathLeftIndent, OpDragStoryPathRightIndent, OpDragStoryNonPathLeftIndent, and OpDragStoryNonPathRightIndent. |
|
Gets the length along the path from the end of the path to the current pos.
Definition at line 5244 of file textops.cpp. 05245 { 05246 return GetRightHandLength(mCurrentBlobPos, mpStoryPath, pResult); 05247 }
|
|
Gets the length along the path from the end of the path to the given point.
Definition at line 5284 of file textops.cpp. 05285 { 05286 ERROR2IF(pResult==NULL, FALSE, "NULL output parameter"); 05287 *pResult = 0; 05288 ERROR2IF(pPath==NULL, FALSE, "NULL path pointer"); 05289 05290 // Get the length of the whole path 05291 MILLIPOINT TotalLength = (MILLIPOINT)(pPath->InkPath.GetPathLength()); 05292 05293 // Get the distance from the start of the path to where the drag ended 05294 MILLIPOINT Distance = 0; 05295 BOOL ok = pPath->InkPath.GetDistanceToPoint(Coord, &Distance); 05296 05297 *pResult = TotalLength - Distance; 05298 05299 return ok; 05300 }
|
|
Get state function. Never ticked, Never greyed.
Definition at line 5000 of file textops.cpp. 05001 { 05002 OpState apple; 05003 return apple; 05004 }
|
|
Implemented in OpDragStoryPathLeftIndent, OpDragStoryPathRightIndent, OpDragStoryNonPathLeftIndent, and OpDragStoryNonPathRightIndent. |
|
Implemented in OpDragStoryPathLeftIndent, OpDragStoryPathRightIndent, and OpDragStoryNonPathIndent. |
|
Renders the EOR drag blobs, either putting them on or taking them off. Also renders the story's object blobs.
Reimplemented from Operation. Definition at line 5163 of file textops.cpp. 05164 { 05165 DocCoord OtherIndent = GetOtherIndent(); 05166 05167 if (ClipRect.IsEmpty()) 05168 TextToolBlobPosList::RenderBlob(pSpread, NULL, OtherIndent); 05169 else 05170 TextToolBlobPosList::RenderBlob(pSpread, &ClipRect, OtherIndent); 05171 05172 RenderDraggingBlobs(ClipRect, pSpread); 05173 }
|
|
Renders the EOR drag blob for the margin being dragged.
Definition at line 5187 of file textops.cpp. 05188 { 05189 if (ClipRect.IsEmpty()) 05190 TextToolBlobPosList::RenderBlob(pSpread, NULL, mCurrentBlobPos); 05191 else 05192 TextToolBlobPosList::RenderBlob(pSpread, &ClipRect, mCurrentBlobPos); 05193 05194 // Render a line connecting the blobs if not on a path 05195 if (mpStoryPath==NULL) 05196 { 05197 DocRect* pClipper = &ClipRect; 05198 if (ClipRect.IsEmpty()) 05199 pClipper = NULL; 05200 05201 RenderRegion* pRegion = DocView::RenderOnTop(pClipper, pSpread, ClippedEOR); 05202 while (pRegion != NULL) 05203 { 05204 // Draw a Cross Hair 05205 pRegion->SetLineColour(COLOUR_XOREDIT); 05206 pRegion->SetFillColour(COLOUR_TRANS); 05207 pRegion->DrawLine(mCurrentBlobPos, GetOtherIndent()); 05208 05209 // Get the next region in the list 05210 pRegion = DocView::GetNextOnTop(pClipper); 05211 } 05212 } 05213 }
|
|
Implemented in OpDragStoryPathIndent, and OpDragStoryNonPathIndent. |
|
|
|
|
|
|
|
|
|
|