#include <selector.h>
Inheritance diagram for OpSelectorDragBox:
Public Member Functions | |
OpSelectorDragBox () | |
Constructor. This simply sets a few of the operation flags. | |
void | StartDragBox (Spread *pSpread, DocCoord Anchor, ClickModifiers) |
This is called when a Drag operation has been detected. | |
virtual BOOL | SnappingDrag () |
virtual void | DragPointerMove (DocCoord, ClickModifiers, Spread *, BOOL bSolidDrag) |
This is called every time the mouse moves, during a drag. All it really does is update the EORed bounding box. | |
virtual void | DragFinished (DocCoord, ClickModifiers, Spread *, BOOL, BOOL bSolidDrag) |
This is called when a drag operation finishes. This removes the EORed drag rect from the screen and then selects all the objects that were in it. | |
void | RenderDragBlobs (DocRect, Spread *, BOOL bSolidDrag) |
EORs a rectangle onto the screen to mark out the size of the current selection. | |
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 (OpSelectorDragBox) | |
Private Attributes | |
Spread * | StartSpread |
DocCoord | StartPoint |
DocCoord | LastMousePosition |
Definition at line 132 of file selector.h.
|
Constructor. This simply sets a few of the operation flags.
Definition at line 5742 of file selector.cpp.
|
|
|
|
Adds the operation to the list of all known operations.
Reimplemented in OpSliceDragBox. Definition at line 5930 of file selector.cpp. 05931 { 05932 return RegisterOpDescriptor(0, _R(IDS_SELECTOR_BOX), CC_RUNTIME_CLASS(OpSelectorDragBox), 05933 OPTOKEN_SELECTOR_DRAGBOX, OpSelectorDragBox::GetState); 05934 }
|
|
This is called when a drag operation finishes. This removes the EORed drag rect from the screen and then selects all the objects that were in it.
Reimplemented from Operation. Reimplemented in OpSliceDragBox. Definition at line 5829 of file selector.cpp. 05831 { 05832 // Build the rectangle of the drag box at the end of the drag 05833 DocRect BoundingRect(MIN(StartPoint.x, LastMousePosition.x), 05834 MIN(StartPoint.y, LastMousePosition.y), 05835 MAX(StartPoint.x, LastMousePosition.x), 05836 MAX(StartPoint.y, LastMousePosition.y)); 05837 05838 // First Rub out the old box 05839 RenderDragBlobs(BoundingRect, StartSpread, bSolidDrag); 05840 05841 // Put the hourglass up 05842 BeginSlowJob(); 05843 05844 // Go and try and select a few things 05845 if (Success) 05846 { 05847 // If we didn't drag with the right button then deselect everything prior to selecting 05848 // the "lasso-ed" objects, and remember to restore the rotation centre to the middle of 05849 // the selection. 05850 if (!ClickMods.Adjust) 05851 { 05852 NodeRenderableInk::DeselectAll(); 05853 ((SelectorTool*) Tool::GetCurrent())->InvalidateRotationCentre(); 05854 } 05855 05856 // Select the objects in the BoundingRect 05857 NodeRenderableInk::SelectAllInRect(BoundingRect, Spread, 05858 NodeRenderableInk::SET); 05859 /* 05860 // This old code makes right-button marquee consistent with the right-button selection toggle. 05861 // Unfortunately Charles & Burns don't like it (this week). 05862 NodeRenderableInk::SelectAllInRect(BoundingRect, Spread, 05863 ClickMods.Adjust ? NodeRenderableInk::SelStateAction::TOGGLE 05864 : NodeRenderableInk::SelStateAction::SET); 05865 */ 05866 // Reenable the tool's idle processing. 05867 SelectorTool::AllowIdleWork(TRUE); 05868 05869 // End the Drag 05870 if (!EndDrag()) FailAndExecute(); 05871 } 05872 else 05873 { 05874 // Reenable the tool's idle processing. 05875 SelectorTool::AllowIdleWork(TRUE); 05876 05877 // Set up the flags that say it all went wrong. 05878 EndDrag(); 05879 FailAndExecute(); 05880 } 05881 05882 // Final end of the operation. 05883 End(); 05884 05885 }
|
|
This is called every time the mouse moves, during a drag. All it really does is update the EORed bounding box.
Reimplemented from Operation. Definition at line 5788 of file selector.cpp. 05790 { 05791 // First Rub out the old box 05792 DocRect Rect = DocRect(MIN(StartPoint.x, LastMousePosition.x), 05793 MIN(StartPoint.y, LastMousePosition.y), 05794 MAX(StartPoint.x, LastMousePosition.x), 05795 MAX(StartPoint.y, LastMousePosition.y)); 05796 RenderDragBlobs(Rect, StartSpread, bSolidDrag); 05797 05798 // Update the box and draw in the new one 05799 if (pSpread != StartSpread) 05800 { 05801 PointerPos = MakeRelativeToSpread(StartSpread, pSpread, PointerPos); 05802 } 05803 05804 LastMousePosition = PointerPos; 05805 Rect = DocRect(MIN(StartPoint.x, LastMousePosition.x), 05806 MIN(StartPoint.y, LastMousePosition.y), 05807 MAX(StartPoint.x, LastMousePosition.x), 05808 MAX(StartPoint.y, LastMousePosition.y)); 05809 RenderDragBlobs(Rect, StartSpread, bSolidDrag); 05810 }
|
|
Find out the state of the operation at the specific time.
Reimplemented in OpSliceDragBox. Definition at line 5950 of file selector.cpp. 05951 { 05952 OpState Blobby; 05953 return Blobby; 05954 }
|
|
EORs a rectangle onto the screen to mark out the size of the current selection.
Reimplemented from Operation. Definition at line 5897 of file selector.cpp. 05898 { 05899 RenderRegion* pRegion = DocView::RenderOnTop(&Rect, pSpread, ClippedEOR); 05900 while (pRegion) 05901 { 05902 // Set the line colour 05903 pRegion->SetLineColour(COLOUR_XORSELECT); 05904 05905 // And Draw the rect 05906 DocRect RubberBox = DocRect(MIN(StartPoint.x, LastMousePosition.x), 05907 MIN(StartPoint.y, LastMousePosition.y), 05908 MAX(StartPoint.x, LastMousePosition.x), 05909 MAX(StartPoint.y, LastMousePosition.y)); 05910 05911 // Draw the rectangle 05912 pRegion->DrawDragRect(&RubberBox); 05913 05914 // Get the Next render region 05915 pRegion = DocView::GetNextOnTop(&Rect); 05916 } 05917 }
|
|
Reimplemented from Operation. Definition at line 141 of file selector.h. 00141 { return FALSE; }
|
|
This is called when a Drag operation has been detected.
Reimplemented in OpSliceDragBox. Definition at line 5758 of file selector.cpp. 05759 { 05760 // We had better take a note of the starting point of the drag 05761 StartSpread = pSpread; 05762 StartPoint = Anchor; 05763 LastMousePosition = Anchor; 05764 05765 // Put some helpful text in the status bar. 05766 SelectorTool::AllowIdleWork(FALSE); 05767 SelectorTool::SetStatusText(_R(IDS_SEL_DRAGBOXTEXT)); 05768 05769 // And tell the Dragging system that we need drags to happen 05770 StartDrag(DRAGTYPE_AUTOSCROLL); 05771 }
|
|
Definition at line 161 of file selector.h. |
|
Definition at line 160 of file selector.h. |
|
Definition at line 159 of file selector.h. |