SelectorTool Class Reference

The Selector tool is used to change the selection, edit objects and transform them. The Selector tool now derives from the DragTool, so that TransOperation may refer to a general DragTool when an object drag is in progress. At a later date, drag functionality may be pulled up into DragTool, to allow future tools to implement dragging of objects more easily. More...

#include <selector.h>

Inheritance diagram for SelectorTool:

DragTool Tool_v1 List of all members.

Public Types

enum  BlobType { NO_BLOBS, BOUNDS_BLOBS, ROTATE_BLOBS }

Public Member Functions

 SelectorTool ()
 Dummy Constructor - sets member pointers to NULL and initialises the record of which blobs are displayed (initially only "tiny" blobs).
virtual ~SelectorTool ()
 Destructor (Virtual). Does nothing.
BOOL Init ()
 Used to check if the Tool was properly constructed.
void Describe (void *InfoPtr)
 Allows the tool manager to extract information about the tool.
UINT32 GetID ()
virtual void SelectChange (BOOL)
 Called whenever this tool is selected or deselected.
virtual void OnClick (DocCoord, ClickType, ClickModifiers, Spread *)
 Dispatches mouse events to the proper handler. The tool is given a chance to handle an event first, which allows it to override the usual behaviour if necessary. If it doesn't handle the event the selected object(s) are given a chance. Finally, any events still not handled are given to the selector tool to deal with.
virtual void OnMouseMove (DocCoord, Spread *, ClickModifiers)
 Called by the tool system for the current tool when the mouse is moved outside of a drag. Checks if the mouse is over one of the tool's blobs, changing the cursor appropriately if it is.
virtual BOOL OnKeyPress (KeyPress *pKey)
 Called when a key is pressed of released. If the key is a "click modifier" such as the ALT or CTRL key then the cursor is changed to indicate whatever the tool can do with that modifier.
virtual BOOL OnIdle ()
 Called on idle events. Performs hit-detection on the current mouse position and updates the status-bar text accordingly.
virtual void RenderToolBlobs (Spread *pSpread, DocRect *pClipRect)
 Draws the blobs specific to the selector tool. This can include the Bounds blobs that surround the current selection, or the Rotate/Shear blobs that also surround the selection.
void DragMove (TransformBoundingData *pBoundingData)
 This function is called by the transform operations every time the mouse moves, so that the selector tool can keep the fields in its info bar up to date.
virtual BOOL DragFinished (DragEndType det)
 Called by the tool base-class when a drag is finished. In the selector tool this resets the cursor and always returns success. It also makes sure that the info-bar text reflects the selection, even if the drag was cancelled with the ESCAPE key.
virtual BOOL AreToolBlobsRenderedOnSelection ()
void SelectionHasChanged (BOOL DontUpdate=0)
 Called when the selection changes, allowing the selector tool to do things like update its tools blobs etc.
void AttributeHasChanged ()
 Responds to an attribute-changing message by forcing the selection range to update its bounds, then forces a recalc and redraw of the tool's bounds blobs.
void ViewChanged (const DocViewMsg &msg)
 When views and documents are changing the selector tool needs to get its selection data correct for the old and new views so that its tool blobs can be removed. This function allows the info bar to get the tool to re-calculate this information and draw the blobs accordingly. The blobs are only drawn once here as this functions real purpose it to get rid of the blobs from the old view and the draw them in on the new view. As a result the info bar calls this function twice after setting up the appropriate docview info.
BOOL UpdateSelectionInfo ()
 Updates the selector tool's record of the spread and bounding rectangle of the current selection.
SpreadGetSelectionSpread () const
 Returns a pointer to the spread containing the currently selected object(s). Used internally by the info-bar.
const DocRectGetSelectionBounds (BOOL WithNoAttrs=FALSE) const
 Returns a reference to the bounds of the selected object(s). This will be empty if there is no current selection. Used internally by the info-bar.
const BOOL GetAreaDetails (BOOL WithNoAttrs, XLONG *pxlArea, XLONG *pxlPerim) const
 Returns a reference to the bounds of the selected object(s). This will be empty if there is no current selection. Used internally by the info-bar.
void RotationCentreDragged (const DocCoord &dcNewPos)
 Updates the centre of rotation, marking it as now 'valid'. This is called by the drag operation on successful completion.
void InvalidateRotationCentre ()
 Tells the selector tool that it should position the centre of rotation in the middle of the selection's bounds, the next time there is a selection.
