On Tue, 2002-12-10 at 22:58, DeVon Fowler wrote: > Are there any glue or helper functions to assist using > Scroll Bars with a table in Palm OS5? Don't seem to > be able to recognize which area of a scroll bar has > generated the sclEnterEvent or sclExitEvent without > accessing the attr structure. Any ideas would be > appreciated.
The O'Reilly book 'Palm Programming: The Developer's Guide' by Rhodes & McKeehan has a good example of how to use a scrollbar with a table (and many other things to do with tables, like edittable number fields, custom data types, etc.). This book was a *huge* timesaver for me, I strongly recommend it. Basically, you don't use either the sclEnterEvent or the sclExitEvent, you use the sclRepeatEvent. The number of rows scrolled can be calculated from this event by: numrows = event->data.sclRepeat.newValue - event->data.sclRepeat.value; It'll be negative for scrolling up, and positive for scrolling down. So you adjust your topmost table item, and redraw the table, and Bob's your uncle. -Ken -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
