FUNCTION_BLOCK FB_SLIDER

An instance of the function block type shown below provides a bar whose color is determined by the BKGD input with an indicator whose color is determined by the FGD input. The height and width of the bar are determined by the H and W inputs, respectively. The function block provides an unsigned integer (UINT) output OUT in the range {0..100} whose value corresponds to the percentage displacement of the indicator in the bar, which in turn is determined by both its position and the orientation of the bar, given by the DIR input. The figures below show the position of the indicator when OUT=25 for the four possible values of the DIR input with FGD=COLOR#red and BKGD=COLOR#blue.

The initial position of the indicator is given by the IVAL input. A mouse click on the bar causes the indicator to move one unit toward the mouse position and generates an IND event output to indicate the correspondingly updated OUT value. Dragging the mouse with the button down in the bar generates a sequence of IND events and correspondingly updated OUT values.

DIR=0
(L==>R)
W=100
H=25
OUT=25

DIR=1
(T==>B)
W=25
H=100
OUT=25

DIR=2
(R==>L)
W=100
H=25
OUT=25
DIR=3
(B==>T)
W=25
H=100
OUT=25
[Sliders Image]

[Viewer Help]

Last updated: 2006-04-15.
©2006 Holobloc Inc
Licensed under the Academic Free License version 3.0.