void SelectionBlobChange (BlobStyle ChangingBlobs)
 Called when the types of blob that are being displayed is to be changed (ie, someone pressed one of the buttons on the info bar). This function tells the blob manager what it wants to know and will display or remove the Tool blobs as appropriate. You should only have one of the blobs types set to TRUE at a time. ie, only change one type of blob at once.
void BoundsButtonChange ()
 Called by the info-bar when the user has clicked on the 'Show Bounds/Rotate Blobs' button. Handles keeping a record of the setting, changing the blobs on-screen etc.
void RotateButtonChange (BOOL fNewState)
 Called by the info-bar when the user clicks on the "Rotate Blobs" button, that switches between rotate blobs and bounds blobs. Handles updating on-screen blobs etc.
void FlipButtonChange (BOOL fIsVertical)
 Called by the info-bar when the user clicks one of the "flip" buttons. Gets default transformation parameters and starts an "immediate" transformation operation.
void SetRotateCentre (INT32 nBlob)
 Responds to a click on the "telephone keypad" by moving the centre of rotation to the given position, as described by a blob number. The blob itself will be redrawn if necessary.
void DoTranslateImmediate (MILLIPOINT nXpos, MILLIPOINT nYpos)
 Runs a translation of the selected object(s) initiated from the info-bar.
void DoScaleImmediate (MILLIPOINT nWinc, MILLIPOINT nHinc)
 Scales the selected object(s) as initiated from the info-bar.
void DoScalePercentImmediate (double nWpercent, double nHpercent)
 As the previous DoScaleImmediate() ( Scales the selected object(s) as initiated by the info-bar ), except omitting calculation of the relative change in scale, and filling the transform's parameter block with the width & height instead, and sending a different optoken. Scales the selection as initiated from the info-bar.
void DoRotateImmediate (ANGLE nAngle)
 Rotates the selection as initiated from the info-bar.
void DoShearImmediate (ANGLE nAngle)
 Shears the selection, as initiated from the info-bar.
void PublicDoTranslate ()
void ResetDefaults ()
 Called after a click or drag event if the tool's options should be set back to certain defaults. For example, if the selection is changed to a new object then rotate blobs should be switched back to bounds blobs and the "Leave Copy" button should be OFF.
virtual BOOL GetStatusLineText (String_256 *ptext, Spread *pSpread, DocCoord DocPos, ClickModifiers cmods)
 Figure out what the status text for the Selector tool is at the given position on the given spread with the given click modifiers.
void FigureUserFeedback (Spread *pSpread, DocCoord dcMousePos, ClickModifiers cmods, BOOL DoSlowTests, String_256 *pStr, Cursor **ppPointerShape)
 This routine computes the status line help and the pointer shape for any given mouse position in the Selector tool. It does NOT set either of these values but returns them both to the caller. It's up to the caller to decide whether to use these values or not. The tests done to figure out which pointer shapes, status help (and maybe other stuff one day) is quite complex so it's most efficient to compute them all at once and then let the caller decide which ones to actually use. The precedence of pointer shapes, status messages and other user feedback is determined by the order of the checks within this function (not by flags any more!).
BOOL Append (String_256 *pStr, UINT32 StringID)
 

BOOL Append (String_256 *pStr, String_256 String)
 

BOOL Append (String_256 *pStr, ClickModifiers cmods, UINT32 SelectID, UINT32 AddID, UINT32 RemoveID, NodeRenderableInk *pActionNode=NULL)
 

BOOL Append (String_256 *pStr, ClickModifiers cmods, String_256 SelectTemplate, String_256 AddTemplate, String_256 RemoveTemplate, NodeRenderableInk *pActionNode=NULL)
 

BlobStyle GetBlobStyle () const
 To find out what blobs the selector tool is displaying.
BlobType GetCurrentToolBlobType () const
 Returns the type of tool blobs currently being displayed, either None, Bounds, or Rotate blobs. Used internally by the info-bar.

Static Public Member Functions

static void AllowIdleWork (BOOL fIsAllowed)
 Turns idle processing on or off. During idle events the selector tool updates the status bar, so if a drag operation, for instance, wants to place its own text in the status bar while it is running it should call this function at its start and at its end.
static BOOL IsSelectorCaching ()
static BOOL BeyondFixedRange (double fpFixedVal)
 Checks for under/overflow in fixed-point calculations.
