Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 2 - TextEdit / TextEdit Reference
Routines / Setting the Caret and Selection Range


TEClick

The TEClick procedure controls placement and highlighting of the selection range as determined by mouse events.

PROCEDURE TEClick (pt: Point; extend: Boolean; hTE: TEHandle); 
pt
The mouse location in local coordinates at the time the mouse button was pressed, obtainable from the event record (in global coordinates).
extend
A flag denoting the state of the Shift key at the time of the click as indicated by the Event Manager. If the Shift key was held down at the time of the click to extend the selection, pass a value of TRUE.
hTE
A handle to the edit record whose text is displayed in the view rectangle where the click occurred.
DESCRIPTION
Call TEClick whenever a mouse-down event occurs in the view rectangle of the edit record and the window associated with that edit record is active. The TEClick procedure keeps control until the mouse button is released. Use the QuickDraw procedure GlobalToLocal to convert the global coordinates of the mouse location given in the event record to the local coordinate system for pt.

The TEClick procedure removes highlighting of the old selection range unless the selection range is being extended. If the mouse moves, meaning that a drag is occurring, TEClick expands or shortens the selection range accordingly a character at a time. In the case of a double-click, the word where the cursor is positioned becomes the
selection range.

SEE ALSO
For more information about the GlobalToLocal procedure, see the QuickDraw chapters in Inside Macintosh: Imaging.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996