Range Based Widgets Overview
In This Topic
Range based widgets are widgets, which display a range and a current value. The range is defined by the Minimum and the Maximum properties of the range based widget, and the current value is stored in the Value property. When the Value changes the ValueChanged event is fired.
Range Based Widgets Class Hierarchy
The image below shows range base descendants:
Range Base
All range based widgets possess the following properties:
- Minimum - defines the minimum value supported by the range element.
- Maximum - defines the maximum value supported by the range element.
- Value - stores the current value of the range element. When this element changes, the ValueChanged event is fired.
The NRangeBase class also provides an useful method called ClampValue(double value), which ensures that the given value is within the supported range.
Scroller Base
All scroller base widgets like sliders and scrollbars inherit the NScrollerBase class. It extends NRangeBase with the following properties:
- SmallChange - defines the small change step, which is the step with which the scroller value is changed when user clicks the increase or the decrease button of a scrollbar.
- LargeChange - defines the large change step, which is the steps with which the scroller value is changed when the user clicks the shaft of a scrollbar or a slider.
- SnappingStep - defines the step to which the scroller values should snap to, for example if set to 2, when the user drags the scroller thumb it will jump with a step of two - 0, 2, 4, 6, 8, 10, etc. By default set to 0, which means that no snapping will be applied to the scroller value.
The NScrollerBase class also provides a useful method called SnapValue(double value), which snaps the given value to the current SnappingStep.