#include <pushtool.h>
Inheritance diagram for OpPush:
Public Member Functions | |
OpPush () | |
Constructor. This simply sets a few of the operation flags to say that it can not be added to the undo system and that it should be deleted when it ends. | |
void | DoDrag (DocCoord Anchor) |
To start up the dragging of the document around. It records the starting point of the drag as this is used to calculate the offsets that are needed as the mouse moves about. | |
virtual BOOL | SnappingDrag () |
virtual void | DragPointerMove (DocCoord PointerPos, ClickModifiers ClickMods, Spread *, BOOL bSolidDrag) |
This function will change the scroll offsets of the current view to track the mouse moving about. This will give the effect of sliding the document around with the mouse. | |
virtual void | DragFinished (DocCoord Pos, ClickModifiers Mods, Spread *, BOOL Success, BOOL bSolidDrag) |
Finishes the scrolling around the document and ends the drag operation. | |
BOOL | GetStatusLineText (String_256 *ptext, Spread *, DocCoord, ClickModifiers) |
Get status line help text for push tool when dragging. | |
Static Public Member Functions | |
static BOOL | Declare () |
Adds the operation to the list of all known operations. | |
static OpState | GetState (String_256 *Description, OpDescriptor *) |
Find out the state of the operation at the specific time. | |
Private Member Functions | |
CC_DECLARE_DYNCREATE (OpPush) | |
Private Attributes | |
WorkCoord | AnchorPoint |
Definition at line 194 of file pushtool.h.
|
Constructor. This simply sets a few of the operation flags to say that it can not be added to the undo system and that it should be deleted when it ends.
Definition at line 578 of file pushtool.cpp.
|
|
|
|
Adds the operation to the list of all known operations.
Definition at line 713 of file pushtool.cpp. 00714 { 00715 return (RegisterOpDescriptor( 00716 0, 00717 _R(IDS_PUSH_TOOL), 00718 CC_RUNTIME_CLASS(OpPush), 00719 OPTOKEN_PUSH, 00720 OpPush::GetState, 00721 0, /* help ID */ 00722 _R(IDBBL_PUSHTOOLOP), 00723 0 /* bitmap ID */)); 00724 00725 }
|
|
To start up the dragging of the document around. It records the starting point of the drag as this is used to calculate the offsets that are needed as the mouse moves about.
Definition at line 597 of file pushtool.cpp. 00598 { 00599 // Find out the selected Document View 00600 DocView* pDocView = DocView::GetSelected(); 00601 ENSURE( pDocView != NULL, "OpPush::DoDrag - No selected DocView" ); 00602 if (pDocView==NULL) 00603 return; 00604 00605 // Get the mouse position in work coords 00606 AnchorPoint = pDocView -> GetClickWorkCoord(); 00607 00608 // and start a drag (pass in FALSE for KeepAccuracy, because we want this drag to 00609 // reflect the cursor position at all times - we're not really interested in the 00610 // intermediate mouse movements when there are lots of them). 00611 StartDrag( DRAGTYPE_NOSCROLL, NULL, NULL, FALSE ); 00612 00613 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00614 String_256 text(""); 00615 if (text.Load(_R(IDS_PUSHOP_STATUSHELP))) 00616 GetApplication()->UpdateStatusBarText(&text); 00617 #endif 00618 }
|
|
Finishes the scrolling around the document and ends the drag operation.
Reimplemented from Operation. Definition at line 682 of file pushtool.cpp. 00683 { 00684 // Put up the hourglass as we have to 00685 BeginSlowJob(); 00686 00687 // End the Drag 00688 EndDrag(); 00689 00690 // If the drag failed, then fail the operation 00691 if (!Success) FailAndExecute(); 00692 00693 // End the operation 00694 End(); 00695 00696 // Send a message saying that the screen has changed, so that the brush tool can update 00697 BROADCAST_TO_ALL(ScreenChangeMsg()); 00698 00699 }
|
|
This function will change the scroll offsets of the current view to track the mouse moving about. This will give the effect of sliding the document around with the mouse.
Reimplemented from Operation. Definition at line 638 of file pushtool.cpp. 00639 { 00640 DocView* pDocView = DocView::GetSelected(); 00641 ENSURE( pDocView != NULL, "OpPush::DragPointerMove - DocView was NULL" ); 00642 if (pDocView==NULL) 00643 return; 00644 00645 // Declare a few WorkCoords we will need 00646 WorkCoord ScrollOffsets; 00647 WorkCoord Change; 00648 WorkCoord MoveClick = pDocView->GetClickWorkCoord(); 00649 00650 // How Much has it changed 00651 Change.x = AnchorPoint.x - MoveClick.x; 00652 Change.y = AnchorPoint.y - MoveClick.y; 00653 00654 // Find the Scroll Offsets and change them 00655 ScrollOffsets = pDocView->GetScrollOffsets(); 00656 ScrollOffsets.x += Change.x; 00657 ScrollOffsets.y += Change.y; 00658 00659 // Make sure the ScrollOffsets are valid and then set them 00660 if ( ScrollOffsets.x < 0 ) ScrollOffsets.x = 0; 00661 if ( ScrollOffsets.y > 0 ) ScrollOffsets.y = 0; 00662 pDocView->SetScrollOffsets( ScrollOffsets, TRUE ); 00663 }
|
|
Find out the state of the operation at the specific time.
Definition at line 742 of file pushtool.cpp. 00743 { 00744 OpState Blobby; 00745 return Blobby; 00746 }
|
|
Get status line help text for push tool when dragging.
Reimplemented from Operation. Definition at line 762 of file pushtool.cpp. 00763 { 00764 ERROR2IF(this==NULL,FALSE,"OpPush::GetStatusLineText() - this==NULL"); 00765 00766 return pText->Load(_R(IDS_PUSHOP_STATUSHELP)); 00767 }
|
|
Reimplemented from Operation. Definition at line 205 of file pushtool.h. 00205 { return FALSE; }
|
|
Definition at line 218 of file pushtool.h. |