#include <textops.h>
Inheritance diagram for OpDragStoryNonPathLeftIndent:
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) |
Definition at line 938 of file textops.h.
|
Definition at line 944 of file textops.h.
|
|
Definition at line 945 of file textops.h.
|
|
|
|
Called to perform the change to the story required at the completion of the blob drag.
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 }
|
|
Gets the original position of the stationary indent.
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 }
|
|
Gets the original position of the dragged indent.
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 }
|
|
Initialises the operation; registers its op descriptor.
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 }
|