Define a slider
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Next you add a slider object to the window. A slider visually represents an INTEGER value within some range. In this case, you just make the slider show the same value as the Average Discount field, but as a percentage between 0 and 50.
To define a slider:
- Select the Slider icon from the Palette.
- Drop it onto the design window to the right of the Average Discount field.
- Change the Object name to iDiscPct. You see that the Label field is not enabled for the slider because a slider cannot have a label.
- Go into the property sheet for the slider and change the attribute values, as described in
the following table:
Table 1. iDiscPct attribute values Attribute Change value to . . . Description Max Value 50 Shows values in the range from 0 to 50 Tic Marks Top/Left Shows tic marks on the top of the slider Frequency 5 Shows tic marks every 5 units Horizontal true Displays the slider horizontally instead of vertically
Enable false Prevents the user from manipulating the slider object
When you finish, the property sheet should look like this:
- Click OK after making these changes.
- You want the slider value to display along with the other extra fields at the bottom
of the window each time the user selects a browse row, so edit the
VALUE-CHANGEDtrigger for the browse and replace the line that assigns thedAvgDiscfield and theDISPLAYstatement that follows it with these lines:ASSIGN dAvgDisc = (dTotalPrice - dTotalExt) / dTotalPrice iDiscPct = dAvgDisc * 100. DISPLAY dTotalPrice dTotalExt dAvgDisc iDiscPct cWorstWH cBestWH WITH FRAME CustQuery. - You can make the slider tall enough to show the percentage value above the slider
itself, or shrink it down vertically so that it just shows the slider itself. It
should show the same value as the Average Discount field it is next to:
Look at the code for a slider
Here is the AppBuilder-generated code for the slider:
|