


With the use of the SCROLL-BAR control, a user can "scroll through" a continuous range of items. This control has five elements--next and previous line buttons, next and previous page regions, and a slider (also called a "thumb"), which indicates the current position in the range.
When a user clicks on a scroll bar, a message is sent to the scroll bar's event procedure, which updates the screen according to the new scroll position. (For a detailed description of these events, see Chapter 6, "Events Reference.") Scroll bars do not generate terminating events, so any ACCEPT statement remains active while the user adjusts the scroll bar. The scroll bar does not automatically update its own value when the user modifies it. You should respond to each message by setting the scroll bar's value to the new position. Otherwise, the scroll bar will return to its previous setting after the user finishes.
Common Properties
TITLE
Scroll bars do not have titles.
VALUE
A scroll bar has an integer value, which represents the slider's position in the control. The range of values is set by the properties MIN-VAL, MAX-VAL, and PAGE-SIZE, which are described below. Setting the value outside of the legal range has an undefined effect.
SIZE
SIZE and LINES describe the area of the scroll bar in window cells. If SIZE is omitted, then the width of a vertical scroll bar is the standard width of the host system's scroll bar. A horizontal scroll bar extends to the right edge of the window when the scroll bar is created. If LINES is omitted, then the system makes corresponding calculations--a horizontal scroll bar is standard height, and a vertical scroll bar extends to the bottom edge.
COLOR
Scroll bars always use the system's colors.
STYLES
HORIZONTAL This style creates a horizontal scroll bar. Without this style, the scroll bar is vertical.
TRACK-THUMB This style causes the scroll bar to generate MSG-SB-THUMBTRACK messages while the slider is moved by the user. Without this style, the messages are suppressed. Use this style if you want to update the screen while the user is moving the slider (as opposed to immediately after a new slider position is selected).
Special Properties
MIN-VAL (numeric) This property sets the lowest value of the range of legal scroll bar values. The default value is "0" (zero).
MAX-VAL (numeric) This property sets the highest value of the range of legal scroll bar values. The default value is "100". MAX-VAL may not be greater than 65536. Setting a larger range has an undefined effect. See PAGE-SIZE below for additional information.
PAGE-SIZE (numeric) This property describes the number of elements that appear on a "page" of data. For example, if you scroll through a series of lines and 20 lines fit in the window, then the page size is "20". With a 32-bit runtime, this property determines the size of the slider relative to the scroll bar. If PAGE-SIZE is set to "0" (the default), then the system uses a default slider size. PAGE-SIZE also reduces the range of values that the scroll bar can take. The effective range is MIN-VAL to MAX-VAL minus PAGE-SIZE.
Events
CMD-HELP
MSG-VALIDATE
MSG-SB-NEXT
MSG-SB-PREV
MSG-SB-NEXTPAGE
MSG-SB-PREVPAGE
MSG-SB-THUMB
MSG-SB-THUMBTRACK