WSCROLL_SET(3W)
Series 300 Only
NAME
wscroll_set − control of window scroll bar elevators and arrows
SYNOPSIS
int wscroll_set(fd,which,mode [ ,value [ ,min,max,size ]] );
int fd;
int which;
int mode;
int value;
int min,max,size;
DESCRIPTION
fd is an integer file descriptor of an opened graphics window type device interface.
which identifies whether vertical, horizontal, or both scroll bars are to be affected. This parameter can be set by OR’ing one or both of the following values, defined in window.h.
SCROLLBAR_V vertical scroll bar (in the right-hand border)
SCROLLBAR_H horizontal scroll bar (in the bottom border)
mode
controls the mode of the specified scroll bar. This parameter is set by OR’ing one or more of the following bit values, defined in window.h.
SCROLLBAR_ELEVATOR
enable the elevator.
SCROLLBAR_ARROWS
enable the arrows.
SCROLLBAR_USERMODE
enable user mode. If this is not set, then the default pan mode is used. If both SCROLLBAR_ELEVATOR and SCROLLBAR_USERMODE are set, then the value parameter must also be supplied.
SCROLLBAR_SCALE
meaningful only if the SCROLLBAR_USERMODE and SCROLLBAR_ELEVATOR are specified. If this is set, then the min, max, and size parameters must also be supplied.
value The position where the elevator should appear in the scroll bar within the min and max parameters, discussed next.
min The value to be associated with the upper (for SCROLLBAR_V) or left (for SCROLLBAR_H) end of the scroll bar.
If both SCROLLBAR_V and SCROLLBAR_H are set in the which parameter, then min is the same for both the horizontal and vertical scroll bar.
max The value to be associated with the lower (for SCROLLBAR_V) or right (for SCROLLBAR_H) end of the elevator. min must be less than max.
The elevator cannot be moved outside the range specified by min and max.
If both SCROLLBAR_V and SCROLLBAR_H are set in the which parameter, then min is the same for both the horizontal and vertical scroll bar.
size The size (on a scale of min to max of the elevator). For example, if min and max are -100 and +100, respectively, then setting size to 50 will cause the elevator to be one fourth the size of the scroll bar.
DISCUSSION
Wscroll_set enables or disables vertical and/or horizontal scroll bar elevators and arrows in the border of a window. Enabling or disabling scroll bar elevators or arrows has the side effect of turning on or off their visual representation.
There are two modes of operation for the scroll bars: pan mode and user mode. In pan mode, the size and position of an elevator are determined by the size and position of the view with respect to the raster. Completion of an interactive move of the elevator or activation of scroll arrows cause the window to pan. Conversely, panning the window via wpan(3W) causes the elevators to move.
In user mode, the size and position of the elevator are specified by the user in a user-supplied integer coordinate system and movement of an elevator or activation of a scroll arrow causes an event to occur. If the scale information is never supplied, defaults of 0 to 100 are used for min and max, and 10 is used for size.
To interactively move an elevator while in pan mode, position the pointer over the elevator and press a select button. This initiates an interactive operation which is echoed as a dotted box in the elevator “shaft.” Move the locator to position the box to the desired location and press a select button to complete the move. Elevator operations can be aborted in the same manner as any other interactive operation (e.g., press a key or timeout).
The activation of a user mode scroll bar arrow or elevator can be detected by enabling SIGWINDOW for the desired event via wsetsigmask(3W), then using weventpoll(3W) to determine what event occurred. It can also be detected using winput_read(3W) while the graphics window is in Mode 2 (see wgskbd(3W)). For elevator events, weventpoll(3W) will return which scroll bar (SCROLLBAR_V or SCROLLBAR_H) and the coordinate for the most recent elevator movement in x and y respectively. For arrow events, weventpoll(3W) will return in x and y the accumulated number of arrow events (x positive is right, y positive is down) since the last weventpoll(3W).
In user mode, activation of an elevator does not cause the elevator to move. The application must move the scroll bar by calling wscroll_set again with the value parameter set to the appropriate value.
When using elevators in pan mode, you may wish to reverse the sense of the border arrows; see the WMIUICONFIG environment variable in wmstart(1) for details on how to do this.
HARDWARE DEPENDENCIES
Series 500:
Scroll bar capabilities are not supported on Series 500; they work only on Series 300.
SEE ALSO
wscroll_get(3W), wsetsigmask(3W), weventpoll(3W), winput_read(3W).
DIAGNOSTICS
A return of -1 indicates failure; otherwise 0 is returned. See errno(2) for more information.
Hewlett-Packard Company — May 11, 2021