static BOOL GetNormalClick_CheckProfileDialog ()
static void SetNormalClick_CheckProfileDialog (BOOL newVal)
static NodeRenderableInkFindPreProcessClickNode (Spread *pSpread, DocCoord ClickPos, BOOL Interruptible=FALSE)
 This scans the nodes in the spread to see if any of them are interested in the click before it is processed in the normal way.
static void SetStatusText (UINT32 nStringID)
 Sets the status bar text to the given string. Alternative to loading the string yourself and calling the other SetStatusText function.
static void SetStatusText (String_256 *pStr)
 Sets the status bar text to the given string.
static void UnCacheInfoBar (BOOL=FALSE)
 deletes the cached infobar and sets it's ID to NULL -this is normally called when the selector is not the current tool - it can be forced however(on close down etc..)
static INT32 GetBlobBorderSize (void)
 Determines the width of the "border" between a selected object and the bounds blobs around it. NB. there must be a selected DocView for this function to work (it relies on the selected view's scale factor).
static void InflateByBlobBorder (DocRect *pdrRect)
 Useful public function that adjusts a bounding rectangle by the "border" between a selected object and the bounds blobs around it. NB. there must be a selected DocView for this function to work (it relies on the selected view's scale factor).
static void AllowGuidelineScan (BOOL newVal=TRUE)

Protected Member Functions

virtual BOOL PreProcessClick ()
 This allows a click to be handled before going through the standard selector tool click handling code.
virtual BOOL ProcessObjectClick ()
 Iterates over the selector objects, calling the OnClick method of each NodeRenderableInk and AttrFillGeometry.
virtual void PostProcessClick ()
 Last-chance handler for a mouse event. Calls HandleSingleClick for a CLICKTYPE_SINGLE and HandleDragClick for a CLICKTYPE_DRAG etc.
virtual void HandleSingleClick ()
 Called when the selector tool must process a button-down mouse event.
virtual void HandleDoubleClick ()
 Called when the selector tool must process a mouse double-click. Currently does nothing.
virtual void HandleDragClick ()
 Called when the selector tool must process a mouse drag.
virtual void HandleButtonUp ()
 Called when the selector tool must process a mouse button-up event. Note that such events are NOT sent if an Operation etc has run a drag in response to a CLICKTYPE_DRAG.
virtual void HandleTabKey (BOOL fIsShifted)
 Called when the selector tool receives a TAB keystroke. Moves the selection to the next object in render-order.
NodeIteratePreProcess (Node *pCurrent)
 Iteration pre-processing. If we're asked to iterate over the selection, and we happen to be on a node, eg a text-character, which is unsuitable for iterating from, then we need to move to a more suitable node.
NodeRenderableInkIterateNextInk (Node *pCurrent, IterateFlags iterFlags)
 Iterate over the document. See notes up above for more info. Notes: * Could be made into a non-virtual function in Node or NodeRenderableInk. Recursively calls IteratePostProcessNext().
NodeRenderableInkIteratePrevInk (Node *pCurrent, IterateFlags iterFlags)
 Iterate over the document. See notes up above for more info. Notes: * Could be made into a non-virtual function in Node or NodeRenderableInk. Recursively calls IteratePostProcessPrev().
NodeRenderableInkIteratePostProcessNext (Node *pCurrent, Node *pParent, IterateFlags iterFlags)
 IterateNextInk() is brainless - it picks the next sibling of a node. This function makes an informed decision, based on that chosen node, to get the selection-tabbing order correct. See notes above for more info.
NodeRenderableInkIteratePostProcessPrev (Node *pCurrent, Node *pParent, IterateFlags iterFlags)
 IteratePrevInk() is brainless - it picks the previous sibling of a node. This function makes an informed decision, based on that chosen node, to get the selection-tabbing order correct. See notes above for more info.

Protected Attributes

Layerm_pIterStartLayer

Static Protected Attributes

static BOOL fSlaveLineWidthToButton = TRUE
 Controls whether attributes (line widths mainly) are considered when calculating bounding rectangles for objects. This is used when displaying and editing width/height information in the infobar.
static BOOL fConsiderLineWidths = FALSE
 Controls whether attributes (line widths mainly) are considered when calculating bounding rectangles for objects. This is used when displaying and editing width/height information in the infobar.
static BOOL fUseScalingFix = FALSE
 Controls whether my scaling fix is used.
static BOOL bPageDoubleClickOpenFile = FALSE
 Controls whether double-clicking on the page will show the Open dialog.

Private Types

enum  ClickActionCode {
  CLICKACTION_NONE, CLICKACTION_BOUNDTOPLEFT, CLICKACTION_BOUNDTOP, CLICKACTION_BOUNDTOPRIGHT,
  CLICKACTION_BOUNDLEFT, CLICKACTION_BOUNDRIGHT, CLICKACTION_BOUNDBOTTOMLEFT, CLICKACTION_BOUNDBOTTOM,
  CLICKACTION_BOUNDBOTTOMRIGHT, CLICKACTION_BOUNDTRANSFORMORIGIN, CLICKACTION_SELNONE, CLICKACTION_SELNODE,
  CLICKACTION_SELUNDER, CLICKACTION_SELUNDERCYCLE, CLICKACTION_SELUNDERFAIL, CLICKACTION_SELUNDERFAIL2,
  CLICKACTION_SELINSIDE, CLICKACTION_SELINSIDECYCLE, CLICKACTION_SELINSIDEFAIL, CLICKACTION_SELINSIDEFAIL2,
  CLICKACTION_SELLEAF
}

Private Member Functions

 CC_DECLARE_MEMDUMP (SelectorTool)
BOOL IsRotateCentreClicked (DocCoord ClickStart) const
 Decides whether the user has clicked the rotation centre blob, correctly handling the case where rotate blobs aren't visible.
BOOL IsTranslateShortcut (ClickModifiers cmods) const
 Detects whether the current mouse click modifiers denote the translate drag operation shortcut.
BOOL IsClickModified (ClickModifiers cmods) const
 Tests whether any of the modifiers, eg. Constrain, Adjust etc, apply to the current mouse click (as received by the OnClick function).
BOOL IsSelectUnderClick (ClickModifiers cmods) const
 Decides whether the current click is modified to be an "under" click or not.
BOOL IsSelectMemberClick (ClickModifiers cmods) const
 Reports whether the current mouse click meant the user wanted to "select- inside" or not.
BOOL IsSelectLeafClick (ClickModifiers cmods) const
 Reports whether the current mouse click meant the user wanted to "select- leaf" or not.
NodeRenderableInkFindFrom (NodeRenderableInk *pSimpleNode) const
 Front-end short-hand for NodeRenderableInk::FindCompoundFromSimple.
NodeRenderableInkEnsureInkNext (Range *range, Node *pNode) const
 Ensure that the node passed is an ink node and if not find the next object in the range that IS.
NodeRenderableInkEnsureInkPrev (Range *range, Node *pNode) const
 Ensure that the node passed is an ink node and if not find the prev object in the range that IS.
ClickActionCode DetermineClickAction (NodeRenderableInk **ppActionNode, NodeRenderableInk *pLastClickNode, NodeRenderableInk *pClickSimpleNode, NodeRenderableInk *pClickCompoundNode, Spread *pStartSpread, DocCoord ClickStart, ClickModifiers ClickMods)
 Determine what action needs to be taken inresponse to a click.
ClickActionCode CycleClickAction (NodeRenderableInk **ppActionNode, NodeRenderableInk *pClickCompoundNode, ClickActionCode foundAction, ClickActionCode cycleAction)
 Determine what action needs to be taken inresponse to a click.
BOOL ValidateLastClickUnder (NodeRenderableInk *pLastClickNode, Spread *pStartSpread, DocCoord ClickStart)
 Validate that the last click node is still under the pointer Note! This routine can be slow depending on how deep it has to look in the tree for the last selected object.
BOOL ValidateLastClickInside (NodeRenderableInk *pLastClickNode, NodeRenderableInk *pClickSimpleNode)
 Validate that the simple node is inside the last clicked node.
void GetUserParams ()
 Sets up the transformation data structure with default values read from the tool's info-bar, as set by the user. Individual transformations can override these settings later.
void DoScale ()
 Runs a scale transformation drag of the selection.
void DoSquash ()
 Runs a squash transformation drag on the selection.
void DoShear ()
 Runs a shear transformation drag on the selection.
void DoTranslate ()
 Runs a translation transformation drag on the selection.
void DoRotate ()
 Runs a rotation transformation drag on the selection.
void DoDragBox ()
 Runs a selector tool drag-box operation.
void DoDragRotateCentre ()
 Runs a drag operation for moving the centre of rotation blob around.
BOOL StartXformDrag (TransOperation *pXformDragOp, DragType dragtype)
 Fills in any remaining fields of the transformation data structure(s) and calls the Tranform virtual function that initiates a mouse drag.
BOOL StartXformImmediate (const TCHAR *chOpToken, void *pvParam2)
 Runs a tranformation Operation in response to the user changing settings on the tool's info-bar. This works through the traditional 'Invoke' method.
void RenderBoundBlobs (Spread *, DocRect *, const DocRect &)
 This function is called from the RenderToolBlobs function. If the Bounds Blobs should be displayed (ie the user has switch them on) then this function is used to draw them. The blobs appear as a small rect at each corner of the selection rectangle as well as one at the midpoint of each of the sides of the rectangle. This function should not be called directly, but only through RenderToolBlobs().
void RenderRotateBlobs (Spread *, DocRect *, const DocRect &)
 Draws the blobs that appear when the Rotate/Shear mode of the selector tool is entered. These blobs appear in the same places as the Bounds Blobs, around the edge of the given rectangle. The only difference is their appearance. The blobs at the corner of the selection appear as small curved arrows to indicate rotation and the ones on the side of the selection appear as straight arrows to indicate shearing.
void RenderRotateCentre (RenderRegion *, const DocCoord &)
 Draws the rotation centre blob at the given position. This is a separate function so that the drag code can call it as well.
DocRect InflatedSelRect () const
 Calculates the position of the blobs around a selected object.
DocCoord GetBoundsBlobPos (INT32 nBlob) const
 Calculates the position of a given blob within the document.
DocCoord GetSelPosNearBlob (INT32 nBlob) const
 This returns the nearest point to the given blob on the selected object(s) bounding rectangle.
INT32 BoundsBlobHitTest (const DocCoord &dcMousePos) const
 Checks if the given coordinate is over or very near a blob.
void ChangeCursorAndText (INT32 nBlobID, String_256 *pStr, Cursor **pPointerShape)
 Changes the cursor shape according to thew nBlobID parameter. Each blob has its own cursor shape.
void SetKeyDownCursor (ClickModifiers cmods)
 Decodes the bit-field fKeyStates, indicating which combination of modifier keys are down, and sets the cursor appropriately.
void ResetCursorNow ()
 Called when a mouse button-up event or end-of-drag event occurs. It resets the cursor according to which modifier keys are up or down, without a key event having to take place.
void RenderOtherToolBlobs ()
 Called when the selector tool changes the selection, and yet may not be the *current* tool. This can happen nowadays with the right mouse button popping up the menu and changing the selection whilst in any tool.

Static Private Member Functions

static BOOL ReadPrefs ()
 Reads settings concerning the selector tool from the .INI file.
static BOOL IsNearBlob (const DocCoord &dcBlobOrigin, const DocCoord &dcTestPoint)
 Private helper function for SelectorTool::BlobHitTest.

Private Attributes

BOOL fAllowIdleProcessing
BOOL fMouseHasMoved
SpreadSelectionSpread
SelRangeSelectRange
DocRect SelectionRect
DocRect SelectionRectNoAttr
XLONG xlSelectionArea
XLONG xlSelectionPerim
BOOL fIgnoreSelChange
DocCoord ClickStart
SpreadStartSpread
ClickModifiers ClickMods
ClickType TypeOfClick
INT32 nClickedBoundsBlob
BOOL fPossibleToggleClick
BOOL fIsBlobDrag
NodeRenderableInkpClickSimpleNode
NodeRenderableInkpClickCompoundNode
NodeRenderableInkpLastClickNode
NodeRenderableInkpPreProcClickNode
TransformData tdParams
DocCoord dcRotateCentre
BOOL fRotateCentreIsValid
TransformBoundingData BoundingData
BlobStyle bsBlobStyle
BlobType eCurrentBlobs
BOOL fShowToolBlobs
INT32 nLastSelectedBlob
BOOL fValidSelectedBlob
BOOL m_bComputeAreaDetails
CursorpNormalCursor
CursorpAdjustCursor
CursorpUnderCursor
CursorpInsideCursor
CursorpUnderAdjustCursor
CursorpInsideAdjustCursor
CursorpLeafCursor
CursorpLeafAdjustCursor
CursorpALLCursor
CursorpNWSECursor
CursorpNESWCursor
CursorpNSCursor
CursorpWECursor
CursorpGradFillCursor
CursorpDragRotateCursor
CursorpHorzGuideCursor
CursorpVertGuideCursor

Static Private Attributes

static BOOL fSelectorIsCaching = FALSE
static TCHARFamilyName = _T("Selection Tools")
static TCHARToolName = _T("Selector Tool")
static TCHARPurpose = _T("Selecting objects and editing the selection")
static TCHARAuthor = _T("Justin Flude & Phil Martin")
static INT32 CursorStackID = 5000
static SelectorInfoBarOppInfoBarOp = NULL
static BlobManagerpBlobManager = NULL
static INT32 nBlobBorder = 4
 Determines how wide a border, in millimetres, to inflate the bounding rectangle of the selected object, when drawing blobs around it. The default is 4 mm.
static unsigned fBlobPref = 1
 Determines which blobs should be initially displayed. This should really be done by the blob manager!
static BOOL fAllowCorelToggleClick = TRUE
 If TRUE (the default) allows a single click on a selected object to toggle between bounds blobs & rotate blobs, for compatibility with Corel Draw. This toggling option not allowed when Object blobs are shown, it would be a pain.
static BOOL fSelectUnderLikeArtWorks = FALSE
 If TRUE then the select-under feature, Alt-Click, works exactly like ArtWorks, so that an Alt-Click on an unselected object selects that object rather than the object underneath. If FALSE then Alt-Click always selects an object underneath the clicked object, irrespective of whether the clicked object was selected or not. The default is FALSE, as this is consistent with the way that select-inside works.
static BOOL bNormalClickCheckProfileDialog = FALSE
static BOOL bGlineSAllowed = TRUE

Friends

class SelectorInfoBarOp
class OpDragRotateCentre

Classes

struct  IterateFlags

Detailed Description

The Selector tool is used to change the selection, edit objects and transform them. The Selector tool now derives from the DragTool, so that TransOperation may refer to a general DragTool when an object drag is in progress. At a later date, drag functionality may be pulled up into DragTool, to allow future tools to implement dragging of objects more easily.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/1999

Definition at line 237 of file selector.h.


Member Enumeration Documentation

enum SelectorTool::BlobType
 

Enumerator:
NO_BLOBS 
BOUNDS_BLOBS 
ROTATE_BLOBS 

Definition at line 598 of file selector.h.

00599     {
00600         NO_BLOBS,               // use the fShowToolBlobs flag instead of this!
00601         BOUNDS_BLOBS,
00602         ROTATE_BLOBS
00603     };

enum SelectorTool::ClickActionCode [private]
 

Enumerator:
CLICKACTION_NONE 
CLICKACTION_BOUNDTOPLEFT 
CLICKACTION_BOUNDTOP 
CLICKACTION_BOUNDTOPRIGHT 
CLICKACTION_BOUNDLEFT 
CLICKACTION_BOUNDRIGHT 
CLICKACTION_BOUNDBOTTOMLEFT 
CLICKACTION_BOUNDBOTTOM 
CLICKACTION_BOUNDBOTTOMRIGHT 
CLICKACTION_BOUNDTRANSFORMORIGIN 
CLICKACTION_SELNONE 
CLICKACTION_SELNODE 
CLICKACTION_SELUNDER 
CLICKACTION_SELUNDERCYCLE 
CLICKACTION_SELUNDERFAIL 
CLICKACTION_SELUNDERFAIL2 
CLICKACTION_SELINSIDE 
CLICKACTION_SELINSIDECYCLE 
CLICKACTION_SELINSIDEFAIL 
CLICKACTION_SELINSIDEFAIL2 
CLICKACTION_SELLEAF 

Definition at line 419 of file selector.h.


Constructor & Destructor Documentation

SelectorTool::SelectorTool  ) 
 

Dummy Constructor - sets member pointers to NULL and initialises the record of which blobs are displayed (initially only "tiny" blobs).

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93
See also:
SelectorTool::Init

Definition at line 385 of file selector.cpp.

00386   : //pInfoBarOp(NULL),
00387     fRotateCentreIsValid(FALSE),
00388     eCurrentBlobs(BOUNDS_BLOBS),
00389     fShowToolBlobs(TRUE),
00390     fValidSelectedBlob(FALSE)
00391 {
00392     // initialise all our member pointers to NULL.
00393 
00394     SelectionSpread = NULL;
00395     SelectRange     = NULL;
00396     StartSpread     = NULL;
00397 
00398     pClickSimpleNode    = NULL;
00399     pClickCompoundNode  = NULL;
00400     pLastClickNode      = NULL;
00401     pPreProcClickNode   = NULL;
00402 
00403     pNormalCursor       = NULL;
00404     pAdjustCursor       = NULL;
00405     pUnderCursor        = NULL;
00406     pInsideCursor       = NULL;
00407     pUnderAdjustCursor  = NULL;
00408     pInsideAdjustCursor = NULL;
00409     pLeafCursor         = NULL;
00410     pLeafAdjustCursor   = NULL;
00411 
00412     pALLCursor          = NULL;
00413     pNWSECursor         = NULL;
00414     pNESWCursor         = NULL;
00415     pNSCursor           = NULL;
00416     pWECursor           = NULL;
00417     pGradFillCursor     = NULL;
00418     pDragRotateCursor   = NULL;
00419     pHorzGuideCursor    = NULL;
00420     pVertGuideCursor    = NULL;
00421 
00422     bGlineSAllowed      = TRUE;
00423     m_bComputeAreaDetails   = FALSE;
00424 
00425     // Pre-load the resource we're going to use
00426     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_6) );
00427     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_3) );
00428     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_1) );
00429     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_8) );
00430     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_45) );
00431     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_45) );
00432     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_27) );
00433     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_27) );
00434     (CamArtProvider::Get())->FindBitmap( _R(IDBMP_HANDLE_CENTRE) );
00435 }

