#include <slicetool.h>
Inheritance diagram for OpSliceDragBox:
Public Member Functions | |
void | StartDragBox (Spread *pSpread, DocCoord Anchor, ClickModifiers) |
Deals with a single click situation (i.e. no drag occurred). | |
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. It then goes through these objects, selecting all other objects sharing a name with any of them. | |
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 (OpSliceDragBox) |
Definition at line 437 of file slicetool.h.
|
|
|
Adds the operation to the list of all known operations.
Reimplemented from OpSelectorDragBox. Definition at line 3437 of file slicetool.cpp. 03438 { 03439 return RegisterOpDescriptor(0, _R(IDS_SLICE_BOX), CC_RUNTIME_CLASS(OpSliceDragBox), 03440 OPTOKEN_SLICE_DRAGBOX, OpSliceDragBox::GetState); 03441 }
|
|
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. It then goes through these objects, selecting all other objects sharing a name with any of them.
Reimplemented from OpSelectorDragBox. Definition at line 3372 of file slicetool.cpp. 03375 { 03376 // Build the rectangle of the drag box at the end of the drag 03377 DocRect BoundingRect(MIN(StartPoint.x, LastMousePosition.x), 03378 MIN(StartPoint.y, LastMousePosition.y), 03379 MAX(StartPoint.x, LastMousePosition.x), 03380 MAX(StartPoint.y, LastMousePosition.y)); 03381 03382 // First Rub out the old box 03383 RenderDragBlobs(BoundingRect, StartSpread, bSolidDrag); 03384 03385 // Put the hourglass up 03386 BeginSlowJob(); 03387 03388 // we need this info in scope here, although it is used just below. 03389 SelRange* pSel = GetApplication()->FindSelection(); 03390 RangeControl rcOld = pSel->GetRangeControlFlags(); 03391 03392 // Go and try and select a few things 03393 if (Success) 03394 { 03395 // If we didn't drag with the right button then deselect everything prior to selecting 03396 // the "lasso-ed" objects. 03397 if (!ClickMods.Adjust) 03398 NodeRenderableInk::DeselectAll(TRUE, FALSE); 03399 03400 // Select the objects in the BoundingRect 03401 RangeControl rg = rcOld; 03402 rg.IgnoreInvisibleLayers = TRUE; 03403 rcOld = rg; 03404 rg.PromoteToParent = TRUE; 03405 pSel->Range::SetRangeControl(rg); 03406 SliceHelper::SelectAllSetsInRect(BoundingRect, pSpread, 03407 SliceHelper::SelStateAction::SET); 03408 03409 // End the Drag 03410 if (!EndDrag()) 03411 FailAndExecute(); 03412 } 03413 else 03414 { 03415 // Set up the flags that say it all went wrong. 03416 EndDrag(); 03417 FailAndExecute(); 03418 } 03419 03420 // return the app's selection range flags to their original state. 03421 pSel->Range::SetRangeControl(rcOld); 03422 03423 // Final end of the operation. 03424 End(); 03425 }
|
|
Find out the state of the operation at the specific time.
Reimplemented from OpSelectorDragBox. Definition at line 3461 of file slicetool.cpp. 03462 { 03463 OpState os; 03464 03465 return os; 03466 }
|
|
Deals with a single click situation (i.e. no drag occurred).
Reimplemented from OpSelectorDragBox. Definition at line 3338 of file slicetool.cpp. 03339 { 03340 // We had better take a note of the starting point of the drag 03341 StartSpread = pSpread; 03342 StartPoint = Anchor; 03343 LastMousePosition = Anchor; 03344 03345 // Put some helpful text in the status bar. 03346 SliceTool::SetStatusText(_R(IDS_SLICE_DRAGBOXTEXT)); 03347 03348 // And tell the Dragging system that we need drags to happen 03349 StartDrag(DRAGTYPE_AUTOSCROLL); 03350 }
|