Chapter 15.  Progress Bars, Sliders, and Scrollbars

The three built-in control classes, ProgressBar, Slider, and Scrollbar, are variations on a single theme: each provides a visual representation of a numeric value in terms of its position along a scale. They differ, however, in details of appearance and usage:[109]

  • A ProgressBar displays a “thermometer,” such as might provide the user with visual feedback as to the progress of a time-consuming task.

  • A Slider displays a horizontal or vertical “slot” with a “knob”; the user can slide the knob along the slot, like a sliding control on a piece of audio equipment, and can click in the slot to move the knob by a fixed amount.

  • A Scrollbar displays a standard horizontal or vertical scrollbar, with arrows at each end and a scroll box (or thumb) between. The user can slide the thumb, click the arrows to move the thumb by a small fixed amount, or click the gray areas on either side of the thumb to move the thumb by a larger fixed amount.

The numeric values for these controls must lie between -32768 and 32767. This is because, owing to the way they are implemented by the Macintosh Toolbox, the value is actually a short integer (two bytes).

A ProgressBar, Slider, or Scrollbar is a RectControl, and therefore receives all the events and has all the methods and properties listed in Chapter 10: Open and Close events; Visible, Enabled, and AutoDeactivate properties; Top, Left, Height, and Width properties; LockLeft, LockRight, LockTop, ...

Get REALBasic: TDG, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.