OpSliceDragBox Class Reference

Drag box class for the SliceTool. Allows the user to select a number of named sets, by dragging a box around some objects on the document. All objects sharing the same names as those inside the box will then be selected. More...

#include <slicetool.h>

Inheritance diagram for OpSliceDragBox:

OpSelectorDragBox Operation MessageHandler ListItem CCObject SimpleCCObject List of all members.

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)

Detailed Description

Drag box class for the SliceTool. Allows the user to select a number of named sets, by dragging a box around some objects on the document. All objects sharing the same names as those inside the box will then be selected.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/1999
NB funnily enough, this class inherits functionality from OpSelectorDragBox.

Definition at line 437 of file slicetool.h.


Member Function Documentation

OpSliceDragBox::CC_DECLARE_DYNCREATE OpSliceDragBox   )  [private]
 

BOOL OpSliceDragBox::Declare  )  [static]
 

Adds the operation to the list of all known operations.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>, from Rik's OpSelectorDragBox code.
Date:
11/10/1999
Returns:
TRUE if all went OK, False otherwise.

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 }

void OpSliceDragBox::DragFinished DocCoord  PointerPos,
ClickModifiers  ClickMods,
Spread pSpread,
BOOL  Success,
BOOL  bSolidDrag
[virtual]
 

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.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>, from Rik's OpSelectorDragBox code.
Date:
11/10/1999
Parameters:
PointerPos - The position of the mouse at the end of the drag [INPUTS] ClickMods - the key modifiers being pressed Success - TRUE if the drag was terminated properly, FALSE if it was ended with the escape key being pressed
See also:
ClickModifiers

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 }

OpState OpSliceDragBox::GetState String_256 Description,
OpDescriptor
[static]
 

Find out the state of the operation at the specific time.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>, from Rik's OpSelectorDragBox code.
Date:
11/10/1999
Parameters:
[INPUTS] 
Description GetState fills this string with an approriate description [OUTPUTS] of the current state of the SliceTool.
Returns:
The state of the operation, so that menu items (ticks and greying) can be done properly.

Errors: See also:

Reimplemented from OpSelectorDragBox.

Definition at line 3461 of file slicetool.cpp.

03462 {
03463     OpState os;
03464 
03465     return os;
03466 }

void OpSliceDragBox::StartDragBox Spread pSpread,
DocCoord  Anchor,
ClickModifiers 
 

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 }


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:58:59 2007 for Camelot by  doxygen 1.4.4