Progress
Language Tutorial
for Windows
Slider Programming Example
Follow these steps to contrast horizontal and vertical sliders.
- Open
lt-07-07a.p
and run it. The following display appears:
![]()
- To change the value, drag the pointer located in the trackbar. At each increment, the value changes, a trigger executes, and the X character moves.
- Press TAB to move to the second slider, or just click on the pointer in the second slider.
- Use the cursor keys to move the pointer. At each increment, the value changes, a trigger executes, and the X character moves.
- Choose Exit, then press SPACEBAR to return to the Procedure Editor.
Here is the code that created the sliders:
These notes help explain the code highlights:
- The first slider is horizontal and displays the X coordinate of the character that moves within the area of the sliders. Tic marks are defined for every fifth position in the range and the tic marks display on the bottom of the slider. The NO-CURRENT-VALUE option indicates that the current value of a position on the slider will not automatically display.
- The second slider is vertical and displays the Y coordinate of the character. This slider also has tic marks defined for every numeric position in the defined range. The tic marks display on the right-hand side of the slider. Also, the LARGE-TO-SMALL option is defined; for this vertically orientated slider, this means that the bottom most position on the trackbar displays the maximum value and the top most position displays the minimum value of the range. The NO-CURRENT-VALUE is set indicating the current position of the pointer on the slider will not automatically display.
- On VALUE-CHANGED of either slider, this trigger moves the character to the appropriate position.
- The ROW and COL attributes specify the location of the widget within a frame.
NOTE: Keep in mind that ToolTip information can be added to a slider widget. Refer to the code examples in either the Toggle Box Programming Example or the Radio Set Programming Example presented earlier in this chapter that show how to define the TOOLTIP option.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |