Scroller (leaf, event)

An integer-valued scroll bar interactor. The full range of the scroll bar is gray, and the ``thumb'' is a white rectangular stripe somewhere within the scroll bar. The scroll bar represents the interval [Min .. Max], and the thumb represents the subinterval [Value .. (Value+Thumb)].


Value GP
(Integer, 50)

The current value; always between Min and Max-Thumb, inclusive.
Min GP
(Integer, 0)

The minimum value allowed.
Max GP
(Integer, 100)

The maximum value allowed. Value is within Min and Max-Thumb.
Thumb GP
(Cardinal, 0)

A non-negative number no greater than Max-Min.
Step GP
(Cardinal, 1)

The amount to increment or decrement Value when ``continuous scrolling.''
Vertical
(Boolean, FALSE)

If true, the scroll bar is oriented vertically, from south (Min) to north (Max). Otherwise, the scroll bar goes from west to east.

Behavior
The user can adjust the position of the thumb with the mouse. For the sake of explanation, suppose that the scroll bar is adjacent and attached (via an application program) to a column containing the numbers Min through Max. At any given time, Thumb+1 of the numbers (i.e., Value through Value+Thumb) are visible in the attached view.
The semantics of the mouse are as follows: A left click scrolls the view towards its end by moving the number at the mouse so it becomes the first number visible in the view. A right click scrolls the view towards its beginning by bringing the first number visible in the view to the position of the mouse. A middle click scrolls the view to the mouse by bringing the top of the thumb to the position of the mouse. Holding the left or right button without moving the mouse will cause (after a short time) continuous scrolling to begin. If you then drag the mouse, any continuous scrolling is terminated and the view scrolls with the mouse.
An event is generated after each time the Value of the scroll bar is changed. That can happen after any click, while continuous scrolling is in effect, and while dragging the mouse. When continuous scrolling causes the thumb to reach its limit, the scroll bar doesn't continue to generate events, since the value is no longer changing.
It is not unreasonable for the application to modify properties of the scroll bar (the thumb, in particular) while processing an event.
Notes
The scroll bar does not allow canceling.
Shape
Vertical sliders have a minimum size of 13x27 pixels, with infinite vertical stretch. Horizontal sliders have a minimum size of 27x13 pixels, with infinite horizontal stretch.