Navigation: Language Reference > 8 - Controls > Control Declarations >====== SLIDER (declare a Slider control) ====== | |
SLIDER, AT( ) , [,USE( )] [,CURSOR( )] ,[,LAYOUT( )] [,DISABLE] [,FULL] [,SCROLL] [,HIDE]
[COLOR()], [,MSG()], [,TRN] [, [,DROPID( )] [,RANGE( )] [,VERTICAL( )],[STEP()],[BOTH, ABOVE, BELOW] |
SLIDER | Places a control that enables the end user to move a thumb along either a horizontal or vertical line within a finite range. |
AT | Specifies the initial size and location of the control (PROP:AT). If omitted, default values are selected by the runtime library. |
CURSOR | Specifies a mouse cursor to display when the mouse is positioned over the control (PROP:CURSOR). If omitted, the WINDOW's CURSOR attribute is used, else the Windows default cursor is used. |
USE | The label of the variable containing the value of the current tick mark, or a field equate label to reference the control in executable code (PROP:USE). |
LAYOUT | Specifies the control's left-to-right or right-to-left display orientation (PROP:LAYOUT) |
MSG | Specifies a string constant containing the text to display in the Window's status bar when the control has focus. (PROP:MSG) |
DISABLE | Specifies the control appears dimmed when the WINDOW or APPLICATION is first opened (PROP:DISABLE). |
HIDE | Specifies the control does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it. |
TRN | Specifies the control transparently displays over the background (PROP:TRN). |
COLOR | Specifies a background color for the control (PROP:COLOR). |
DROPID | Specifies the control may serve as a drop target for drag-and-drop actions (PROP:DROPID). |
RANGE | Specifies the range of values the Slider displays (PROP:RANGE). If omitted, the default range is zero (0) to one hundred (100). |
STEP | Specifies the numeric value between Ticks. (PROP:STEP) |
NOTICKS | Specifies whether the Slider displays tick marks,and if so where they display (Ticks are on by default). The options for location of the tick marks for a horizontal Slider are Below, Above or Both. The options for location of the tick marks for a vertical Slider are Right, Left or Both. You can also choose that no tick marks are displayed at all. (PROP:NOTICKS) |
VERTICAL | Specifies the Slider control is oriented vertically instead of horizontally. (PROP:VERTICAL) |
The SLIDER control declares a control that displays a Slider bar in a WINDOW (not valid in a REPORT).
If a variable is named as the USE attribute, the Slider's tick mark position is automatically updated whenever the value in that variable changes. If the USE attribute is a field equate label, you must directly update the display by assigning a value (within the range defined by the RANGE attribute) to the control's RANGE property. The RANGE can be set at runtime with the PROP:RANGE property.
Example:
SliderPos LONG
Window WINDOW('SLIDER Example'),AT(,,300,170),GRAY,AUTO,SYSTEM,MAX,FONT('MS Sans' & |
' Serif',8)
STRING('test'),AT(110,8),USE(?STRINGTotal)
SLIDER,AT(120,30,34,122),USE(SliderPos),RANGE(1,100),STEP(10),VERTICAL,RIGHT
BUTTON('Button1'),AT(214,135),USE(?BUTTON1)
END
CODE
SliderPos = 50
ACCEPT
CASE ACCEPTED()
of ?SliderPos
?STRINGTotal{PROP:Text} = ?SLIDERPos{PROP:sliderpos} & '%'
END
END
END
CLOSE(Window)
Runtime properties:
Events:
EVENT:Accepted | generated after moving the slider's thumb to a new position or when the parent window is in non-stop mode |
EVENT:NewSelection | generated while dragging slider's thumb with the mouse (only generated for SLIDER controls with IMM) |
EVENT:Selecting | generated the same as for other controls with focus |
EVENT:Selected | generated the same as for other controls with focus |
EVENT:Drop | generated if the control has the DROPID attribute |