OpDragStoryPathLeftIndent Class Reference

This is the operation that is used to drag the left hand path indent. More...

#include <textops.h>

Inheritance diagram for OpDragStoryPathLeftIndent:

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

Public Member Functions

 OpDragStoryPathLeftIndent ()
 ~OpDragStoryPathLeftIndent ()

Static Public Member Functions

static BOOL Init ()
 Initialises the operation; registers its op descriptor.

Protected Member Functions

virtual DocCoord InternalConstrain (DocCoord Current, ClickModifiers ClickMods)
 Constrains the drag of the left indent on the path.
virtual DocCoord GetOtherIndent ()
 Gets the original position of the stationary indent.
virtual DocCoord GetThisIndent ()
 Gets the original position of the dragged indent.
virtual BOOL DoIndentChange ()
 Called to perform the change to the story required at the completion of the blob drag.

Private Member Functions

 CC_DECLARE_DYNCREATE (OpDragStoryPathLeftIndent)

Detailed Description

This is the operation that is used to drag the left hand path indent.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96

Definition at line 859 of file textops.h.


Constructor & Destructor Documentation

OpDragStoryPathLeftIndent::OpDragStoryPathLeftIndent  )  [inline]
 

Definition at line 865 of file textops.h.

00865 {};

OpDragStoryPathLeftIndent::~OpDragStoryPathLeftIndent  )  [inline]
 

Definition at line 866 of file textops.h.

00866 {};


Member Function Documentation

OpDragStoryPathLeftIndent::CC_DECLARE_DYNCREATE OpDragStoryPathLeftIndent   )  [private]
 

BOOL OpDragStoryPathLeftIndent::DoIndentChange  )  [protected, virtual]
 

Called to perform the change to the story required at the completion of the blob drag.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96
Returns:
TRUE/FALSE for success/failure

Implements OpDragStoryIndent.

Definition at line 5430 of file textops.cpp.

05431 {
05432     ERROR2IF(mpDragStory==NULL, FALSE, "NULL story pointer");
05433 
05434     MILLIPOINT Distance = 0;
05435     BOOL ok = TRUE;
05436 
05437     if (mpDragStory->IsTextOnPathReversed())
05438         ok = GetRightHandLength(&Distance);
05439     else
05440         ok = GetLeftHandLength(&Distance);
05441 
05442     if (ok)
05443         mpDragStory->SetLeftIndent(Distance);
05444 
05445     return ok;
05446 }

DocCoord OpDragStoryPathLeftIndent::GetOtherIndent  )  [protected, virtual]
 

Gets the original position of the stationary indent.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96
Returns:
The coordinate of the 'other' indent, not the one being dragged

Implements OpDragStoryIndent.

Definition at line 5627 of file textops.cpp.

05628 {
05629     return mpDragStory->GetRightIndentPos();
05630 }

DocCoord OpDragStoryPathLeftIndent::GetThisIndent  )  [protected, virtual]
 

Gets the original position of the dragged indent.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96
Returns:
The coordinate of the indent begin dragged (where it was before the drag started)

Implements OpDragStoryIndent.

Definition at line 5562 of file textops.cpp.

05563 {
05564     return mpDragStory->GetLeftIndentPos();
05565 }

BOOL OpDragStoryPathLeftIndent::Init void   )  [static]
 

Initialises the operation; registers its op descriptor.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96
Returns:
TRUE for succesful init, FALSE if init failed

Reimplemented from SimpleCCObject.

Definition at line 5312 of file textops.cpp.

05313 {
05314     return (RegisterOpDescriptor(   0,
05315                                     _R(IDS_OPTEXT_DRAGINDENT),
05316                                     CC_RUNTIME_CLASS(OpDragStoryPathLeftIndent),
05317                                     OPTOKEN_TEXTDRAGLEFTPATHINDENT,
05318                                     OpDragStoryIndent::GetState,
05319                                     0,                          // help ID 
05320                                     0,                          // Bubble help
05321                                     0,
05322                                     0,
05323                                     SYSTEMBAR_ILLEGAL,          // For now !
05324                                     TRUE,                       // Receive messages
05325                                     FALSE,
05326                                     FALSE,
05327                                     0,
05328                                     GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE
05329            )); 
05330 }

DocCoord OpDragStoryPathLeftIndent::InternalConstrain DocCoord  Current,
ClickModifiers  ClickMods
[protected, virtual]
 

Constrains the drag of the left indent on the path.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/8/96
Parameters:
Current - the current mouse position [INPUTS] ClickMods - the current click modifiers
Returns:
The suitably constrained mouse position

Implements OpDragStoryIndent.

Definition at line 5694 of file textops.cpp.

05695 {
05696     ERROR2IF(mpDragStory==NULL || mpStoryPath==NULL, DocCoord(0,0), "NULL pointer");
05697 
05698     DocView::SnapCurrent(mpStartSpread, &Current);
05699 
05700     INT32 NearEl=0;
05701     double mu=0.0;
05702     mpStoryPath->InkPath.SqrDistanceToPoint(Current, &NearEl, &mu);
05703     DocCoord LinePoint = mpStoryPath->InkPath.ClosestPointTo(mu, NearEl);
05704 
05705     // We need to stop the left hand blob going past the right hand one.
05706     MILLIPOINT TotalLineLength = (MILLIPOINT)mpStoryPath->InkPath.GetPathLength();
05707     MILLIPOINT LeftIndentLength = 0;
05708     BOOL ok = TRUE;
05709     if (mpDragStory->IsTextOnPathReversed())
05710         ok = GetRightHandLength(LinePoint, mpStoryPath, &LeftIndentLength);
05711     else
05712         ok = GetLeftHandLength(LinePoint, mpStoryPath, &LeftIndentLength);
05713 
05714     if (((TotalLineLength-LeftIndentLength) < mpDragStory->GetRightIndent()) && ok) 
05715         return mpDragStory->GetRightIndentPos();
05716     else
05717         return LinePoint;
05718 }


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