SelectorTool::~SelectorTool  )  [virtual]
 

Destructor (Virtual). Does nothing.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/6/93

Definition at line 449 of file selector.cpp.

00450 {
00451     // empty
00452 }


Member Function Documentation

static void SelectorTool::AllowGuidelineScan BOOL  newVal = TRUE  )  [inline, static]
 

Definition at line 615 of file selector.h.

00615 { bGlineSAllowed = newVal; }

void SelectorTool::AllowIdleWork BOOL  fIsAllowed  )  [static]
 

Turns idle processing on or off. During idle events the selector tool updates the status bar, so if a drag operation, for instance, wants to place its own text in the status bar while it is running it should call this function at its start and at its end.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/10/94
Parameters:
fIsAllowed if TRUE then the tool will act on idle events, if FALSE [INPUTS] the tool will ignore idle events.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
SelectorTool::OnIdle

Definition at line 1095 of file selector.cpp.

01096 {
01097     // Make sure the selector is the current tool.
01098     ERROR3IF(Tool::GetCurrent() == NULL || Tool::GetCurrent()->GetID() != TOOLID_SELECTOR,
01099                 "Selector isn't current tool in SelectorTool::AllowIdleWork");
01100 
01101     if (Tool::GetCurrent() != NULL && Tool::GetCurrent()->GetID() == TOOLID_SELECTOR)
01102     {
01103         // Set the flag.
01104 #ifndef SELECTION_AREA_FEATURE
01105         ((SelectorTool*) Tool::GetCurrent())->fAllowIdleProcessing = fIsAllowed;
01106 #else
01107         ((SelectorTool*) Tool::GetCurrent())->fAllowIdleProcessing = fIsAllowed;
01108 //      ((SelectorTool*) Tool::GetCurrent())->fAllowIdleProcessing = (fIsAllowed || m_bComputeAreaDetails);
01109 #endif
01110     }
01111 // >>>>
01112 //((SelectorTool*) Tool::GetCurrent())->fAllowIdleProcessing = FALSE;
01113 }

