U_UPDATESB
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
xcall U_UPDATESB(scroll_id, maximum, current)
Arguments
scroll_id
The ID of the scroll bar window. (n)
maximum
The new maximum value. (n)
current
The new current value. (n)
Discussion
U_UPDATESB updates a scroll bar window in Unix and OpenVMS environments. (This routine does work on Windows, but the results are non-standard.)
A scroll bar’s progress/regress indicator shows the relationship of what is currently displayed versus the total possible. (For example, you may only be viewing 10 out of a possible 100 entries in a list.) This relationship is referred to as the “ratio of current to maximum.”
The ratio of current to maximum is used to determine the placement of the progress/regress indicator within the scroll bar window. There are a few special cases where this ratio is superseded:
- If maximum is 0, the indicator is not placed.
- If current is 1, the indicator is always placed at position 1.
- If current is equal to maximum, the indicator is always placed at the last position.
- If the ratio of current to maximum results in an indicator position outside the window (for example, less than 1 or greater than the window size), the indicator’s position will be limited to those bounds.
The endpoint indicators, if used, are displayed according to the following rules:
- If current is 1 or less, the “no more at beginning” indicator is displayed, otherwise the “more at beginning” indicator is displayed.
- If current is equal to or greater than maximum, the “no more at end” indicator is displayed, otherwise the “more at end” indicator is displayed.
See also
- U_CREATESB routine for information about how to create a scroll bar window
- U_CHARSB routine for information about how to copy or load scroll bar characters
Examples
The following example would place the indicator at position 1. This could indicate that the user is viewing the first part of the list. If present, the endpoint indicators would be showing “no more at beginning” and “more at end.”
xcall u_updatesb(scrlid, 50, 1)
The second example updates the indicator which could reflect that the user is viewing approximately the middle of the list. If present, the endpoint indicators would be showing “more at beginning” and “more at end.”
xcall u_updatesb(scrlid, 50, 25)