ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / Range Slider control
  • Overview
  • Retrieving the characteristics of the Range Slider control
  • Characteristics that can be retrieved through programming
  • Value of the Range Slider control
  • Finding out the bounds of the Range Slider control
  • Finding out the total range and the visible range of the Range Slider control
  • Modifying the value of the Range Slider control
  • Properties specific to the management of a Range Slider control
  • Example of code for using a Range Slider control to zoom on an image
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Overview
WINDEV allows you to handle a Range Slider control through programming. To do so, use the variable of the Range Slider control in the code.
The variable of the Range Slider control:
  • corresponds to the name of the Range Slider control.
  • is initialized with the value of the Range Slider control.
Retrieving the characteristics of the Range Slider control

Characteristics that can be retrieved through programming

The characteristics that can be retrieved through programming are as follows:

Value of the Range Slider control

The value of the Range Slider control corresponds to:
  • the position of the left extremity of the box of a horizontal Range Slider control.
  • the position of the top extremity of the box of a vertical Range Slider control.
To retrieve the value of the Range Slider control, use the following syntax:
<Position> = <Name of Range Slider>
<Position> is an integer variable.
Remark: You can also use the Value property.

Finding out the bounds of the Range Slider control

The MaxValue and MinValue properties are used to get the upper and lower bounds of the Range Slider control.
The lower bound corresponds to the value of the extremity of the Range Slider control:
  • left extremity for a horizontal Range Slider control
  • top extremity for a vertical Range Slider control.
The upper bound corresponds to the maximum value that can be taken by the Range Slider control with the current configuration of the box of the Range Slider control.
Example:
Bounds of the Range Slider control
In this example, in position 1:
  • the value of the Range Slider control is 21.
  • the lower bound is 1.
  • the upper bound is 40. This upper bound corresponds to the value of the Range Slider control when the box of the Range Slider control is positioned at the maximum extremity. This case corresponds to position 2. This bound corresponds to the following calculation: Lower bound + (Total range - Visible range).

Finding out the total range and the visible range of the Range Slider control

The TotalRange and VisibleRange properties are used to get the total range and the visible range of the Range Slider control.
Modifying the value of the Range Slider control
To modify the value of the Range Slider control, use the following syntax:
<Name of Range Slider> = <Value>
<Value> is a value included between the minimum value and the maximum value of the Range Slider control. These values have been defined in the control description window or programmatically with the MinValue and MaxValue properties (the upper bound depends on the visible range and the total range).
For example, for a Range Slider control with the following charateristics:
  • LowerBound = 1
  • TotalRange = 5
  • VisibleRange = 2
The upper bound will be 4 (1 + 5 -2)
The possible values will be 1, 2, 3 and 4
Remark: You can also use the Value property to change the value of the Range Slider control.
Properties specific to the management of a Range Slider control
The following properties are used to manage the characteristics of a Range Slider control through programming.
MaxValueUsed to find out and modify the upper bound of a Range Slider control.
MinValueUsed to find out and modify the lower bound of a Range Slider control.
ScrollUsed to find out and modify the value of the scroll step for a Range Slider control.
ScrollValueUsed to find out and modify the value of the increment step for a Range Slider control.
TotalRangeUsed to find out and modify the total number of data represented by the Range Slider control.
VisibleRangeUsed to find out and modify the width of the scrollbar box in a Range Slider control.

For a complete list of WLanguage properties that can be used with a Range Slider control, see Properties associated with Range Slider controls.
Example of code for using a Range Slider control to zoom on an image
The following code is called whenever a Range Slider control is modified and it used to perform a zoom on an image area defined by the visible range of the Range Slider control.
PROCEDURE DisplayImage()
 
// Copy the area corresponding to the zoom bar of the two Range Slider controls
// (1 horizontal and 1 vertical) in the entire destination Image control
dCopyImage(IMG_SOURCE, IMG_DESTINATION, copySrcCopy, ... // "Direct" copy
// Lower bound of Range Slider
RGS_HORIZONTAL.Value, RGS_VERTICAL.Value, ...
// The entire width of the zoom area
RGS_VERTICAL.VisibleRange, RGS_HORIZONTAL.VisibleRange, ...
// Copy into the destination control at the top left
1, 1, ...
// Copy into the destination control on the entire surface
IMG_DESTINATION.Height, IMG_DESTINATION.Width)
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment

Last update: 02/10/2023

Send a report | Local help