OpDragStoryNonPathRightIndent Class Reference

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

#include <textops.h>

Inheritance diagram for OpDragStoryNonPathRightIndent:

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

Public Member Functions

 OpDragStoryNonPathRightIndent ()
 ~OpDragStoryNonPathRightIndent ()

Static Public Member Functions

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

Protected Member Functions

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 (OpDragStoryNonPathRightIndent)

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 963 of file textops.h.


Constructor & Destructor Documentation

OpDragStoryNonPathRightIndent::OpDragStoryNonPathRightIndent  )  [inline]
 

Definition at line 969 of file textops.h.

00969 {};

OpDragStoryNonPathRightIndent::~OpDragStoryNonPathRightIndent  )  [inline]
 

Definition at line 970 of file textops.h.

00970 {};


Member Function Documentation

OpDragStoryNonPathRightIndent::CC_DECLARE_DYNCREATE OpDragStoryNonPathRightIndent   )  [private]
 

BOOL OpDragStoryNonPathRightIndent::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 5528 of file textops.cpp.

05529 {
05530     // Set the story width
05531     mpDragStory->SetStoryWidth((INT32)mCurrentBlobPos.Distance(GetOtherIndent()));
05532 
05533     // Rotate the story about the left indent pos.
05534     DocCoord LeftIndentPos = GetOtherIndent();
05535     DocCoord OldRightIndentPos = GetThisIndent();
05536 
05537     double OldAngle = atan2((double)(OldRightIndentPos.y-LeftIndentPos.y), (double)(OldRightIndentPos.x-LeftIndentPos.x));
05538     double NewAngle = atan2((double)(mCurrentBlobPos.y-LeftIndentPos.y), (double)(mCurrentBlobPos.x-LeftIndentPos.x));
05539     ANGLE RotAngle = (NewAngle-OldAngle)*(180/PI);
05540 
05541     Matrix RotMatrix(LeftIndentPos, RotAngle);
05542 
05543     // Must not create a transform matrix on the stack as the operation keeps a pointer to it!
05544     Trans2DMatrix* pTransMat = new Trans2DMatrix(RotMatrix);
05545 
05546     if (pTransMat == NULL)
05547         return FALSE;
05548     else
05549         return DoTransformNode(mpDragStory, pTransMat);
05550 }

DocCoord OpDragStoryNonPathRightIndent::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 5673 of file textops.cpp.

05674 {
05675     const Matrix* pStoryMatrix = mpDragStory->GetpStoryMatrix();
05676     DocCoord LeftIndent(0,0);
05677     pStoryMatrix->transform(&LeftIndent);
05678 
05679     return LeftIndent;
05680 }

DocCoord OpDragStoryNonPathRightIndent::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 5608 of file textops.cpp.

05609 {
05610     const Matrix* pStoryMatrix = mpDragStory->GetpStoryMatrix();
05611     DocCoord RightIndent(mpDragStory->GetStoryWidth(),0);
05612     pStoryMatrix->transform(&RightIndent);
05613 
05614     return RightIndent;
05615 }

BOOL OpDragStoryNonPathRightIndent::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 5399 of file textops.cpp.

05400 {
05401     return (RegisterOpDescriptor(   0,
05402                                     _R(IDS_OPTEXT_DRAGINDENT),
05403                                     CC_RUNTIME_CLASS(OpDragStoryNonPathRightIndent),
05404                                     OPTOKEN_TEXTDRAGRIGHTNONPATHINDENT,
05405                                     OpDragStoryIndent::GetState,
05406                                     0,                          // help ID 
05407                                     0,                          // Bubble help
05408                                     0,
05409                                     0,
05410                                     SYSTEMBAR_ILLEGAL,          // For now !
05411                                     TRUE,                       // Receive messages
05412                                     FALSE,
05413                                     FALSE,
05414                                     0,
05415                                     GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE
05416            )); 
05417 }


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