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)


From: 3gl21@qlink.queensu.ca
Subject: GLoStDialAction.sit - support for live-scrolling scrollbars


GLoStDialAction class

Copyright © 1997 Gregory Lo. All rights reserved.

Description:

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

Notes:
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
this.

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

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
change
proc
* Changed to redraw the control completely after
tracking is
done
04Nov1997 * Restored the slop rectangle handling
* Changed some #ifdef's to #if's
* Updated documentation

Contacting the Author:

email: * gregory-lo@usa.net
* 3gl21@qlink.queensu.ca (before May, 1998)

License:

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.