OpDragStoryPathRightIndent Class Reference

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

#include <textops.h>

Inheritance diagram for OpDragStoryPathRightIndent:

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

Public Member Functions

 OpDragStoryPathRightIndent ()
 ~OpDragStoryPathRightIndent ()

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 right 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 (OpDragStoryPathRightIndent)

Detailed Description

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

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

Definition at line 887 of file textops.h.


Constructor & Destructor Documentation

OpDragStoryPathRightIndent::OpDragStoryPathRightIndent  )  [inline]
 

Definition at line 893 of file textops.h.

00893 {};

OpDragStoryPathRightIndent::~OpDragStoryPathRightIndent  )  [inline]
 

Definition at line 894 of file textops.h.

00894 {};


Member Function Documentation

OpDragStoryPathRightIndent::CC_DECLARE_DYNCREATE OpDragStoryPathRightIndent   )  [private]
 

BOOL OpDragStoryPathRightIndent::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 5458 of file textops.cpp.

05459 {
05460     ERROR2IF(mpDragStory==NULL, FALSE, "NULL story pointer");
05461 
05462     MILLIPOINT Distance = 0;
05463     BOOL ok = TRUE;
05464 
05465     if (mpDragStory->IsTextOnPathReversed())
05466         ok = GetLeftHandLength(&Distance);
05467     else
05468         ok = GetRightHandLength(&Distance);
05469 
05470     if (ok)
05471         mpDragStory->SetRightIndent(Distance);
05472 
05473     return ok;
05474 }

DocCoord OpDragStoryPathRightIndent::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 5641 of file textops.cpp.

05642 {
05643     return mpDragStory->GetLeftIndentPos();
05644 }

DocCoord OpDragStoryPathRightIndent::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 5576 of file textops.cpp.

05577 {
05578     return mpDragStory->GetRightIndentPos();
05579 }

BOOL OpDragStoryPathRightIndent::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 5341 of file textops.cpp.

05342 {
05343     return (RegisterOpDescriptor(   0,
05344                                     _R(IDS_OPTEXT_DRAGINDENT),
05345                                     CC_RUNTIME_CLASS(OpDragStoryPathRightIndent),
05346                                     OPTOKEN_TEXTDRAGRIGHTPATHINDENT,
05347                                     OpDragStoryIndent::GetState,
05348                                     0,                          // help ID 
05349                                     0,                          // Bubble help
05350                                     0,
05351                                     0,
05352                                     SYSTEMBAR_ILLEGAL,          // For now !
05353                                     TRUE,                       // Receive messages
05354                                     FALSE,
05355                                     FALSE,
05356                                     0,
05357                                     GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE
05358            )); 
05359 }

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

Constrains the drag of the right 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 5731 of file textops.cpp.

05732 {
05733     DocView::SnapCurrent(mpStartSpread, &Current);
05734     
05735     INT32 NearEl=0;
05736     double mu=0.0;
05737     mpStoryPath->InkPath.SqrDistanceToPoint(Current, &NearEl, &mu);
05738     DocCoord LinePoint = mpStoryPath->InkPath.ClosestPointTo(mu, NearEl);
05739 
05740     // We need to stop the right hand blob going past the left hand one.
05741     MILLIPOINT TotalLineLength = (MILLIPOINT)mpStoryPath->InkPath.GetPathLength();
05742     MILLIPOINT RightIndentLength = 0;
05743     BOOL ok = TRUE;
05744     if (mpDragStory->IsTextOnPathReversed())
05745         ok = GetLeftHandLength(LinePoint, mpStoryPath, &RightIndentLength);
05746     else
05747         ok = GetRightHandLength(LinePoint, mpStoryPath, &RightIndentLength);
05748 
05749     if (((TotalLineLength-RightIndentLength) < mpDragStory->GetLeftIndent()) && ok) 
05750         return mpDragStory->GetLeftIndentPos();
05751     else
05752         return LinePoint;
05753 }


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