Next Previous Up Top Contents Index

8.11 DUIM-Gadgets Module

<scroll-bar>

Open abstract instantiable class

Summary

The class of scroll bars.

Superclasses

<value-range-gadget>

Init-keywords

orientation:
An instance of type one-of(#"horizontal", #"vertical", #"none"). Default value: #"none".

value-changing-callback:

An instance of type <function>.

value-changed-callback:

An instance of type <function>.

slug-size:
An instance of type <real>.

Library

duim-gadgets

Module

duim-gadgets

Description

The instantiable class that implements an abstract scroll bar.

Figure 8.32 A vertical scroll bar

The orientation: init-keyword defines whether the scroll bar is horizontal or vertical.

The value-changing-callback: init-keyword is the callback that is invoked when the gadget value is in the process of changing, such as when the scroll bar slug is dragged.

The value-changed-callback: init-keyword is the callback that is invoked when the gadget value has changed, such as when the scroll bar slug has come to rest after being dragged. You could use this callback, for example, to refresh the screen in your application to show a different part of a sheet, after the scroll bar had been moved.

The slug-size: init-keyword defines the size of the slug in the scroll bar, as a proportion of value-range:. For example, if value-range: is from 0 to 100, and slug-size: is 25, then the slug occupies a quarter of the total length of the scroll bar. The slug is the part of the scroll bar that can be dragged up and down, and represents how much of the sheet being scrolled is visible.

Note: The Microsoft Windows Interface Guidelines refer to the slug as a scroll-box, and the area in which the slug can slide as the scroll-shaft. You should be aware of this difference if you are using those guidelines as a reference.

Internally, this class maps into the Windows scroll bar control.

Operations

gadget-slug-size gadget-slug-size-setter

Example

As an example of how the slug-size: init-keyword operates, compare the two examples of scroll bars below. The second scroll bar has a slug that is twice the size of the first.

contain(make(<scroll-bar>, 
             value-range: range(from: 0, to: 100)
             slug-size: 10));
contain(make(<scroll-bar>, 
             value-range: range(from: 0, to: 100)
             slug-size: 20));

See also

<slider>, page 644


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index