Info-Mac Archive Downloads: dev/src/ SourceCode

Back to dev/src/ SourceCode

GLoStDialAction.sit - support for live-scrolling scrollbars (glo-st-dial-action.hqx)

Download glo-st-dial-action.hqx (13,058 KB)

Subject: GLoStDialAction.sit - support for live-scrolling scrollbars

GLoStDialAction class

Copyright © 1997 Gregory Lo. All rights reserved.


This class provides support for live-scrolling with a standard
scroll-bar control.

Only a handle to the control, the point from which to start
tracking, and a pointer to a change-value-procedure is needed.

One need only instantiate a GLoStDialAction object, and use and
reuse it whenever live thumb-tracking is needed. For example:

GLoStDialAction theThumbTracker; :
theThumbTracker( myControlRef, thePoint, MyChangeValueProc );

theThumbTracker( anotherControl, anotherPoint, anotherProc );

The GLoStDialAction object is a functor -- an object that behaves
like a function. Its operator() has been overloaded to support

A convenience function, TrackIndicator(), is provided. An example

TrackIndicator( myControlRef, thePoint, MyChangeValueProc );

The change-value-procedure must be declared as follows:

void MyChangeValueProc( ControlRef inCntrl, const SInt32 inValue );

One should test that only the control's indicator is being pressed
before invoking the GLoStDialAction object. Hits in other parts of
the control can be handled in the normal fashion. (ie. call
::TrackControl() with or without a control action procedure).

Change history:

30Oct1997 * Changed to set the control value before calling the
* Changed to redraw the control completely after
tracking is
04Nov1997 * Restored the slop rectangle handling
* Changed some #ifdef's to #if's
* Updated documentation

Contacting the Author:

email: *
* (before May, 1998)


License is given to freely use this in any of your code:
commercial, or otherwise. Send me a postcard or email if you do.
Copyright © 1997 Gregory Lo. All rights reserved.