#include <slicetool.h>
Inheritance diagram for SliceTool:
Public Member Functions | |
SliceTool () | |
Default Constructor. Other initialisation is done in SliceTool::Init which is called by the Tool Manager. | |
virtual | ~SliceTool () |
Destructor (Virtual). Does nothing. | |
virtual BOOL | Init () |
Used to check if the Tool was properly constructed. | |
virtual void | Describe (void *InfoPtr) |
Allows the tool manager to extract information about the tool. | |
virtual UINT32 | GetID () |
void | ViewChanged (const DocViewMsg &msg) |
The SliceTool's view-changed message handler. This method is called directly from the message handler of SliceInfoBarOp, which lives further down in this file. Its sole purpose is to let us redraw our blobs correctly. | |
virtual void | RenderToolBlobs (Spread *pSpread, DocRect *pClipRect) |
Render the SliceTool's tool blob. This consists of a bounding rect identical to that used when dragging the selection (dotted, red line), around whatever is currently selected. | |
virtual BOOL | AreToolBlobsRenderedOnSelection () |
virtual void | SelectChange (BOOL isSelected) |
Starts up and closes down the Slice tool. | |
virtual void | OnClick (DocCoord, ClickType, ClickModifiers, Spread *) |
To handle a Mouse Click event for the Slice Tool. | |
virtual BOOL | OnKeyPress (KeyPress *pKey) |
key-press event handler. Catch CTRL/ALT/SHIFT modifiers and change the status-line/cursor appropriately. | |
virtual void | OnMouseMove (DocCoord PointerPos, Spread *pSpread, ClickModifiers ClickMods) |
To handle a Mouse Move event for the Slice Tool. | |
virtual BOOL | GetStatusLineText (String_256 *ptext, Spread *pSpread, DocCoord DocPos, ClickModifiers ClickMods) |
Figure out what the status text for the SliceTool is at the given position on the given spread with the given click modifiers. | |
virtual void | SelectionHasChanged () |
A public function, for other people to call whenever they need to let the Slice tool know that the selection has changed. | |
Static Public Member Functions | |
static SliceInfoBarOp * | GetSliceInfoBarOp () |
static BOOL | IsCurrentTool () |
Protected Types | |
enum | ClickActionCode { CLICKACTION_NONE, CLICKACTION_SELNONE, CLICKACTION_SELNODE, CLICKACTION_SELUNDER, CLICKACTION_SELUNDERCYCLE, CLICKACTION_SELUNDERFAIL, CLICKACTION_SELUNDERFAIL2, CLICKACTION_SELINSIDE, CLICKACTION_SELINSIDECYCLE, CLICKACTION_SELINSIDEFAIL, CLICKACTION_SELINSIDEFAIL2, CLICKACTION_SELLEAF } |
enum | SetSelectionState { NoSetsSelected, HalfSetsSelected, FullSetsSelected } |
Protected Member Functions | |
virtual BOOL | UpdateSelectionInfo () |
Updates the slice tool's record of the spread and bounding rectangle of the current selection. | |
virtual BOOL | PreProcessClick () |
Allows a click to be handled before going through the main click-handling code. This function checks for a clicked Node, and allows it to respond to the click. | |
virtual BOOL | ProcessObjectClick () |
In the selector tool, this function OnClick()'s each object in the tool's range if the Selector tool is using Object blobs. We don't, so we won't. | |
virtual void | PostProcessClick () |
Provided a click wasn't eaten by a pre- or mid- processor, we deal with it here. This passes the event on to specific handler routines, depending on its type (TypeOfClick):. | |
virtual NodeRenderableInk * | FindPreProcessClickNode (Spread *pSpread, DocCoord ClickPos, BOOL Interruptible=FALSE) |
virtual void | HandleSingleClick () |
Single mouse-click event handler. | |
virtual void | HandleDoubleClick () |
Double mouse-click event handler. Currently, passes the event to HandleSingleClick(). | |
virtual void | HandleDragClick () |
Mouse-drag event handler. | |
virtual void | HandleButtonUp () |
Mouse button-up event handler. | |
virtual void | HandleTabKey (BOOL bIsShifted) |
Tab keypress event handler. | |
virtual void | SetKeyDownCursor (ClickModifiers cmMods) |
Decodes the bit-field fKeyStates, indicating which combination of modifier keys are down, and sets the cursor appropriately. | |
virtual void | FigureUserFeedback (Spread *pSpread, DocCoord dcPos, ClickModifiers cmods, BOOL DoSlowTests, String_256 *pStr, Cursor **ppPointerShape) |
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) |
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. | |
void | DoTranslate () |
Runs a translation tranformation drag on the selection. | |
void | DoDragBox () |
Runs a selector-tool drag-box operation. | |
void | MakeSelectionValidForDrag () |
Runs through the selected nodes, making sure they are all happy with being dragged. Checks are:- 1. Sub-Selected text characters are deselected, and their parent story (and all other nodes sharing its name) are selected instead. | |
NodeRenderableInk * | FindFrom (NodeRenderableInk *pSimpleNode) const |
Front-end short-hand for NodeRenderableInk::FindCompoundFromSimple. | |
ClickActionCode | DetermineClickAction (NodeRenderableInk **ppActionNode, NodeRenderableInk *pLastClickNode, NodeRenderableInk *pClickSimpleNode, NodeRenderableInk *pClickCompoundNode, Spread *pStartSpread, DocCoord ClickStart, ClickModifiers ClickMods) |
Determine what action needs to be taken in response to a click. | |
ClickActionCode | CycleClickAction (NodeRenderableInk **ppActionNode, NodeRenderableInk *pClickCompoundNode, ClickActionCode foundAction, ClickActionCode cycleAction) |
Determine what action needs to be taken in response 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. | |
virtual BOOL | DragFinished (DragEndType det) |
Called by TransOperation when a drag is finished. Allows the SliceTool to reset its cursors and update its current selection information. | |
Static Protected Member Functions | |
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. | |
Protected Attributes | |
Cursor * | pcNormalSliceCursor |
Cursor * | pcAdjustCursor |
Cursor * | pcUnderCursor |
Cursor * | pcInsideCursor |
Cursor * | pcUnderAdjustCursor |
Cursor * | pcInsideAdjustCursor |
Cursor * | pcLeafCursor |
Cursor * | pcLeafAdjustCursor |
Cursor * | pcALLCursor |
Cursor * | pcHorzGuideCursor |
Cursor * | pcVertGuideCursor |
DocCoord | ClickStart |
Spread * | StartSpread |
ClickModifiers | ClickMods |
ClickType | TypeOfClick |
Spread * | SelectionSpread |
SelRange * | SelectRange |
DocRect | SelectionRect |
BOOL | m_bSliceToolSetSel |
DocRect | m_drBlobRect |
NodeRenderableInk * | pClickSimpleNode |
NodeRenderableInk * | pClickCompoundNode |
NodeRenderableInk * | pLastClickNode |
NodeRenderableInk * | pPreProcClickNode |
enum SetSelectionState | m_SetSelectionState |
TransformBoundingData | BoundingData |
Private Member Functions | |
CC_DECLARE_MEMDUMP (SliceTool) | |
void | DisplayStatusBarHelp (DocCoord DocPos, Spread *pSpread, ClickModifiers ClickMods) |
Displays status help string for the given position in the status bar. | |
void | GetCurrentStatusText (String_256 *ptext, Spread *pSpread, DocCoord DocPos, ClickModifiers ClickMods) |
Selects a suitable string for the status line based on the current location (as input via the parameters). | |
BOOL | CreateCursors () |
Creates all the Slice tool cursors. | |
void | DestroyCursors () |
Destroys all the Slice tool cursors. | |
Private Attributes | |
Cursor * | pcCurrentCursor |
INT32 | CurrentCursorID |
BOOL | m_fIgnoreSelChange |
Static Private Attributes | |
static BOOL | CurrentTool = FALSE |
static SliceInfoBarOp * | pSliceInfoBarOp = NULL |
static char * | FamilyName = "Slice Tools" |
static char * | ToolName = "Slice Tool" |
static char * | Purpose = "Slice manipulation" |
static char * | Author = "Simon K" |
Friends | |
class | OpSliceDragBox |
class | OpSliceTranslate |
Definition at line 132 of file slicetool.h.
|
Definition at line 291 of file slicetool.h. 00291 { 00292 CLICKACTION_NONE, 00293 CLICKACTION_SELNONE, 00294 CLICKACTION_SELNODE, 00295 CLICKACTION_SELUNDER, 00296 CLICKACTION_SELUNDERCYCLE, 00297 CLICKACTION_SELUNDERFAIL, 00298 CLICKACTION_SELUNDERFAIL2, 00299 CLICKACTION_SELINSIDE, 00300 CLICKACTION_SELINSIDECYCLE, 00301 CLICKACTION_SELINSIDEFAIL, 00302 CLICKACTION_SELINSIDEFAIL2, 00303 CLICKACTION_SELLEAF 00304 };
|
|
Definition at line 307 of file slicetool.h. 00308 { 00309 NoSetsSelected, 00310 HalfSetsSelected, 00311 FullSetsSelected 00312 };
|
|
Default Constructor. Other initialisation is done in SliceTool::Init which is called by the Tool Manager.
Definition at line 202 of file slicetool.cpp. 00203 { 00204 // initialise all our member pointers to NULL. 00205 00206 pcNormalSliceCursor = NULL; 00207 pcAdjustCursor = NULL; 00208 pcUnderCursor = NULL; 00209 pcInsideCursor = NULL; 00210 pcUnderAdjustCursor = NULL; 00211 pcInsideAdjustCursor = NULL; 00212 pcLeafCursor = NULL; 00213 pcLeafAdjustCursor = NULL; 00214 00215 pcCurrentCursor = NULL; 00216 pcALLCursor = NULL; 00217 pcHorzGuideCursor = NULL; 00218 pcVertGuideCursor = NULL; 00219 00220 StartSpread = NULL; 00221 SelectionSpread = NULL; 00222 SelectRange = NULL; 00223 00224 pClickSimpleNode = NULL; 00225 pClickCompoundNode = NULL; 00226 pLastClickNode = NULL; 00227 pPreProcClickNode = NULL; 00228 }
|
|
Destructor (Virtual). Does nothing.
Definition at line 240 of file slicetool.cpp.
|
|
Definition at line 2404 of file slicetool.cpp. 02410 { 02411 ERROR2IF(SelectTemplate.IsEmpty(), FALSE, "Asked to Append an empty message"); 02412 02413 // Append a message to the string, preceding it with a separator if there was something 02414 // already in the string... 02415 if (!pStr->IsEmpty()) 02416 *pStr += String_256(_R(IDS_SLICE_SEPARATOR)); 02417 02418 String_256 Message; 02419 String_256* pTemplate; 02420 Message.Empty(); 02421 02422 if (!cmods.Adjust || pActionNode==NULL) 02423 pTemplate = &SelectTemplate; 02424 else 02425 { 02426 if (!pActionNode->IsSelected()) 02427 pTemplate = &AddTemplate; 02428 else 02429 pTemplate = &RemoveTemplate; 02430 } 02431 02432 if (pTemplate->IsEmpty()) 02433 pTemplate = &SelectTemplate; 02434 02435 if (pActionNode==NULL) 02436 *pStr += *pTemplate; 02437 else 02438 { 02439 Message._MakeMsg( (TCHAR*) *pTemplate, &pActionNode->Describe(FALSE) ); 02440 *pStr += Message; 02441 } 02442 02443 return TRUE; 02444 }
|
|
Definition at line 2286 of file slicetool.cpp. 02291 { 02292 ERROR2IF(SelectID==0, FALSE, "Asked to append a string resource with a null ID"); 02293 02294 // Append a message to the string, preceding it with a separator if there was something 02295 // already in the string... 02296 if (!pStr->IsEmpty()) 02297 *pStr += String_256(_R(IDS_SLICE_SEPARATOR)); 02298 02299 String_256 Message; 02300 UINT32 TemplateID = 0; 02301 Message.Empty(); 02302 02303 if (!cmods.Adjust || pActionNode==NULL) 02304 TemplateID = SelectID; 02305 else 02306 { 02307 if (!pActionNode->IsSelected()) 02308 TemplateID = AddID; 02309 else 02310 TemplateID = RemoveID; 02311 } 02312 02313 if (TemplateID==0) 02314 TemplateID = SelectID; 02315 02316 if (pActionNode==NULL) 02317 *pStr += String_256(TemplateID); 02318 else 02319 { 02320 Message._MakeMsg( (TCHAR*) String_256(TemplateID), &pActionNode->Describe(FALSE) ); 02321 *pStr += Message; 02322 } 02323 02324 return TRUE; 02325 }
|
|
Definition at line 2372 of file slicetool.cpp. 02373 { 02374 // Append a message to the string, preceding it with a separator if there was something 02375 // already in the string... 02376 if (!pStr->IsEmpty()) 02377 *pStr += String_256(_R(IDS_SLICE_SEPARATOR)); 02378 *pStr += String; 02379 02380 return TRUE; 02381 }
|
|
Definition at line 2344 of file slicetool.cpp. 02345 { 02346 // Append a message to the string, preceding it with a separator if there was something 02347 // already in the string... 02348 if (!pStr->IsEmpty()) 02349 *pStr += String_256(_R(IDS_SLICE_SEPARATOR)); 02350 *pStr += String_256(StringID); 02351 02352 return TRUE; 02353 }
|
|
Reimplemented from Tool_v1. Definition at line 156 of file slicetool.h. 00156 { return TRUE; }
|
|
|
|
Creates all the Slice tool cursors.
Definition at line 542 of file slicetool.cpp. 00543 { 00544 // This tool has just been selected. Create its cursors. 00545 pcNormalSliceCursor = new Cursor(this, _R(IDC_POINTER_SLICE)); 00546 pcAdjustCursor = new Cursor(this, _R(IDC_POINTER_SLICE_ADJUST)); 00547 pcUnderCursor = new Cursor(this, _R(IDC_POINTER_SLICE_UNDER)); 00548 pcInsideCursor = new Cursor(this, _R(IDC_POINTER_SLICE_INSIDE)); 00549 pcUnderAdjustCursor = new Cursor(this, _R(IDC_POINTER_SLICE_UNDERADJUST)); 00550 pcInsideAdjustCursor= new Cursor(this, _R(IDC_POINTER_SLICE_INSIDEADJUST)); 00551 pcALLCursor = new Cursor(this, _R(IDCSR_SEL_GRADPOINT)); 00552 pcLeafCursor = new Cursor(this, _R(IDC_POINTER_SLICE_LEAF)); 00553 pcLeafAdjustCursor = new Cursor(this, _R(IDC_POINTER_SLICE_LEAFADJUST)); 00554 pcHorzGuideCursor = new Cursor(this, _R(IDCSR_SEL_HGUIDE)); 00555 pcVertGuideCursor = new Cursor(this, _R(IDCSR_SEL_VGUIDE)); 00556 00557 // now check them... 00558 BOOL ok = (pcNormalSliceCursor != NULL && pcNormalSliceCursor->IsValid()); 00559 if (ok) ok = (pcAdjustCursor != NULL && pcAdjustCursor->IsValid()); 00560 if (ok) ok = (pcUnderCursor != NULL && pcUnderCursor->IsValid()); 00561 if (ok) ok = (pcInsideCursor != NULL && pcInsideCursor->IsValid()); 00562 if (ok) ok = (pcUnderAdjustCursor != NULL && pcUnderAdjustCursor->IsValid()); 00563 if (ok) ok = (pcInsideAdjustCursor != NULL && pcInsideAdjustCursor->IsValid()); 00564 if (ok) ok = (pcALLCursor != NULL && pcALLCursor->IsValid()); 00565 if (ok) ok = (pcLeafCursor != NULL && pcLeafCursor->IsValid()); 00566 if (ok) ok = (pcLeafAdjustCursor != NULL && pcLeafAdjustCursor->IsValid()); 00567 if (ok) ok = (pcHorzGuideCursor != NULL && pcHorzGuideCursor->IsValid()); 00568 if (ok) ok = (pcVertGuideCursor != NULL && pcVertGuideCursor->IsValid()); 00569 if (!ok) 00570 DestroyCursors(); 00571 00572 return ok; 00573 }
|
|
Determine what action needs to be taken in response to a click.
Definition at line 2055 of file slicetool.cpp. 02059 { 02060 // If we have found a node then return the specified action code... 02061 if (*ppActionNode) 02062 { 02063 return foundAction; 02064 } 02065 // Else no suitable node so see whether the click occurred over a compound node 02066 else 02067 { 02068 // If click occurred over a compound node then we can return that 02069 // along with the alternative action code... 02070 if (pClickCompoundNode) 02071 { 02072 *ppActionNode = pClickCompoundNode; 02073 return cycleAction; 02074 } 02075 else 02076 // Else if there wasn't even a compound node we must return the information that 02077 // the click occurred over white space... 02078 { 02079 *ppActionNode = NULL; 02080 return CLICKACTION_SELNONE; 02081 } 02082 } 02083 }
|
|
Allows the tool manager to extract information about the tool.
Reimplemented from Tool_v1. Definition at line 318 of file slicetool.cpp. 00319 { 00320 // Cast structure into the latest one we understand. 00321 ToolInfo_v1 *Info = (ToolInfo_v1 *) InfoPtr; 00322 00323 Info->InfoVersion = 1; 00324 00325 Info->InterfaceVersion = GetToolInterfaceVersion(); // You should always have this line. 00326 00327 // These are all arbitrary at present. 00328 Info->Version = 1; 00329 Info->ID = GetID(); 00330 Info->TextID = _R(IDS_SLICE_TOOL); 00331 00332 Info->Family = FamilyName; 00333 Info->Name = ToolName; 00334 Info->Purpose = Purpose; 00335 Info->Author = Author; 00336 00337 Info->BubbleID = _R(IDBBL_SLICE_TOOLBOX); 00338 }
|
|
Destroys all the Slice tool cursors.
Definition at line 589 of file slicetool.cpp. 00590 { 00591 if (pcNormalSliceCursor != NULL) delete pcNormalSliceCursor; 00592 if (pcAdjustCursor != NULL) delete pcAdjustCursor; 00593 if (pcUnderCursor != NULL) delete pcUnderCursor; 00594 if (pcInsideCursor != NULL) delete pcInsideCursor; 00595 if (pcUnderAdjustCursor != NULL) delete pcUnderAdjustCursor; 00596 if (pcInsideAdjustCursor != NULL) delete pcInsideAdjustCursor; 00597 if (pcALLCursor != NULL) delete pcALLCursor; 00598 if (pcLeafCursor != NULL) delete pcLeafCursor; 00599 if (pcLeafAdjustCursor != NULL) delete pcLeafAdjustCursor; 00600 if (pcHorzGuideCursor != NULL) delete pcHorzGuideCursor; 00601 if (pcVertGuideCursor != NULL) delete pcVertGuideCursor; 00602 }
|
|
Determine what action needs to be taken in response to a click.
Definition at line 1870 of file slicetool.cpp. 01877 { 01878 *ppActionNode = NULL; 01879 01880 //-------------------------------------- 01881 // Test "leaf" modifier... 01882 if (IsSelectLeafClick(ClickMods)) 01883 { 01884 // Go directly to leaf nodes! 01885 if (pClickSimpleNode != pClickCompoundNode) 01886 { 01887 *ppActionNode = pClickSimpleNode; 01888 01889 // <<<<< Inclusion by Mike 11/01/96 01890 // this stuff is to check whether any parent is responding to 01891 // AllowSelectInside() and returning FALSE. Selections will not go down 01892 // into these objects if so. 01893 01894 Node* pParentNode = pClickSimpleNode->FindParent(); 01895 while (pParentNode) 01896 { 01897 if (pParentNode->IsKindOf(CC_RUNTIME_CLASS(Layer))) 01898 break; 01899 if (pParentNode->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk))) 01900 { 01901 if ( (!pParentNode->AllowSelectInside()) && 01902 ((NodeRenderableInk*)pParentNode)->CanSelectAsCompoundParent() 01903 ) 01904 { 01905 *ppActionNode = (NodeRenderableInk*)(pParentNode); 01906 } 01907 } 01908 if (pParentNode==pClickCompoundNode) 01909 break; 01910 pParentNode = pParentNode->FindParent(); 01911 } 01912 01913 // <<<<< End of inclusion 01914 } 01915 01916 // If we still haven't found what we're looking for 01917 // Cycle round to the top again... 01918 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELLEAF,CLICKACTION_SELNODE); 01919 } 01920 01921 //-------------------------------------- 01922 // Test "under" modifier... 01923 if (IsSelectUnderClick(ClickMods)) 01924 { 01925 // Try to perform a select under 01926 // First check that the context node is still under the pointer 01927 // If not then all we can do is a normal click operation... 01928 if (!ValidateLastClickUnder(pLastClickNode,pStartSpread,ClickStart)) 01929 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELUNDERFAIL2,CLICKACTION_SELUNDERFAIL2); 01930 01931 // Find the leaf node at the click position, but only search nodes 01932 // before the last clicked node. 01933 *ppActionNode = NodeRenderableInk::FindSimpleAtPoint(pStartSpread,ClickStart,pLastClickNode); 01934 // Then find a compound node containing the leaf, preferably a sibling 01935 // of the last clicked node. 01936 *ppActionNode = NodeRenderableInk::FindCompoundFromSimple(*ppActionNode,pLastClickNode); 01937 01938 // If the "under" node turns out to be the node we started from 01939 // return a failure code but go ahead and re-select it... 01940 // (If we failed to find anything under the last node, and the last node is the top node) 01941 if (*ppActionNode==NULL && pLastClickNode == pClickCompoundNode) 01942 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELUNDERFAIL,CLICKACTION_SELUNDERFAIL); 01943 01944 // If we still haven't found what we're looking for 01945 // Cycle round to the top again... 01946 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELUNDER,CLICKACTION_SELUNDERCYCLE); 01947 } 01948 01949 //-------------------------------------- 01950 // Test "member" modifier... 01951 if (IsSelectMemberClick(ClickMods)) 01952 { 01953 // See if the clicked simple node is a descendent of the last clicked node 01954 if (!ValidateLastClickInside(pLastClickNode,pClickSimpleNode)) 01955 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELINSIDEFAIL2,CLICKACTION_SELINSIDEFAIL2); 01956 01957 // If the node we're going to look inside is not compound and it's the top node 01958 // return a failure code but go ahead and re-select it... 01959 if (pLastClickNode && !pLastClickNode->IsCompound() && pLastClickNode == pClickCompoundNode) 01960 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELINSIDEFAIL,CLICKACTION_SELINSIDEFAIL); 01961 01962 // Try to perform a select inside 01963 *ppActionNode = NodeRenderableInk::FindInnerCompound(pClickSimpleNode,pLastClickNode); 01964 01965 // If we still haven't found what we're looking for 01966 // Cycle round to the top again... 01967 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_SELINSIDE,CLICKACTION_SELINSIDECYCLE); 01968 } 01969 01970 //-------------------------------------- 01971 // OK, so no modifiers are currently down 01972 // Just try to do a normal click action... 01973 return CycleClickAction(ppActionNode,pClickCompoundNode,CLICKACTION_NONE,CLICKACTION_SELNODE); 01974 }
|
|
Displays status help string for the given position in the status bar.
Definition at line 1485 of file slicetool.cpp. 01486 { 01487 String_256 StatusMsg(""); 01488 01489 // Get a string from the underlying help function and display it. 01490 GetCurrentStatusText(&StatusMsg, pSpread, DocPos, ClickMods); 01491 GetApplication()->UpdateStatusBarText(&StatusMsg); 01492 }
|
|
Runs a selector-tool drag-box operation.
Definition at line 1454 of file slicetool.cpp. 01455 { 01456 OpSliceDragBox* pOpDragBox = new OpSliceDragBox(); 01457 if (pOpDragBox == NULL) 01458 { 01459 InformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK)); 01460 } 01461 else 01462 { 01463 pOpDragBox->StartDragBox(StartSpread, ClickStart, ClickMods); 01464 } 01465 }
|
|
Runs a translation tranformation drag on the selection.
Definition at line 1393 of file slicetool.cpp. 01394 { 01395 // set appropriate transform parameters... 01396 TransformData tdParams; 01397 tdParams.CentreOfTrans = ClickStart; 01398 tdParams.LeaveCopy = FALSE; 01399 tdParams.LockAspect = TRUE; 01400 tdParams.pRange = NULL; 01401 tdParams.ScaleLines = FALSE; 01402 tdParams.StartBlob = 0; 01403 tdParams.TransFills = TRUE; 01404 01405 // set drag pointer shape. 01406 if (CurrentCursorID != CURSORID_UNSET) 01407 CursorStack::GSetTop(pcALLCursor, CurrentCursorID); 01408 01409 // attempt to create a translate op. 01410 OpSliceTranslate* pSliceTransOp = new OpSliceTranslate(); 01411 if (pSliceTransOp == NULL) 01412 { 01413 InformError(_R(IDS_OUT_OF_MEMORY), _R(IDS_OK)); 01414 return; 01415 } 01416 01417 // Get the current DocView (there must be one or we wouldn't be here). 01418 DocView* pDocView = DocView::GetCurrent(); 01419 ERROR3IF(pDocView == NULL, "SliceTool::DoTranslate- Null current DocView"); 01420 01421 DocCoord dcOffset(0, 0); // Default to offsets of 0 01422 01423 // Fill a Transform Bounding Data structure up here 01424 BoundingData.x = SelectionRect.lo.x; 01425 BoundingData.y = SelectionRect.lo.y; 01426 BoundingData.Width = SelectionRect.Width(); 01427 BoundingData.Height = SelectionRect.Height(); 01428 BoundingData.XScale = (FIXED16) 1; 01429 BoundingData.YScale = (FIXED16) 1; 01430 BoundingData.Rotation = (ANGLE) 0; 01431 BoundingData.Shear = (ANGLE) 0; 01432 01433 // Run the transformation drag operation and return success code. 01434 pSliceTransOp->DragStarted(&tdParams, this, &BoundingData, ClickStart, 01435 StartSpread, ClickMods, dcOffset, NULL, DRAGTYPE_AUTOSCROLL); 01436 }
|
|
Called by TransOperation when a drag is finished. Allows the SliceTool to reset its cursors and update its current selection information.
Reimplemented from Tool_v1. Definition at line 2614 of file slicetool.cpp. 02615 { 02616 // update the current cursor. 02617 SetKeyDownCursor(ClickModifiers::GetClickModifiers()); 02618 02619 // we always leave cancelling the drag to a capricious user. 02620 return TRUE; 02621 }
|
|
Definition at line 1587 of file slicetool.cpp. 01593 { 01594 // Initialise the status text string and pointer shape to be "null". 01595 pStr->Empty(); 01596 *ppPointerShape = pcNormalSliceCursor; 01597 01598 if (Tool::GetCurrentID() != TOOLID_SLICETOOL) 01599 return; 01600 01601 BOOL DescribeDrag = TRUE; 01602 01603 //------------------------------------------------------------------------- 01604 // Set the pointer shape, according to the key modifiers and/or the current state. 01605 if (!cmods.Adjust && !cmods.Constrain && !cmods.Alternative1) 01606 { 01607 *ppPointerShape = pcNormalSliceCursor; 01608 Append(pStr,_R(IDS_SLICE_MODE0)); // "Normal select mode:" 01609 } 01610 01611 else if (cmods.Adjust && !cmods.Constrain && !cmods.Alternative1) 01612 { 01613 *ppPointerShape = pcAdjustCursor; 01614 Append(pStr,_R(IDS_SLICE_MODE1)); // "Adjust select:" 01615 } 01616 01617 else if (!cmods.Adjust && IsSelectUnderClick(cmods)) 01618 { 01619 *ppPointerShape = pcUnderCursor; 01620 Append(pStr,_R(IDS_SLICE_MODE2)); // "Select under:" 01621 } 01622 01623 else if (cmods.Adjust && IsSelectUnderClick(cmods)) 01624 { 01625 *ppPointerShape = pcUnderAdjustCursor; 01626 Append(pStr,_R(IDS_SLICE_MODE3)); // "Adjust select under:" 01627 } 01628 01629 else if (!cmods.Adjust && IsSelectMemberClick(cmods)) 01630 { 01631 *ppPointerShape = pcInsideCursor; 01632 Append(pStr,_R(IDS_SLICE_MODE4)); // "Force drag/Select member:" 01633 } 01634 01635 else if (cmods.Adjust && IsSelectMemberClick(cmods)) 01636 { 01637 *ppPointerShape = pcInsideAdjustCursor; 01638 Append(pStr,_R(IDS_SLICE_MODE5)); // "Force drag/Adjust select member:" 01639 } 01640 01641 else if (!cmods.Adjust && IsSelectLeafClick(cmods)) 01642 { 01643 *ppPointerShape = pcLeafCursor; 01644 Append(pStr,_R(IDS_SLICE_MODE6)); // "Select inside:" 01645 } 01646 01647 else if (cmods.Adjust && IsSelectLeafClick(cmods)) 01648 { 01649 *ppPointerShape = pcLeafAdjustCursor; 01650 Append(pStr,_R(IDS_SLICE_MODE7)); // "Adjust select inside:" 01651 } 01652 01653 else 01654 { 01655 ERROR3("SliceTool::FigureUserFeedback- out of range ClickModifiers"); 01656 return; 01657 } 01658 01659 // Check for direct drag mode and say something about it... 01660 if (IsTranslateShortcut(cmods)) 01661 { 01662 if (SelectRange->FindFirst()) 01663 { 01664 *ppPointerShape = pcALLCursor; 01665 Append(pStr,_R(IDS_SLICEINSIDE4)); // "Drag to move the selected objects" 01666 } 01667 DescribeDrag = FALSE; 01668 } 01669 01670 // See if there's a non-selectable object (guideline) under the mouse 01671 NodeRenderableInk* pPreProNode = FindPreProcessClickNode(pSpread,dcPos,TRUE); 01672 if (pPreProNode) 01673 { 01674 if (IS_A(pPreProNode,NodeGuideline)) 01675 { 01676 NodeGuideline* pGuideline = (NodeGuideline*)pPreProNode; 01677 if (pGuideline->GetType()==GUIDELINE_HORZ) 01678 { 01679 *ppPointerShape = pcHorzGuideCursor; 01680 // "Drag up or down to move guideline; Drag onto top ruler to delete it" 01681 Append(pStr,_R(IDS_SLICEHORZGUIDE)); 01682 return; 01683 } 01684 01685 if (pGuideline->GetType()==GUIDELINE_VERT) 01686 { 01687 *ppPointerShape = pcVertGuideCursor; 01688 // "Drag left or right to move guideline; Drag onto left ruler to delete it" 01689 Append(pStr,_R(IDS_SLICEVERTGUIDE)); 01690 return; 01691 } 01692 } 01693 } 01694 01695 //------------------------------------------------------------------------- 01696 // If we've got time to do the slow tests then go ahead and do them... 01697 if (DoSlowTests) 01698 { 01699 // Perform a hit-test at the mouse position and set the status bar text 01700 // accordingly. 01701 // Allow the hit-test to be interrupted if the mouse moves! 01702 Node* pInterruptedNode = NULL; 01703 NodeRenderableInk* pSimple = NodeRenderableInk::FindSimpleAtPoint(pSpread, 01704 dcPos, 01705 NULL, 01706 &pInterruptedNode); 01707 // If hit-test was interrupted then don't say anything about what's under the pointer! 01708 if (pInterruptedNode!=NULL) 01709 return; 01710 01711 NodeRenderableInk* pCompound = NodeRenderableInk::FindCompoundFromSimple(pSimple); 01712 01713 // if we changed the selection last, or the SelRange cannot provide a usable 01714 // last-selection then use our own record. otherwise, ask the SelRange. 01715 Node* pLastSelNode = NULL; 01716 if (m_bSliceToolSetSel && pLastClickNode != NULL) 01717 { 01718 pLastSelNode = pLastClickNode; 01719 } 01720 else 01721 { 01722 pLastSelNode = SelectRange->GetLastSelectedNode(); 01723 if ( pLastSelNode==NULL || !(pLastSelNode->IsKindOf(CC_RUNTIME_CLASS(NodeRenderableInk))) ) 01724 pLastSelNode = pLastClickNode; 01725 } 01726 01727 // Find out what we should do with the click... 01728 ClickActionCode action = CLICKACTION_NONE; 01729 NodeRenderableInk* pActionNode = NULL; 01730 action = DetermineClickAction(&pActionNode,(NodeRenderableInk*)pLastSelNode, 01731 pSimple,pCompound,pSpread,dcPos,cmods); 01732 01733 // Act upon the information... 01734 switch (action) 01735 { 01736 //-------------------------------------------------// 01737 // No action required... 01738 case CLICKACTION_NONE: 01739 break; 01740 01741 //-------------------------------------------------// 01742 // Anything that's selected must be deselected... 01743 case CLICKACTION_SELNONE: 01744 if (!cmods.Adjust) 01745 { 01746 // If there are selected objects append message about clearing. 01747 if (SelectRange && SelectRange->FindFirst()) 01748 Append(pStr,_R(IDS_SLICENONE1)); // "Click to clear the selection" 01749 // Message about marquee drag 01750 if (DescribeDrag) 01751 Append(pStr,_R(IDS_SLICENONE4)); // "Drag to marquee select objects" 01752 Append(pStr,_R(IDS_SLICENONE2)); // "Move pointer over object to select" 01753 } 01754 else 01755 { 01756 // Adjust is held down so describe marquee add. 01757 if (DescribeDrag) 01758 // "Drag to marquee select objects to add to selection" 01759 Append(pStr,_R(IDS_SLICENONE5)); 01760 // "Move pointer over object to add/remove from selection" 01761 Append(pStr,_R(IDS_SLICENONE3)); 01762 } 01763 break; 01764 01765 //-------------------------------------------------// 01766 // The action node must be selected... 01767 case CLICKACTION_SELNODE: 01768 Append(pStr,cmods, 01769 _R(IDS_SLICENODE3), // "Click to select this #1%S alone; Drag to move it" 01770 _R(IDS_SLICENODE4), // "Click to select this #1%S" 01771 _R(IDS_SLICENODE5), // "Click to deselect this #1%S" 01772 pActionNode); 01773 break; 01774 case CLICKACTION_SELUNDER: 01775 Append(pStr,cmods, 01776 _R(IDS_SLICEUNDER1), // "Click to select the #1%S under the last selected object alone" 01777 _R(IDS_SLICEUNDER2), // "Click to select the #1%S under the last selected object" 01778 _R(IDS_SLICEUNDER3), // "Click to deselect the #1%S under the last selected object" 01779 pActionNode); 01780 break; 01781 case CLICKACTION_SELUNDERCYCLE: 01782 Append(pStr,cmods, 01783 _R(IDS_SLICEUNDERCYCLE1), // "Click to select the top #1%S alone; (Reached the bottom)" 01784 _R(IDS_SLICEUNDERCYCLE2), // "Click to select the top #1%S; (Reached the bottom)" 01785 _R(IDS_SLICEUNDERCYCLE3), // "Click to deselect the top #1%S; (Reached the bottom)" 01786 pActionNode); 01787 break; 01788 case CLICKACTION_SELUNDERFAIL: 01789 Append(pStr,cmods, 01790 _R(IDS_SLICEUNDERFAIL1), // "Click to select the #1%S alone; (Nothing under the last selected object)" 01791 _R(IDS_SLICEUNDERFAIL2), // "Click to select the #1%S; (Nothing under the last selected object)" 01792 _R(IDS_SLICEUNDERFAIL3), // "Click to deselect the #1%S; (Nothing under the last selected object)" 01793 pActionNode); 01794 break; 01795 case CLICKACTION_SELUNDERFAIL2: 01796 Append(pStr,cmods, 01797 _R(IDS_SLICEUNDERFAIL21), // "Click to select the #1%S alone; (The last selected object is not under the pointer)" 01798 _R(IDS_SLICEUNDERFAIL22), // "Click to select the #1%S; (The last selected object is not under the pointer)" 01799 _R(IDS_SLICEUNDERFAIL23), // "Click to deselect the #1%S; (The last selected object is not under the pointer)" 01800 pActionNode); 01801 break; 01802 case CLICKACTION_SELINSIDE: 01803 Append(pStr,cmods, 01804 _R(IDS_SLICEINSIDE1), // "Click to select the #1%S member of the last selected object alone" 01805 _R(IDS_SLICEINSIDE2), // "Click to select the #1%S member of the last selected object" 01806 _R(IDS_SLICEINSIDE3), // "Click to deselect the #1%S member of the last selected object" 01807 pActionNode); 01808 break; 01809 case CLICKACTION_SELINSIDECYCLE: 01810 Append(pStr,cmods, 01811 _R(IDS_SLICEINSIDECYCLE1), // "Click to select the top #1%S alone; (Reached the simplest object)" 01812 _R(IDS_SLICEINSIDECYCLE2), // "Click to select the top #1%S; (Reached the simplest object)" 01813 _R(IDS_SLICEINSIDECYCLE3), // "Click to deselect the top #1%S; (Reached the simplest object)" 01814 pActionNode); 01815 break; 01816 case CLICKACTION_SELINSIDEFAIL: 01817 Append(pStr, _R(IDS_SLICEINSIDEFAIL1)); // "Nothing inside this object" 01818 break; 01819 case CLICKACTION_SELINSIDEFAIL2: 01820 Append(pStr,cmods, 01821 _R(IDS_SLICEINSIDEFAIL21), // "Click to select the #1%S alone; (The pointer is not over a member of the last selected object)" 01822 _R(IDS_SLICEINSIDEFAIL22), // "Click to select the #1%S; (The pointer is not over a member of the last selected object)" 01823 _R(IDS_SLICEINSIDEFAIL23), // "Click to deselect the #1%S; (The pointer is not over a member of the last selected object)" 01824 pActionNode); 01825 break; 01826 case CLICKACTION_SELLEAF: 01827 Append(pStr,cmods, 01828 _R(IDS_SLICELEAF1), // "Click to select this #1%S alone" 01829 _R(IDS_SLICELEAF2), // "Click to select this #1%S" 01830 _R(IDS_SLICELEAF3), // "Click to deselect this #1%S" 01831 pActionNode); 01832 break; 01833 //-------------------------------------------------// 01834 default: 01835 ERROR3("Unknown Click action code!"); 01836 break; 01837 }; 01838 01839 // If we're in normal click mode (no modifiers down) then remind the user 01840 // that they can use the modifer keys... 01841 if (!cmods.Adjust && !cmods.Constrain && !cmods.Alternative1) 01842 Append(pStr,_R(IDS_SELOPTIONS)); 01843 } 01844 }
|
|
Front-end short-hand for NodeRenderableInk::FindCompoundFromSimple.
Definition at line 2265 of file slicetool.cpp. 02266 { 02267 return NodeRenderableInk::FindCompoundFromSimple(pSimpleNode); 02268 }
|
|
Currently, only looks for NodeGuidelines.
Definition at line 720 of file slicetool.cpp. 00723 { 00724 ERROR2IF(pSpread == NULL, NULL, "SliceTool::FindPreProcessClickNode- pSpread is NULL"); 00725 00726 // initialise vars. 00727 NodeRenderableInk* pFoundNode = NULL; 00728 BOOL bFound = FALSE; 00729 00730 // look for a visible, editable guides layer. 00731 Layer* pLayer = pSpread->FindFirstLayer(); 00732 while (pLayer != NULL && !bFound) 00733 { 00734 if (pLayer->IsGuide() && !pLayer->IsLocked() && pLayer->IsVisible()) 00735 { 00736 // We have a layer that's also a guide layer 00737 // Now look for the guidelines in this layer 00738 Node* pNodeInLayer = pLayer->FindFirstChild(CC_RUNTIME_CLASS(NodeGuideline)); 00739 while (pNodeInLayer != NULL && !bFound) 00740 { 00741 pFoundNode = (NodeGuideline*)pNodeInLayer; 00742 00743 // found a node - now hit-test its bounds. 00744 DocRect Rect = pFoundNode->GetBoundingRect(FALSE,TRUE); 00745 bFound = (Rect.ContainsCoord(ClickPos)); 00746 00747 pNodeInLayer = pNodeInLayer->FindNext(CC_RUNTIME_CLASS(NodeGuideline)); 00748 } 00749 } 00750 00751 pLayer = pLayer->FindNextLayer(); 00752 } 00753 00754 if (bFound) 00755 { 00756 // OK, we have found a node interested in a preprocess click 00757 // We now have to ensure that it's not being obscured visually by another node 00758 NodeRenderableInk* pNode = NULL; 00759 if (bInterruptible) 00760 { 00761 // Allow the hit-test to be interrupted if the mouse moves! 00762 Node* pInterruptedNode = NULL; 00763 pNode = NodeRenderableInk::FindSimpleAtPoint( pSpread, 00764 ClickPos, 00765 NULL, 00766 &pInterruptedNode); 00767 // If hit-test was interrupted then don't say anything about what's under the pointer! 00768 if (pInterruptedNode!=NULL) 00769 return NULL; 00770 } 00771 else 00772 { 00773 // Can't be interrupted by mouse movement so just go for it... 00774 pNode = NodeRenderableInk::FindSimpleAtPoint(pSpread,ClickPos); 00775 } 00776 00777 if (pNode) 00778 { 00779 // Find out whether the hit node is in front of the guideline or not. 00780 // If it is, then clear the Found flag. 00781 Layer* pLowerLayer = (Layer*) pFoundNode->FindParent(CC_RUNTIME_CLASS(Layer)); // The guideline layer 00782 Layer* pNodeLayer = (Layer*) pNode->FindParent(CC_RUNTIME_CLASS(Layer)); // The layer containing the node 00783 // Make sure GuideLayer comes after NodeLayer 00784 do 00785 { 00786 pLowerLayer = pLowerLayer->FindNextLayer(); // Find the layer above the last one tested 00787 } 00788 while (pLowerLayer && pLowerLayer!=pNodeLayer); // Keep going while there is a layer 00789 // and that layer isn't the one we're looking for 00790 // Get here when either we've run out of layers or we've found the layer we want 00791 if (pLowerLayer && pLowerLayer==pNodeLayer) // If found layer above guide layer 00792 bFound=FALSE; // Then flag that the guideline is obscured 00793 } 00794 } 00795 00796 if (!bFound) 00797 pFoundNode = NULL; 00798 00799 return pFoundNode; 00800 }
|
|
Selects a suitable string for the status line based on the current location (as input via the parameters).
Definition at line 1548 of file slicetool.cpp. 01549 { 01550 // You must use the Spread, DocCoord and ClickModifiers to select a suitable string to be 01551 // displaied in the status bar. This is usually done via some sort of switch statement. 01552 // Having selected a suitable string you should do a statement like 01553 // ptext->Load(<#Insert your string ID here #>); 01554 01555 // Delete this line when you display useful strings! 01556 ptext->Empty(); 01557 }
|
|
Reimplemented from Tool_v1. Definition at line 147 of file slicetool.h. 00147 { return TOOLID_SLICETOOL; };
|
|
Definition at line 170 of file slicetool.h. 00170 { return pSliceInfoBarOp; }
|
|
Figure out what the status text for the SliceTool is at the given position on the given spread with the given click modifiers.
Reimplemented from Tool_v1. Definition at line 1515 of file slicetool.cpp. 01517 { 01518 ERROR2IF(ptext==NULL,FALSE,"ptext is NULL!"); 01519 01520 Cursor* pcDummy; // Dummy to hold unused pointer shape computed by FigureUserFeedback 01521 FigureUserFeedback(pSpread, DocPos, ClickMods, TRUE, ptext, &pcDummy); 01522 01523 if (CurrentCursorID != CURSORID_UNSET) 01524 CursorStack::GSetTop(pcDummy,CurrentCursorID); 01525 01526 return TRUE; 01527 }
|
|
Mouse button-up event handler.
Definition at line 1039 of file slicetool.cpp. 01040 { 01041 // if we changed the selection last, or the SelRange cannot provide a usable 01042 // last-selection then use our own record. otherwise, ask the SelRange. 01043 Node* pLastSelNode = NULL; 01044 if (m_bSliceToolSetSel && pLastClickNode != NULL) 01045 { 01046 pLastSelNode = pLastClickNode; 01047 } 01048 else 01049 { 01050 pLastSelNode = SelectRange->GetLastSelectedNode(); 01051 if ( pLastSelNode == NULL || !pLastSelNode->IsAnObject() ) 01052 pLastSelNode = pLastClickNode; 01053 } 01054 01055 // Find out what we should do with the click... 01056 ClickActionCode action = CLICKACTION_NONE; 01057 NodeRenderableInk* pActionNode = NULL; 01058 action = DetermineClickAction( &pActionNode, (NodeRenderableInk*)pLastSelNode, 01059 pClickSimpleNode, pClickCompoundNode, StartSpread, 01060 ClickStart, ClickMods ); 01061 01062 // Act upon the information... 01063 switch (action) 01064 { 01065 //-------------------------------------------------// 01066 // No action required... 01067 case CLICKACTION_NONE: 01068 break; 01069 01070 //-------------------------------------------------// 01071 // Anything that's selected must be deselected... 01072 case CLICKACTION_SELNONE: 01073 { 01074 // Don't clear selection if was an adjust click 01075 // (Change requested by Charles and Alan Burns) 01076 if (!ClickMods.Adjust) 01077 { 01078 // Markn 29/9/95: We ignore this if the click happened on a guideline. 01079 // If another type of node needs to behave like this, then a virt func in node 01080 // will be required instead of the hideous IS_A() clause in the 'if' statement 01081 if (pPreProcClickNode == NULL || !IS_A(pPreProcClickNode,NodeGuideline)) 01082 { 01083 NodeRenderableInk::DeselectAll(TRUE, TRUE); 01084 pLastClickNode = NULL; 01085 } 01086 } 01087 break; 01088 } 01089 01090 //-------------------------------------------------// 01091 // The action node must be selected or toggled... 01092 case CLICKACTION_SELNODE: 01093 case CLICKACTION_SELUNDER: 01094 case CLICKACTION_SELUNDERCYCLE: 01095 case CLICKACTION_SELUNDERFAIL: 01096 case CLICKACTION_SELUNDERFAIL2: 01097 case CLICKACTION_SELINSIDE: 01098 case CLICKACTION_SELINSIDECYCLE: 01099 case CLICKACTION_SELINSIDEFAIL: 01100 case CLICKACTION_SELINSIDEFAIL2: 01101 case CLICKACTION_SELLEAF: 01102 { 01103 ERROR3IF(pActionNode == NULL, "Action and ActionNode don't agree!"); 01104 01105 // if we aren't Adjust'ing, ensure no previous selection. 01106 if (!ClickMods.Adjust) 01107 NodeRenderableInk::DeselectAll(TRUE, FALSE); 01108 01109 // try to select all nodes sharing the same name as the clicked node. 01110 String_256 SetName; 01111 SetName.Empty(); 01112 SliceHelper::SelectAllSetsOfThisNode(pActionNode, SetName, ClickMods.Adjust); 01113 01114 // if the clicked node has no name then the above code will do nothing, 01115 // so we need to do a normal select, accounting for Adjust. 01116 if (SetName.IsEmpty()) 01117 { 01118 if (ClickMods.Adjust) 01119 { 01120 // If Adjust is applied, toggle the state of the action node. 01121 if (pActionNode->IsSelected()) 01122 pActionNode->DeSelect(TRUE); 01123 else 01124 pActionNode->Select(TRUE); 01125 } 01126 else 01127 { 01128 pActionNode->Select(TRUE); 01129 } 01130 01131 // force a broadcast of the changed selection state, so our info-bar updates. 01132 SelectRange->Update(TRUE); 01133 } 01134 01135 // update our record of the last clicked node. 01136 pLastClickNode = pActionNode; 01137 01138 // make a note that we changed the selection. 01139 m_bSliceToolSetSel = TRUE; 01140 01141 break; 01142 } 01143 //-------------------------------------------------// 01144 default: 01145 ERROR3("Unknown Click action code!"); 01146 break; 01147 }; // switch (action) 01148 01149 // Make sure the cursor reflects which keys are down, now that the mouse button has 01150 // been released. 01151 SetKeyDownCursor(ClickModifiers::GetClickModifiers()); 01152 }
|
|
Double mouse-click event handler. Currently, passes the event to HandleSingleClick().
Definition at line 912 of file slicetool.cpp. 00913 { 00914 HandleSingleClick(); 00915 }
|
|
Mouse-drag event handler.
Definition at line 930 of file slicetool.cpp. 00931 { 00932 // check for a forced translate, and perform a translate 00933 // operation if appropriate. 00934 if (IsTranslateShortcut(ClickMods)) 00935 { 00936 if (SelectionSpread != NULL) 00937 { 00938 // There is a selection, so start a translate drag... 00939 DoTranslate(); 00940 } 00941 return; 00942 } 00943 00944 // Right, we clicked on either an object (possibly already selected) or 00945 // blank paper. First, check if there is an object at the click position. 00946 if (pClickCompoundNode == NULL) 00947 { 00948 // There is only blank paper at the click point, so assume the user is 00949 // trying to start a marquee selection drag. Run the drag-box operation. 00950 DoDragBox(); 00951 return; 00952 } 00953 00954 // Is the clicked object already selected? Note that the user may be trying to click on 00955 // a simple object selected inside a group that itself is not selected, so we must be 00956 // careful to check the state of the right nodes here. 00957 // 00958 // The logic here is: 00959 // If the clicked simple node or any of it's parents are selected 00960 // Then DON'T alter the selection to reflect the clicked object! 00961 // 00962 BOOL SimpleInSelected = FALSE; // So far haven't encountered any selected nodes 00963 Node* pNode = pClickSimpleNode; // Make a working pointer and initialise it 00964 do 00965 { 00966 if (pNode->IsSelected()) // If the working node is selected 00967 { 00968 SimpleInSelected = TRUE; // Then the simple node or one of its parents are 00969 break; // selected so we don't need to change the selection! 00970 } 00971 pNode = pNode->FindParent(); // Else check the working node's parent 00972 } 00973 while (pNode != pClickCompoundNode->FindParent());// until we've reached the compound node's parent 00974 // (Allows the compound node itself to be checked) 00975 00976 if (!SimpleInSelected) 00977 { 00978 // No. If the click was with the left button we must deselect all other objects. 00979 // If the clicked object isn't selected, we can't run a transform on it. Hence we must 00980 // select it, but we prevent it being redrawn as selected (with its little blobs). 00981 if (!ClickMods.Adjust) 00982 { 00983 // Normal click, so deselect everything before we select the clicked node... 00984 NodeRenderableInk::DeselectAll(TRUE, FALSE); 00985 } 00986 else 00987 { 00988 // We clicked with the right button, but if the click was in a different spread to 00989 // the selection we have to deselect everything anyway. 00990 Node* pNode = SelectRange->FindFirst(); 00991 if (pNode != NULL && pNode->FindParentSpread() != SelectionSpread) 00992 { 00993 // Clicked node in a different spread from previous selection, so clear selection 00994 NodeRenderableInk::DeselectAll(TRUE, FALSE); 00995 } 00996 } 00997 00998 // Now that the selection state of all other objects is dealt with, make sure the 00999 // clicked object, as well as objects sharing its name, is selected. 01000 // 01001 // Currently, SelectAllSetsOfThisNode indirectly does a SelectRange->Update(TRUE). 01002 String_256 SetName; 01003 SetName.Empty(); 01004 SliceHelper::SelectAllSetsOfThisNode(pClickCompoundNode, SetName, FALSE); 01005 if (SetName.IsEmpty()) 01006 { 01007 pClickCompoundNode->Select(TRUE); 01008 01009 // force a broadcast of the changed selection, so that our info-bar is informed. 01010 SelectRange->Update(TRUE); 01011 } 01012 } 01013 01014 // Finally, run a transform on the selected object(s). Of course, the user may not be 01015 // trying to drag the selection - if so the button will come up before a significant 01016 // drag has occurred and we can take it from there. 01017 MakeSelectionValidForDrag(); 01018 01019 // do the drag. 01020 DoTranslate(); 01021 01022 // remember that _we_ changed the selection. 01023 m_bSliceToolSetSel = TRUE; 01024 }
|
|
Single mouse-click event handler.
Definition at line 887 of file slicetool.cpp. 00888 { 00889 // work out what modifiers apply to this click. 00890 SetKeyDownCursor(ClickMods); 00891 00892 // Find out which object, if any, was clicked on. We hit-detect both the simple node 00893 // that was clicked and any top-level compound object it may be part of. 00894 pClickSimpleNode = NodeRenderableInk::FindSimpleAtPoint(StartSpread, ClickStart); 00895 pClickCompoundNode = NodeRenderableInk::FindCompoundFromSimple(pClickSimpleNode); 00896 }
|
|
Tab keypress event handler.
Definition at line 1232 of file slicetool.cpp.
|
|
Used to check if the Tool was properly constructed.
Reimplemented from Tool_v1. Definition at line 257 of file slicetool.cpp. 00258 { 00259 // declare all ops used by SliceTool. 00260 BOOL ok = OpSliceDragBox::Declare(); 00261 if (ok) ok = OpSliceTranslate::Declare(); 00262 ERROR2IF(!ok, FALSE, "Couldn't Declare all Ops in SliceTool::Init."); 00263 00264 // This section reads in the infobar definition and creates an instance of 00265 // SliceInfoBarOp. Also pSliceInfoBarOp, the ptr to the tool's infobar, is set up 00266 // after the infobar is successfully read and created. 00267 if (ok) 00268 { 00269 CCResTextFile file; // Resource File 00270 SliceInfoBarOpCreate BarCreate; // Object that creates SliceInfoBarOp objects 00271 00272 ok = file.open(_R(IDM_SLICE_BAR), _R(IDT_INFO_BAR_RES)); // Open resource 00273 if (ok) ok = DialogBarOp::ReadBarsFromFile(file,BarCreate); // Read and create info bar 00274 if (ok) file.close(); // Close resource 00275 00276 ENSURE(ok,"Unable to load Slicebar.ini from resource\n"); 00277 00278 if (ok) 00279 { 00280 // Info bar now exists. Now get a pointer to it 00281 String_32 str = String_32(_R(IDS_SLICETOOL_INFOBARNAME)); 00282 DialogBarOp* pDialogBarOp = DialogBarOp::FindDialogBarOp(str); 00283 00284 ok = (pDialogBarOp != NULL); 00285 if (ok) ok = pDialogBarOp->IsKindOf(CC_RUNTIME_CLASS(SliceInfoBarOp)); 00286 if (ok) pSliceInfoBarOp = (SliceInfoBarOp*)pDialogBarOp; 00287 00288 ENSURE(ok,"Error finding the Slice tool info bar"); 00289 } 00290 } 00291 00292 // Get a permanent pointer to the application's SelRange object. 00293 SelectRange = GetApplication()->FindSelection(); 00294 00295 // init the global var with the first bar name to create - ie Bar1 00296 g_BarName.MakeMsg(_R(IDS_BARNAME), 1); 00297 00298 return (ok); 00299 }
|
|
Tests whether any of the modifiers, eg. Constrain, Adjust etc, apply to the current mouse click (as received by the OnClick function).
Definition at line 2171 of file slicetool.cpp. 02172 { 02173 return cmods.Adjust || cmods.Constrain || cmods.Alternative1 || cmods.Menu; 02174 }
|
|
Definition at line 171 of file slicetool.h. 00171 { return CurrentTool; }
|
|
Reports whether the current mouse click meant the user wanted to "select- leaf" or not.
Definition at line 2242 of file slicetool.cpp. 02243 { 02244 return (cmods.Constrain && !cmods.Alternative1); 02245 }
|
|
Reports whether the current mouse click meant the user wanted to "select- inside" or not.
Definition at line 2219 of file slicetool.cpp. 02220 { 02221 return (cmods.Constrain && cmods.Alternative1); 02222 }
|
|
Decides whether the current click is modified to be an "under" click or not.
Definition at line 2195 of file slicetool.cpp. 02196 { 02197 return (!cmods.Constrain && cmods.Alternative1); 02198 }
|
|
Detects whether the current mouse click modifiers denote the translate drag operation shortcut.
Definition at line 2147 of file slicetool.cpp. 02148 { 02149 return cmods.Constrain && cmods.Alternative1; 02150 }
|
|
Runs through the selected nodes, making sure they are all happy with being dragged. Checks are:- 1. Sub-Selected text characters are deselected, and their parent story (and all other nodes sharing its name) are selected instead.
Definition at line 1329 of file slicetool.cpp. 01330 { 01331 SelRange *pSelection = GetApplication()->FindSelection(); 01332 RangeControl rg = pSelection->GetRangeControlFlags(); 01333 rg.IgnoreInvisibleLayers = TRUE; // oddly setting this to TRUE actually means DO INCLUDE INIVISIBLE LAYERS in the range!!! 01334 RangeControl rcOld = rg; 01335 rg.PromoteToParent = TRUE; 01336 pSelection->Range::SetRangeControl(rg); 01337 01338 Node* pNode = pSelection->FindFirst(); 01339 BOOL ChangedSelection = FALSE; 01340 01341 while (pNode != NULL) 01342 { 01343 // Push any text sub-selection up to the selected story, and make sure 01344 // that any other Nodes sharing the text-story's name are also selected. 01345 if (pNode->IsAnAbstractTextChar()) 01346 { 01347 ((NodeRenderableInk*)pNode)->DeSelect(TRUE); 01348 TextStory* pStory = (TextStory*)pNode->FindParent(CC_RUNTIME_CLASS(TextStory)); 01349 if (pStory != NULL) 01350 { 01351 String_256 SetName; 01352 SetName.Empty(); 01353 SliceHelper::SelectAllSetsOfThisNode(pStory, SetName, FALSE); 01354 if (SetName.IsEmpty()) 01355 pStory->Select(TRUE); 01356 ChangedSelection = TRUE; 01357 } 01358 } 01359 01360 pNode = pSelection->FindNext(pNode); 01361 } 01362 01363 // if we needed to change the selection, tell everyone. 01364 if (ChangedSelection) 01365 { 01366 // this call commented out, as I don't think it is required. pushing the selection 01367 // up to the letter's text-story in this way does not actually change the overall 01368 // state of the selection wrt named sets, as the story shares the same set name as 01369 // the character (always?). - Karim 25/10/1999 01370 // GetApplication()->FindSelection()->Update(TRUE); // is this call actually 01371 m_bSliceToolSetSel = TRUE; 01372 } 01373 01374 pSelection->Range::SetRangeControl(rcOld); 01375 }
|
|
To handle a Mouse Click event for the Slice Tool.
Reimplemented from DragTool. Definition at line 622 of file slicetool.cpp. 00624 { 00625 // we ignore any clicks with the Menu mouse button. 00626 if (ClickMods.Menu) 00627 return; 00628 00629 // remember the mouse position, in case we're starting a drag. 00630 if (Click == CLICKTYPE_SINGLE) 00631 { 00632 ClickStart = PointerPos; 00633 StartSpread = pSpread; 00634 } 00635 00636 // remember the click modifiers for later use in the click-processing code. 00637 this->ClickMods = ClickMods; 00638 TypeOfClick = Click; 00639 00640 // update our spread and bounds info about the selection. 00641 UpdateSelectionInfo(); 00642 00643 // refresh our ptr to the app's selection, for use in the click-processing code. 00644 SelectRange = GetApplication()->FindSelection(); 00645 RangeControl rc = SelectRange->GetRangeControlFlags(); 00646 rc.IgnoreInvisibleLayers = TRUE; 00647 SelectRange->Range::SetRangeControl(rc); 00648 00649 // we process clicks in three stages, stopping as soon as 00650 // a stage successfully processes the click. 00651 00652 // this function checks for and lets us drag guidelines. 00653 if (!PreProcessClick()) 00654 { 00655 // this function is a carry-over from the Selector tool code. 00656 // it currently does nothing. 00657 if (!ProcessObjectClick()) 00658 { 00659 // this function deals with normal mouse-click handling. 00660 PostProcessClick(); 00661 } 00662 } 00663 }
|
|
key-press event handler. Catch CTRL/ALT/SHIFT modifiers and change the status-line/cursor appropriately.
Reimplemented from Tool_v1. Definition at line 1171 of file slicetool.cpp. 01172 { 01173 // Find the current state of the "click" keyboard modifiers... 01174 ClickMods = ClickModifiers::GetClickModifiers(); 01175 01176 switch (pKeyPress->GetVirtKey()) 01177 { 01178 case CAMKEY(CC_MOD_ADJUST): // bit 0 of fKeyStates (SHIFT) 01179 case CAMKEY(CC_MOD_ALTERNATIVE): // bit 1 of fKeyStates (ALT) 01180 case CAMKEY(CC_MOD_CONSTRAIN): // bit 2 of fKeyStates (CONTROL) 01181 // apparently, this is a bodge for speed. 01182 // see SelectorTool::OnKeyPress for details :-) 01183 break; 01184 01185 case CAMKEY(TAB): // moves selection to next rendered node 01186 if (pKeyPress->IsPress()) HandleTabKey(ClickMods.Adjust); 01187 break; 01188 01189 case CAMKEY(HOME): // select first object in render order 01190 if (pKeyPress->IsPress()) 01191 { 01192 if (SelectionSpread != NULL) 01193 NodeRenderableInk::DeselectAll(); 01194 HandleTabKey(FALSE); 01195 } 01196 break; 01197 01198 case CAMKEY(END): // select last object in render order 01199 if (pKeyPress->IsPress()) 01200 { 01201 if (SelectionSpread != NULL) 01202 NodeRenderableInk::DeselectAll(); 01203 HandleTabKey(TRUE); 01204 } 01205 break; 01206 01207 default: // not interested in processing this 01208 return FALSE; 01209 } 01210 01211 // If we processed a click modifier then update the cursor and return that we processed 01212 // the keystroke. 01213 SetKeyDownCursor(ClickMods); 01214 01215 // Yes, we processed this key-event. 01216 return TRUE; 01217 }
|
|
To handle a Mouse Move event for the Slice Tool.
Reimplemented from Tool_v1. Definition at line 1291 of file slicetool.cpp. 01292 { 01293 // Display status bar text for the current position 01294 // DisplayStatusBarHelp(PointerPos, pSpread, ClickMods); 01295 01296 // If there isn't any selection, or it's in a different spread, then do nothing. 01297 if (SelectionSpread == NULL || SelectionSpread != pSpread) return; 01298 01299 String_256 str; 01300 Cursor* pcPointerShape; 01301 01302 FigureUserFeedback(pSpread, PointerPos, ClickMods, FALSE, &str, &pcPointerShape); 01303 01304 if (!(str.IsEmpty())) 01305 SetStatusText(&str); 01306 01307 if (CurrentCursorID != CURSORID_UNSET) 01308 CursorStack::GSetTop(pcPointerShape, CurrentCursorID); 01309 }
|
|
Provided a click wasn't eaten by a pre- or mid- processor, we deal with it here. This passes the event on to specific handler routines, depending on its type (TypeOfClick):.
Definition at line 848 of file slicetool.cpp. 00849 { 00850 switch (TypeOfClick) 00851 { 00852 case CLICKTYPE_SINGLE: 00853 HandleSingleClick(); 00854 break; 00855 00856 case CLICKTYPE_DOUBLE: 00857 HandleDoubleClick(); 00858 break; 00859 00860 case CLICKTYPE_DRAG: 00861 HandleDragClick(); 00862 break; 00863 00864 case CLICKTYPE_UP: 00865 HandleButtonUp(); 00866 break; 00867 00868 default: 00869 // unrecognised click-type - do nothing. 00870 break; 00871 } 00872 }
|
|
Allows a click to be handled before going through the main click-handling code. This function checks for a clicked Node, and allows it to respond to the click.
Definition at line 685 of file slicetool.cpp. 00686 { 00687 // look for a Node which may be interested in this click, and allow it to respond. 00688 pPreProcClickNode = FindPreProcessClickNode(StartSpread, ClickStart); 00689 if (pPreProcClickNode != NULL) 00690 if (pPreProcClickNode->OnClick(ClickStart, TypeOfClick, ClickMods, StartSpread)) 00691 return TRUE; 00692 00693 // no preprocess node, or it didn't want the click. 00694 return FALSE; 00695 }
|
|
In the selector tool, this function OnClick()'s each object in the tool's range if the Selector tool is using Object blobs. We don't, so we won't.
Definition at line 820 of file slicetool.cpp. 00821 { 00822 return FALSE; 00823 }
|
|
Render the SliceTool's tool blob. This consists of a bounding rect identical to that used when dragging the selection (dotted, red line), around whatever is currently selected.
Reimplemented from Tool_v1. Definition at line 2464 of file slicetool.cpp. 02465 { 02466 #ifdef SLICETOOL_BLOBS 02467 // don't bother if there's no selection spread or if we're asked to render for 02468 // a spread which isn't the selection spread. 02469 if ( SelectionSpread == NULL || 02470 pSpread != SelectionSpread ) 02471 { 02472 return; 02473 } 02474 02475 // get the selected DocView - if we can't get it, then leave now. 02476 DocView* pView = DocView::GetSelected(); 02477 if (pView == NULL) 02478 return; 02479 02480 // sorry, this isn't the neatest programming. 02481 // The size of the SliceTool blob bitmap is about 10 pixels square. 02482 // The desired distance between blob and selection is 2 pixels. 02483 INT32 BlobGap = (INT32)(2 * pView->GetScaledPixelWidth().MakeDouble()); 02484 INT32 BlobRadius = (INT32)(10 * pView->GetScaledPixelWidth().MakeDouble()); 02485 BlobRadius /= 2; 02486 02487 // the absolute position of the blob - just left and below the top of the selection rect. 02488 DocCoord dcBlobPos( m_drBlobRect.hix + (BlobGap + BlobRadius), 02489 m_drBlobRect.hiy - (BlobGap + BlobRadius) ); 02490 02491 // render the blobs for all appropriate render regions. 02492 RenderRegion* pRegion = DocView::RenderOnTop(pClipRect, pSpread, ClippedEOR); 02493 while (pRegion != NULL) 02494 { 02495 pRegion->SaveContext(); 02496 02497 // draw a bounding box around the selection. 02498 pRegion->SetLineColour(COLOUR_XORSELECT); 02499 pRegion->DrawDragBounds(&m_drBlobRect); 02500 02501 // draw a little named-set bitmap to denote what sets are selected. 02502 switch (m_SetSelectionState) 02503 { 02504 case FullSetsSelected: 02505 pRegion->DrawBitmapBlob(dcBlobPos, _R(IDBMP_SLICE_SELALL)); 02506 break; 02507 02508 case HalfSetsSelected: 02509 pRegion->DrawBitmapBlob(dcBlobPos, _R(IDBMP_SLICE_SELSOME)); 02510 break; 02511 02512 case NoSetsSelected: 02513 pRegion->DrawBitmapBlob(dcBlobPos, _R(IDBMP_SLICE_SELNONE)); 02514 break; 02515 02516 default: 02517 ERROR3("SliceTool::RenderToolBlobs; unrecognised set-selection state!"); 02518 break; 02519 } 02520 02521 pRegion->RestoreContext(); 02522 02523 // Go on to the next render region, if any. 02524 pRegion = DocView::GetNextOnTop(pClipRect); 02525 } 02526 #endif 02527 }
|
|
Starts up and closes down the Slice tool.
Reimplemented from Tool_v1. Definition at line 356 of file slicetool.cpp. 00357 { 00358 if (isSelected) 00359 { 00360 // create the tool's cursors and push the default one onto the stack. 00361 if (!CreateCursors()) return; 00362 CurrentCursorID = CursorStack::GPush(pcNormalSliceCursor, FALSE); 00363 pcCurrentCursor = pcNormalSliceCursor; 00364 00365 // This tool is now the current one. 00366 CurrentTool = TRUE; 00367 00368 // Create and display the tool's info bar. 00369 if (pSliceInfoBarOp->Create()) 00370 pSliceInfoBarOp->SetSliceTool(this); 00371 00372 // register the Slice tool's blob preference with the app. 00373 BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); 00374 if (pBlobMgr != NULL) 00375 { 00376 // we only use Tiny blobs. 00377 BlobStyle bsBlobs; 00378 bsBlobs.Tiny = TRUE; 00379 pBlobMgr->ToolInterest(bsBlobs); 00380 } 00381 00382 // make a note that we mustn't ignore any selection-changed messages. 00383 m_fIgnoreSelChange = FALSE; 00384 00385 // Update our info on the selection, and if necessary, render our tool blobs on. 00386 if (UpdateSelectionInfo()) 00387 pBlobMgr->RenderToolBlobsOn(this, SelectionSpread, NULL); 00388 } 00389 else 00390 { 00391 // destroy the tool's cursors, if they exist. 00392 if (pcCurrentCursor != NULL) 00393 { 00394 CursorStack::GPop(CurrentCursorID); 00395 pcCurrentCursor = NULL; 00396 CurrentCursorID = 0; 00397 } 00398 DestroyCursors(); 00399 00400 // remove the info-bar's slice-tool pointer. 00401 pSliceInfoBarOp->SetSliceTool(NULL); 00402 00403 // Remove the info bar from view by deleting the actual underlying window 00404 pSliceInfoBarOp->m_InfoBarCreated = FALSE; 00405 pSliceInfoBarOp->Delete(); 00406 00407 // ensure any tool object blobs are removed. 00408 BlobManager* BlobMgr = GetApplication()->GetBlobManager(); 00409 if (BlobMgr != NULL) 00410 { 00411 BlobStyle bsRemoves; 00412 bsRemoves.ToolObject = TRUE; 00413 BlobMgr->RemoveInterest(bsRemoves); 00414 } 00415 00416 // No longer the current tool 00417 CurrentTool = FALSE; 00418 00419 // Ensure our tool blobs have been rendered off the selected spread. 00420 BlobMgr->RenderToolBlobsOff(this, SelectionSpread, NULL); 00421 } 00422 }
|
|
A public function, for other people to call whenever they need to let the Slice tool know that the selection has changed.
Definition at line 440 of file slicetool.cpp. 00441 { 00442 // we sometimes ignore selection-changed messages, so that we don't get our tool-blobs 00443 // in a tizzy. 00444 if (m_fIgnoreSelChange) 00445 return; 00446 00447 BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); 00448 if (pBlobMgr==NULL) return; 00449 00450 // ok, remove any of our previous tool blobs. 00451 pBlobMgr->RenderToolBlobsOff(this, SelectionSpread, NULL); 00452 00453 // reset our set-sel flag, to indicate that we did not change the selection. 00454 // this flag needs to be cleared whenever the selection changes, in order to 00455 // keep a record of whether we changed the selection. whenever we update the 00456 // selection from within SliceTool, we must set this flag manually *after* we 00457 // tell everyone that the selection changed. 00458 m_bSliceToolSetSel = FALSE; 00459 00460 // update the Slice tool's selection information, 00461 // and if necessary then render our tool blobs on. 00462 if (UpdateSelectionInfo()) 00463 pBlobMgr->RenderToolBlobsOn(this, SelectionSpread, NULL); 00464 }
|
|
Decodes the bit-field fKeyStates, indicating which combination of modifier keys are down, and sets the cursor appropriately.
Definition at line 1253 of file slicetool.cpp. 01254 { 01255 // Get current position information for call to change pointer shape... 01256 Spread* pSpread; 01257 DocCoord dcMousePos; 01258 if (DocView::GetCurrentMousePos(&pSpread, &dcMousePos) && 01259 Tool::GetCurrentID() == TOOLID_SLICETOOL && 01260 !BaseBar::IsDragging()) 01261 { 01262 // Call nice central routine to figure out what pointer shape to show... 01263 // (Set the status bar text while we're at it.) 01264 String_256 Str; 01265 Cursor* pPtr; 01266 FigureUserFeedback(pSpread, dcMousePos, cmMods, TRUE, &Str, &pPtr); 01267 if (CurrentCursorID != CURSORID_UNSET) 01268 CursorStack::GSetTop(pPtr, CurrentCursorID); 01269 if (!(Str.IsEmpty())) 01270 SetStatusText( &Str ); 01271 } 01272 }
|
|
Sets the status bar text to the given string.
Definition at line 2101 of file slicetool.cpp. 02102 { 02103 GetApplication()->UpdateStatusBarText(pStr); 02104 }
|
|
Sets the status bar text to the given string. Alternative to loading the string yourself and calling the other SetStatusText function.
Definition at line 2123 of file slicetool.cpp. 02124 { 02125 String_256 str(nStringID); 02126 SetStatusText(&str); 02127 }
|
|
Updates the slice tool's record of the spread and bounding rectangle of the current selection.
Definition at line 2545 of file slicetool.cpp. 02546 { 02547 // Reset all our infomation about the selection to "no selection". 02548 SelectionSpread = NULL; 02549 SelectionRect.MakeEmpty(); 02550 m_drBlobRect.MakeEmpty(); 02551 02552 // we want to take controller nodes into account in this selection. 02553 RangeControl rc = SelectRange->GetRangeControlFlags(); 02554 RangeControl rcOld = rc; 02555 rc.PromoteToParent = TRUE; 02556 SelectRange->Range::SetRangeControl(rc); 02557 02558 // Go find the first node in the selection, so that we can find out about its spread 02559 Node* pFirstNode = SelectRange->FindFirst(); 02560 if (pFirstNode != NULL) 02561 { 02562 // Find the spread that the selection lives on, if any, and its bounds. 02563 SelectionSpread = pFirstNode->FindParentSpread(); 02564 if (SelectionSpread != NULL) 02565 { 02566 // Update the bounding rectangle of the selection. 02567 SelectionRect = SelectRange->GetBoundingRect(); 02568 02569 // update our tool-blob rendering info. 02570 m_drBlobRect = SelectRange->GetBoundingRectForEorDragging(); 02571 02572 // call the name-gallery to update named set info. 02573 NameGallery* pNameGallery = NameGallery::Instance(); 02574 if (pNameGallery) 02575 pNameGallery->FastUpdateNamedSetSizes(); 02576 02577 // decide what set-selection info we'll be displaying. 02578 INT32 nSetSelection = SliceHelper::DoesSelectionOnlyContainCompleteSets(); 02579 m_SetSelectionState = (nSetSelection == 1) ? FullSetsSelected : 02580 (nSetSelection == 0) ? HalfSetsSelected : 02581 NoSetsSelected; 02582 02583 if (SelectionRect.IsEmpty()) 02584 SelectionRect.Inflate(1); 02585 } 02586 } 02587 02588 SelectRange->Range::SetRangeControl(rcOld); 02589 02590 // Return TRUE if there is a selection. 02591 return SelectionSpread != NULL; 02592 }
|
|
Validate that the simple node is inside the last clicked node.
Definition at line 2027 of file slicetool.cpp. 02028 { 02029 Node* pSearchNode = pClickSimpleNode; 02030 while (pSearchNode && pSearchNode!=pLastClickNode) 02031 pSearchNode = pSearchNode->FindParent(); 02032 return (pSearchNode!=NULL); 02033 }
|
|
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.
Definition at line 1996 of file slicetool.cpp. 01997 { 01998 NodeRenderableInk* pSearchNode = NULL; 01999 do 02000 { 02001 pSearchNode = NodeRenderableInk::FindSimpleAtPoint(pStartSpread,ClickStart,pSearchNode); 02002 } 02003 while (pSearchNode && pLastClickNode!=NodeRenderableInk::FindCompoundFromSimple(pSearchNode,pLastClickNode)); 02004 02005 return (pSearchNode!=NULL); 02006 }
|
|
The SliceTool's view-changed message handler. This method is called directly from the message handler of SliceInfoBarOp, which lives further down in this file. Its sole purpose is to let us redraw our blobs correctly.
Definition at line 485 of file slicetool.cpp. 00486 { 00487 #ifdef SLICETOOL_BLOBS 00488 BlobManager* pBlobMgr = GetApplication()->GetBlobManager(); 00489 if (pBlobMgr==NULL) return; 00490 00491 switch (msg.State) 00492 { 00493 case DocViewMsg::DocViewState::SELABOUTTOCHANGE: 00494 { 00495 // Only bother rendering our tool blobs off if the new view is valid. 00496 if (msg.pNewDocView != NULL) 00497 { 00498 pBlobMgr->RenderToolBlobsOff(this, SelectionSpread, NULL); 00499 00500 // so that we don't draw tool blobs onto any new view, we must ignore any 00501 // select-change message until the new view is installed. 00502 m_fIgnoreSelChange = TRUE; 00503 } 00504 00505 break; 00506 } 00507 00508 case DocViewMsg::DocViewState::SELCHANGED: 00509 { 00510 // if the new DocView is valid, then draw our blobs onto it. 00511 if (msg.pNewDocView != NULL) 00512 if (UpdateSelectionInfo()) 00513 pBlobMgr->RenderToolBlobsOn(this, SelectionSpread, NULL); 00514 00515 // ok, the new view is now here - we can stop ignoring sel-changed messages. 00516 m_fIgnoreSelChange = FALSE; 00517 break; 00518 } 00519 00520 default: 00521 break; 00522 } 00523 #endif 00524 }
|
|
Definition at line 137 of file slicetool.h. |
|
Definition at line 138 of file slicetool.h. |
|
Reimplemented from DragTool. Definition at line 341 of file slicetool.h. |
|
Definition at line 319 of file slicetool.h. |
|
Definition at line 272 of file slicetool.h. |
|
Definition at line 270 of file slicetool.h. |
|
Definition at line 336 of file slicetool.h. |
|
Definition at line 332 of file slicetool.h. |
|
Reimplemented from DragTool. Definition at line 338 of file slicetool.h. |
|
Definition at line 279 of file slicetool.h. |
|
Definition at line 282 of file slicetool.h. |
|
Definition at line 344 of file slicetool.h. |
|
Definition at line 315 of file slicetool.h. |
|
Definition at line 257 of file slicetool.h. |
|
Definition at line 265 of file slicetool.h. |
|
Definition at line 335 of file slicetool.h. |
|
Definition at line 266 of file slicetool.h. |
|
Definition at line 261 of file slicetool.h. |
|
Definition at line 259 of file slicetool.h. |
|
Definition at line 263 of file slicetool.h. |
|
Definition at line 262 of file slicetool.h. |
|
Definition at line 286 of file slicetool.h. |
|
Definition at line 285 of file slicetool.h. |
|
Definition at line 256 of file slicetool.h. |
|
Definition at line 260 of file slicetool.h. |
|
Definition at line 258 of file slicetool.h. |
|
Definition at line 267 of file slicetool.h. |
|
Definition at line 287 of file slicetool.h. |
|
Definition at line 288 of file slicetool.h. |
|
Definition at line 333 of file slicetool.h. |
|
Reimplemented from DragTool. Definition at line 340 of file slicetool.h. |
|
Definition at line 278 of file slicetool.h. |
|
Definition at line 276 of file slicetool.h. |
|
Definition at line 277 of file slicetool.h. |
|
Definition at line 271 of file slicetool.h. |
|
Reimplemented from DragTool. Definition at line 339 of file slicetool.h. |
|
Definition at line 273 of file slicetool.h. |