BOOL SelectorTool::Append String_256 pStr,
ClickModifiers  cmods,
String_256  SelectTemplate,
String_256  AddTemplate,
String_256  RemoveTemplate,
NodeRenderableInk pActionNode = NULL
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/06/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1664 of file selector.cpp.

01670 {
01671     ERROR2IF(SelectTemplate.IsEmpty(),FALSE,"Asked to Append an empty message");
01672 
01673     // Append a message to the string, preceding it with a separator if there was something
01674     // already in the string...
01675     if (!pStr->IsEmpty())
01676         *pStr += String_256(_R(IDS_SEL_SEPARATOR));
01677 
01678     String_256 Message;
01679     String_256* pTemplate;
01680     Message.Empty();
01681 
01682     if (!cmods.Adjust || pActionNode==NULL)
01683         pTemplate = &SelectTemplate;
01684     else
01685     {
01686         if (!pActionNode->IsSelected())
01687             pTemplate = &AddTemplate;
01688         else
01689             pTemplate = &RemoveTemplate;
01690     }
01691 
01692     if (pTemplate->IsEmpty())
01693         pTemplate = &SelectTemplate;
01694 
01695     if (pActionNode==NULL)
01696         *pStr += *pTemplate;
01697     else
01698     {
01699         String_256 NodeDesc = pActionNode->Describe(FALSE);
01700         Message._MakeMsg( (TCHAR*) *pTemplate, &NodeDesc );
01701         *pStr += Message;
01702     }
01703 
01704     return TRUE;
01705 }

