Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
TInteractor, MMouseEventHandler
Inherited By:
None.
Purpose:
TSelectTextInteractor, derived from TInteractor and MMouseEventHandler, is used by the Text Editing Framework to handle selection of text by clicking and dragging the mouse. TSelectTextInteractor creates both insertion point and text range selections on the current text representation, and causes the view to be redrawn with the new selection.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
This class is designed to be used directly.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
Other Considerations:
None.
- TSelectTextInteractor (TTextView * view)
- TSelectTextInteractor (const TSelectTextInteractor & interactor)
- TSelectTextInteractor ()
Interface Category:
API.
Purpose:
- Constructs a mouse interactor for the specified view.
- Copy constructor.
- Default constructor. This constructor is protected.
Calling Context:
- Call to construct a mouse interactor for a particular view.
- Called to copy an object.
- Only for internal use by Resurrect. Developers should treat as protected.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TSelectTextInteractor ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Typically not called directly by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool MouseDown (TMouseDownEvent & mouseDown)
Interface Category:
API.
Purpose:
Handles the event that occurs when the user pushes down the mouse button. Sets up for the mouse dragging to follow, and maps the mouse down position to an insertion point within the text as it is displayed in the text view. If user did a Shift-click, calls HandleExtendTextSelection. If user double-clicked, calls HandleSelectWord, and if user did a triple-click, calls HandleSelectLine.
Calling Context:
Called by the framework when a mouse-down event occurs. Typically not called directly by clients.
Parameters:
Return Value:
Returns true when finished handling the event.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool MouseUp (TMouseUpEvent & mouseUp)
Interface Category:
API.
Purpose:
Handles the event that occurs when the user lets the mouse button up. This function maps the mouse up position to an insertion point if it is the same as the last mouse down position. Otherwise, it maps the mouse up position to a range based on the last mouse down position. Sets the new selection in the text presenter state, which causes the view to be updated.
Calling Context:
Called by the framework when a mouse-up event occurs. Typically not called directly by clients.
Parameters:
Return Value:
Returns true when finished handling the event.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool MouseMoved (TMouseMovedEvent & mouseMoved)
Interface Category:
API.
Purpose:
Tracks mouse movement for click and drag behavior. Sets the new selection on the representation based on the current position of the mouse, and sets the new selection in the presenter state, which causes the view to be updated. Provides visual feedback when creating selections.
Calling Context:
Called by the framework at various intervals when the mouse is down and is being dragged. Typically not called directly by clients.
Parameters:
Return Value:
Returns true when finished handling the event.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void ComputeNewSelection (const TInsertionOffset & previousPoint, const TInsertionOffset & newPoint, TTextArea & newSelection) const
Interface Category:
API.
Purpose:
Sets newSelection argument to the new selection, computed based on the previous and new insertion point offsets.
Calling Context:
Called by the Text Framework classes. Typically not called directly by clients.
Parameters:
- const TInsertionOffset & previousPoint -The initial selection point offset.
- const TInsertionOffset & newPoint -The final selection point offset.
- TTextArea & newSelection -The selection that is set to an insertion point offset (if the initial and final offsets are the same) or to a region of text bounded by the offsets.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
This function is protected.
Member Function: TSelectTextInteractor::HandleExtendTextSelection
virtual void HandleExtendTextSelection (TMouseDownEvent & mouseDown)
Interface Category:
API.
Purpose:
Extends the current selection to the position where the mouse down event occurred. Called by MouseDown when user does a Shift-click.
Calling Context:
Called by the Text Framework classes. Typically not called directly by clients.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void HandleSelectLine (const TTextOffset &)
Interface Category:
API.
Purpose:
Selects the line of text that includes that at the specified offset. Called by MouseDown when the user does a triple-click.
Calling Context:
Called by the Text Framework classes. Typically not called directly by clients.
Parameters:
- const TTextOffset & -The text offset where the user did the triple-click.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void HandleSelectWord (const TTextOffset &)
Interface Category:
API.
Purpose:
At the given text offset, set the selection to the bounds of the intersecting word.
Calling Context:
Called by Text Framework classes.
Parameters:
- const TTextOffset & -Location in text to use when finding intersecting word.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.