Important: The information in this document is obsolete and should not be used for new development.
TrackBox
Use theTrackBoxfunction 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
wherefield in the event record.partCode- The part code (either
inZoomInorinZoomOut) returned by theFindWindowfunction.DESCRIPTION
TheTrackBoxfunction 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,TrackBoxhighlights 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,
TrackBoxremoves the highlighting from the zoom box and returnsTRUEif the cursor is within the zoom region andFALSEif it is not.Your application calls the
TrackBoxfunction when it receives a result code of eitherinZoomInorinZoomOutfrom theFindWindowfunction. IfTrackBoxreturnsTRUE, your application calculates the standard state, if necessary, and calls theZoomWindowprocedure to zoom the window. IfTrackBoxreturnsFALSE, 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 TrackBoxas long as the mouse button is held down. (If there's anactionProcprocedure, theactionProcprocedure 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 callsTrackBoxto track cursor activity when the user presses the mouse button while the cursor is in the zoom box.