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: Macintosh Toolbox Essentials /
Chapter 4 - Window Manager / Window Manager Reference
Window Manager Routines / Zooming Windows


TrackBox

Use the TrackBox 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 or inZoomOut) returned by the FindWindow function.
DESCRIPTION
The TrackBox 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 returns TRUE if the cursor is within the zoom region and FALSE if it is not.

Your application calls the TrackBox function when it receives a result code of either inZoomIn or inZoomOut from the FindWindow function. If TrackBox returns TRUE, your application calculates the standard state, if necessary, and calls the ZoomWindow procedure to zoom the window. If TrackBox returns FALSE, your application
does nothing.

ASSEMBLY-LANGUAGE INFORMATION
You can set the global variable DragHook 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 an actionProc procedure, the actionProc 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 calls TrackBox to track cursor activity when the user presses the mouse button while the cursor is in the zoom box.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996