VScrollbar

(System Library)

Description: Draws a vertical scroll bar and returns its position.
Returns: Numeric
Usage: Steady State only.
Function Groups: Graphics
Related to: Bevel | CheckBox | ColorSelect | DropList | DropTree | Edit | GridList | HScrollbar | Listbox | RadioButtons | SpinBox | SplitList | TextBox | ToolBar
Format:  System.VScrollbar(Left, Bottom, Height, Steps, PageLen[, Position, StepSize, MouseWheelInputObj])
Parameters:  
Left
Required. Any numeric expression for the left side coordinate of the scrollbar.
Bottom
Required. Any numeric expression for the bottom coordinate of the scrollbar.
Height
Required. Any numeric expression for the height of the scrollbar in pixels.
Steps
Required. Any numeric expression giving the number of steps in the scrollbar.
PageLen
Required. Any numeric expression giving the number of steps in each page.
Position
Optional numeric. This variable may be used to monitor or set the current scroll position.
StepSize  
Optional. Any numeric expression giving the number of lines to scroll through when the user clicks on an arrow. Defaults to 1 if not specified.
MouseWheelInputObj

The Window object that should capture mouse wheel messages for this VScrollbar. Every VScrollbar module requires a unique source window in order for mouse wheel scrolling to function properly. On the server and the VIC, this parameter is used so that scroll wheel events that happen over MouseWheelInputObj's window are redirected to the VScrollbar.

On the Anywhere Client, in addition to redirecting scroll wheel events as above (if the client's platform happens to have a mouse), this parameter is also necessary to redirect vertical touch panning events over a given region to the VScrollbar. This is of increased importance because on most touch screen devices, you cannot touch and drag the scrollbar directly, so this kind of touch redirection is often the only way to scroll a VScrollbar.

Comments:

This module is a member of the System Library, and must therefore be prefaced by \System. as shown in the "Format" section.

If your application predates version 11.2, use the backslash notation rather than dot: \System\

 

Steps can be calculated by subtracting the number of visible items from the total number of scrollable items.

PageLen is equal to the number of visible items.

Items can be thought of as rows, where a row will have a height of N pixels. As an example, consider an Alarm Page that is showing 50 alarms, where only 20 of them are visible. The operator needs to click the down arrow on the scrollbar 30 times to reach the bottom of the alarm list, so Steps would be set to 30. If the operator clicks on the scrollbar area other than the tab, they expect to see it scroll by a "page", which in this example is 20 rows. PageLen would therefore be set to 20. In some situations you may want the down arrow to move more than one row at a time, say 3 rows, so you would set StepSize to 3. Note that there is no need to provide the width of the row in pixels to VScrollbar.


Custom script graphics using the VScrollbar module directly need to pass in a window object to serve as source for the mouse wheel messages. Typically this would be the window that the VScrollbar module is controlling. Note that the VScrollbar module itself uses a native windows scrollbar, which will therefore work automatically without any script changes, so long as the mouse pointer is over the actual scrollbar.

Example:

System.VScrollBar(VStatus(Self, 11) - VStatus(Self, 21)
                 { Left }, 
                 VStatus(Self, 12) - 1 { Bottom },
                 VStatus(Self, 12) { Height },
                 Length - LinesVisible { Total steps }, 
                 LinesVisible { Steps in page }, 
                 Position { Thumb tab pos });