BOOL SelectorTool::Append String_256 pStr,
ClickModifiers  cmods,
UINT32  SelectID,
UINT32  AddID,
UINT32  RemoveID,
NodeRenderableInk pActionNode = NULL
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1544 of file selector.cpp.

01549 {
01550     ERROR2IF(SelectID==0,FALSE,"Asked to append a string resource with a null ID");
01551 
01552     // Append a message to the string, preceding it with a separator if there was something
01553     // already in the string...
01554     if (!pStr->IsEmpty())
01555         *pStr += String_256(_R(IDS_SEL_SEPARATOR));
01556 
01557     String_256 Message;
01558     UINT32 TemplateID = 0;
01559     Message.Empty();
01560 
01561     if (!cmods.Adjust || pActionNode==NULL)
01562         TemplateID = SelectID;
01563     else
01564     {
01565         if (!pActionNode->IsSelected())
01566             TemplateID = AddID;
01567         else
01568             TemplateID = RemoveID;
01569     }
01570 
01571     if (TemplateID==0)
01572         TemplateID = SelectID;
01573 
01574     if (pActionNode==NULL)
01575         *pStr += String_256(TemplateID);
01576     else
01577     {
01578         String_256 sTemplateID(TemplateID);
01579         String_256 NodeDesc = pActionNode->Describe(FALSE);
01580         Message._MakeMsg( (TCHAR*) sTemplateID, &NodeDesc);
01581         *pStr += Message;
01582     }
01583 
01584     return TRUE;
01585 }

