OpDragStoryNonPathLeftIndent Class Reference

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

#include <textops.h>

Inheritance diagram for OpDragStoryNonPathLeftIndent:

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

Public Member Functions

 OpDragStoryNonPathLeftIndent ()
 ~OpDragStoryNonPathLeftIndent ()

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

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


Constructor & Destructor Documentation

OpDragStoryNonPathLeftIndent::OpDragStoryNonPathLeftIndent  )  [inline]
 

Definition at line 944 of file textops.h.

00944 {};

OpDragStoryNonPathLeftIndent::~OpDragStoryNonPathLeftIndent  )  [inline]
 

Definition at line 945 of file textops.h.

00945 {};


Member Function Documentation

OpDragStoryNonPathLeftIndent::CC_DECLARE_DYNCREATE OpDragStoryNonPathLeftIndent   )  [private]
 

BOOL OpDragStoryNonPathLeftIndent::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 5486 of file textops.cpp.

05487 {
05488     // Set the story width
05489     DocCoord LeftIndentPos = GetThisIndent();
05490     DocCoord RightIndentPos = GetOtherIndent();
05491     mpDragStory->SetStoryWidth((INT32)mCurrentBlobPos.Distance(RightIndentPos));
05492 
05493     // We also want to rotate about the right indent position
05494     double OldAngle = atan2((double)(LeftIndentPos.y-RightIndentPos.y), (double)(LeftIndentPos.x-RightIndentPos.x));
05495     double NewAngle = atan2((double)(mCurrentBlobPos.y-RightIndentPos.y), (double)(mCurrentBlobPos.x-RightIndentPos.x));
05496     ANGLE RotAngle = (NewAngle-OldAngle)*(180/PI);
05497     Matrix RMatrix(RightIndentPos, RotAngle);
05498     Trans2DMatrix* pTransMat = new Trans2DMatrix(RMatrix);
05499     BOOL ok = pTransMat!=NULL;
05500     if (ok)
05501         ok = DoTransformNode(mpDragStory, pTransMat);
05502 
05503     // Now we need to translate the story so the left blob is where the user ended the drag
05504     if (ok)
05505     {
05506         LeftIndentPos = GetThisIndent();
05507         DocCoord TransOffset = mCurrentBlobPos - LeftIndentPos;
05508         Matrix TMatrix(TransOffset.x, TransOffset.y);
05509         Trans2DMatrix* pTransMat = new Trans2DMatrix(TMatrix);
05510         ok = pTransMat!=NULL;
05511         if (ok)
05512             ok = DoTransformNode(mpDragStory, pTransMat);
05513     }
05514 
05515     return ok;
05516 }

DocCoord OpDragStoryNonPathLeftIndent::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 5655 of file textops.cpp.

05656 {
05657     const Matrix* pStoryMatrix = mpDragStory->GetpStoryMatrix();
05658     DocCoord RightIndent(mpDragStory->GetStoryWidth(),0);
05659     pStoryMatrix->transform(&RightIndent);
05660 
05661     return RightIndent;
05662 }

DocCoord OpDragStoryNonPathLeftIndent::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 5590 of file textops.cpp.

05591 {
05592     const Matrix* pStoryMatrix = mpDragStory->GetpStoryMatrix();
05593     DocCoord LeftIndent(0,0);
05594     pStoryMatrix->transform(&LeftIndent);
05595 
05596     return LeftIndent;
05597 }

BOOL OpDragStoryNonPathLeftIndent::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 5370 of file textops.cpp.

05371 {
05372     return (RegisterOpDescriptor(   0,
05373                                     _R(IDS_OPTEXT_DRAGINDENT),
05374                                     CC_RUNTIME_CLASS(OpDragStoryNonPathLeftIndent),
05375                                     OPTOKEN_TEXTDRAGLEFTNONPATHINDENT,
05376                                     OpDragStoryIndent::GetState,
05377                                     0,                          // help ID 
05378                                     0,                          // Bubble help
05379                                     0,
05380                                     0,
05381                                     SYSTEMBAR_ILLEGAL,          // For now !
05382                                     TRUE,                       // Receive messages
05383                                     FALSE,
05384                                     FALSE,
05385                                     0,
05386                                     GREY_WHEN_NO_CURRENT_DOC | GREY_WHEN_NO_SELECTION | DONT_GREY_WHEN_SELECT_INSIDE
05387            )); 
05388 }


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