Important: The information in this document is obsolete and should not be used for new development.
TrackBox
Use theTrackBox
function to track the cursor when the user presses the mouse button while the cursor is in the zoom box.
FUNCTION TrackBox (theWindow: WindowPtr; thePt: Point; partCode: Integer): Boolean;
theWindow
- A pointer to the window record of the window in which the mouse button was pressed.
thePt
- The location of the cursor when the mouse button was pressed. Your application receives this point from the
where
field in the event record.partCode
- The part code (either
inZoomIn
orinZoomOut
) returned by theFindWindow
function.DESCRIPTION
TheTrackBox
function tracks the cursor when the user presses the mouse button while the cursor is in the zoom box, retaining control until the mouse button is released. While the button is down,TrackBox
highlights the zoom box while the cursor is in the zoom region, as illustrated in Figure 4-20 on page 4-47.When the mouse button is released,
TrackBox
removes the highlighting from the zoom box and returnsTRUE
if the cursor is within the zoom region andFALSE
if it is not.Your application calls the
TrackBox
function when it receives a result code of eitherinZoomIn
orinZoomOut
from theFindWindow
function. IfTrackBox
returnsTRUE
, your application calculates the standard state, if necessary, and calls theZoomWindow
procedure to zoom the window. IfTrackBox
returnsFALSE
, your application
does nothing.ASSEMBLY-LANGUAGE INFORMATION
You can set the global variableDragHook to point to an optional procedure, defined by your application, which will be called by TrackBox
as long as the mouse button is held down. (If there's anactionProc
procedure, theactionProc
procedure is called first.) Note that the use of the Window Manager's global variables is not guaranteed to be compatible with system software versions later than System 6.SEE ALSO
See Listing 4-12 on page 4-55 for an example that callsTrackBox
to track cursor activity when the user presses the mouse button while the cursor is in the zoom box.