home *** CD-ROM | disk | FTP | other *** search
- # include "BlobMgr.h"
-
-
- /*
- * Track the mouse while the button is held down. Invert the given
- * blob region whenever the mouse is in the region. Return true if
- * the mouse is released inside of the region, false otherwise.
- */
-
- pascal Boolean
- BTrackMouse (BlobHandle b, Point startPt, short partCode)
- {
- Boolean inBlob;
- RgnHandle rgn;
- Point pt;
-
- rgn = BCalcRegion (b, partCode);
- pt = startPt;
- inBlob = false;
- for (;;)
- {
- if (PtInRgn (pt, rgn) != inBlob) /* invert on change of state */
- {
- InvertRgn (rgn);
- inBlob = !inBlob;
- }
- if (!StillDown ())
- break;
- GetMouse (&pt);
- }
- if (inBlob) /* leave region uninverted */
- InvertRgn (rgn);
- DisposeRgn (rgn);
- return (inBlob);
- }
-