OpDragStoryNonPathIndent Class Reference

Base class for dragging indents for stories not on a path. More...

#include <textops.h>

Inheritance diagram for OpDragStoryNonPathIndent:

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

Public Member Functions

 OpDragStoryNonPathIndent ()
 ~OpDragStoryNonPathIndent ()

Protected Member Functions

virtual DocCoord InternalConstrain (DocCoord Current, ClickModifiers ClickMods)
 Constrains the drag of indents not on a path.
virtual BOOL SetCurrentPos (DocCoord MousePos, ClickModifiers ClickMods)
 Given a position sets mCurrentBlobPos to it.

Private Member Functions

 CC_DECLARE_DYNAMIC (OpDragStoryNonPathIndent)

Detailed Description

Base class for dragging indents for stories not on a path.

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

Definition at line 916 of file textops.h.


Constructor & Destructor Documentation

OpDragStoryNonPathIndent::OpDragStoryNonPathIndent  )  [inline]
 

Definition at line 922 of file textops.h.

00922 {};

OpDragStoryNonPathIndent::~OpDragStoryNonPathIndent  )  [inline]
 

Definition at line 923 of file textops.h.

00923 {};


Member Function Documentation

OpDragStoryNonPathIndent::CC_DECLARE_DYNAMIC OpDragStoryNonPathIndent   )  [private]
 

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

Constrains the drag of indents not on a 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 5766 of file textops.cpp.

05767 {
05768     // By default drag along the baseline
05769     if (!ClickMods.Adjust && !ClickMods.Constrain)
05770     {
05771         const double OrigLength = GetThisIndent().Distance(GetOtherIndent());
05772         double Hypot = GetOtherIndent().Distance(Current);
05773         double Oppo = DocCoord::DistanceFromLine(GetThisIndent(), GetOtherIndent(), Current);
05774         double Adj = sqrt(Hypot*Hypot - Oppo*Oppo);
05775         double Ratio = 1.0;
05776         if (OrigLength != 0.0)
05777             Ratio = Adj/(OrigLength);
05778 
05779         const DocCoord JoinPoint = GetOtherIndent(); 
05780         const DocCoord OtherJoinEnd = GetThisIndent(); 
05781         const DocCoord cCurrent = Current; 
05782 
05783         if (DocCoord::IsJoinAcute(&JoinPoint, &OtherJoinEnd, &cCurrent))
05784             return DocCoord::PositionPointFromRatio(JoinPoint, OtherJoinEnd, Ratio);
05785         else
05786             return DocCoord::PositionPointFromRatio(JoinPoint, OtherJoinEnd, -Ratio);
05787     }
05788     else
05789     {
05790         // CTRL is angle constrain, // SHIFT is unconstrained
05791         if (ClickMods.Constrain)
05792         {
05793             DocCoord Anchor = GetOtherIndent();
05794             DocView::ConstrainToAngle(Anchor, &Current);
05795         }
05796 
05797         DocView::SnapCurrent(mpStartSpread, &Current);
05798     }
05799 
05800     return Current;
05801 }

BOOL OpDragStoryNonPathIndent::SetCurrentPos DocCoord  MousePos,
ClickModifiers  ClickMods
[protected, virtual]
 

Given a position sets mCurrentBlobPos to it.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/95
Parameters:
MousePos - a coordinate [INPUTS] ClickMods - the current click modifiers
Member variable mCurrentBlobPos is set from MousePos [OUTPUTS]
Returns:
TRUE/FALSE for success/failure

Implements OpDragStoryIndent.

Definition at line 5838 of file textops.cpp.

05839 {
05840     ERROR3IF(mpStoryPath!=NULL, "Story is on a path, you don't want to use this function");
05841 
05842     mCurrentBlobPos = InternalConstrain(MousePos, ClickMods);
05843 
05844     return TRUE;
05845 }


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