BOOL SelectorTool::Append String_256 pStr,
String_256  String
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1632 of file selector.cpp.

01633 {
01634     // Append a message to the string, preceding it with a separator if there was something
01635     // already in the string...
01636     if (!pStr->IsEmpty())
01637         *pStr += String_256(_R(IDS_SEL_SEPARATOR));
01638     *pStr += String;
01639 
01640     return TRUE;
01641 }

BOOL SelectorTool::Append String_256 pStr,
UINT32  StringID
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
31/5/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

Definition at line 1604 of file selector.cpp.

01605 {
01606     // Append a message to the string, preceding it with a separator if there was something
01607     // already in the string...
01608     if (!pStr->IsEmpty())
01609         *pStr += String_256(_R(IDS_SEL_SEPARATOR));
01610     *pStr += String_256(StringID);
01611 
01612     return TRUE;
01613 }

virtual BOOL SelectorTool::AreToolBlobsRenderedOnSelection  )  [inline, virtual]
 

Reimplemented from Tool_v1.

Definition at line 279 of file selector.h.

00279 {return TRUE;}

void SelectorTool::AttributeHasChanged  ) 
 

Responds to an attribute-changing message by forcing the selection range to update its bounds, then forces a recalc and redraw of the tool's bounds blobs.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
29/6/95
See also:
SelectorTool::SelectionHasChanged; SelectorInfoBarOp::Message

Definition at line 4926 of file selector.cpp.

04927 {
04928     // If there's no SelRange then we're a bit stuck.
04929     if (SelectRange == NULL) return;
04930     
04931     // Make sure the SelRange has updated bounds.
04932     SelectRange->UpdateBounds();
04933 
04934     // Force a recalc and redraw of the bounds blobs.
04935     SelectionHasChanged();
04936 }

BOOL SelectorTool::BeyondFixedRange double  fpFixedVal  )  [static]
 

Checks for under/overflow in fixed-point calculations.

Author:
Justin_Flude (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/3/96
Parameters:
fpFixedVal the double that is to be converted to fixed-point [INPUTS]
Returns:
TRUE if the number is beyond the range that fixed-piont numbers can represent, FALSE if its OK to convert.

Reimplemented from DragTool.

Definition at line 5724 of file selector.cpp.

05725 {
05726     const double fpMinFixPt = 1.0 / (INT32(SHRT_MAX) + 1);      // 1/32768
05727     const double fpMaxFixPt = SHRT_MAX;                         // 32767
05728     double fp = fabs(fpFixedVal);
05729     return fp < fpMinFixPt || fp > fpMaxFixPt;
05730 }

INT32 SelectorTool::BoundsBlobHitTest