Gadget class. More...
#include <ilviews/gadgets/slider.h>
Public Member Functions | |
IlvSlider (IlvDisplay *display, const IlvPoint &p, IlvDim size, IlvOrientation orientation=IlvLeft, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlvSlider (IlvDisplay *display, const IlvRect &rect, IlvOrientation orientation=IlvLeft, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0) | |
Constructor. More... | |
IlInt | getMax () const |
Returns the maximum value of the slider. More... | |
IlInt | getMin () const |
Returns the minimum value of the slider. More... | |
IlvOrientation | getOrientation () const |
Returns the slider orientation. More... | |
IlInt | getPageIncrement () const |
Returns the page increment value of the slider. More... | |
IlvDim | getSliderSize () const |
Returns the slider size. More... | |
IlvOrientation | getThumbOrientation () const |
Returns the orientation of the slider thumb. More... | |
IlInt | getValue () const |
Returns the current value of the slider. More... | |
void | getValues (IlInt &min, IlInt &max, IlInt &value, IlvDim &sSize) const |
Returns all the parameters of the slider. More... | |
IlInt | positionToValue (const IlvPoint &point, const IlvTransformer *t=0) const |
Returns the value stored in this object when the slider is located at the specified point. More... | |
void | setOrientation (IlvOrientation orientation) |
Sets the slider orientation. More... | |
void | setPageIncrement (IlInt value) |
Sets the page increment value of the slider. More... | |
void | setThumbOrientation (IlvOrientation orientation) |
Sets the orientation of the slider thumb. More... | |
void | setValue (IlInt value, IlBoolean redraw=IlFalse) |
Sets the slider value. More... | |
void | setValues (IlInt min, IlInt max, IlInt value) |
Sets the minimum, maximum, and current values for the slider. More... | |
void | setValues (IlInt min, IlInt max, IlInt value, IlvDim size) |
Sets the minimum, maximum, and current values of the slider. More... | |
virtual void | valueChanged () |
Is called whenever the user changes the value of the slider. More... | |
Friends | |
class | IlvDefaultSliderLFHandler |
Gadget class.
Library: ilvgadgt
The IlvSlider
class displays a rectangle containing a slider box that indicates a value.
Sliders
The slider box can be moved by dragging it along the slider area, therefore changing the current slider value.
Name | Type | Equivalent methods |
---|---|---|
minValue | Int | getMin() , setValues() |
maxValue | Int | getMax() , setValues() |
value | Int | getValue() , setValues() |
sliderSize | UInt | getSliderSize() , setValues() |
pageIncrement | Int | getPageIncrement() , setPageIncrement() |
orientation | Direction | getOrientation() , setOrientation() |
thumbOrientation | Direction | getThumbOrientation() , setThumbOrientation() |
Graphic property | CSS property | Type |
---|---|---|
Background color | background-color | Color |
IlvSlider::IlvSlider | ( | IlvDisplay * | display, |
const IlvRect & | rect, | ||
IlvOrientation | orientation = IlvLeft , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvSlider
class. The default minimum value is set to 0
. The default maximum value is set to 100
. The default current value is set to 50
, and the default slider size is set to 10
.
display | The connection to the display. |
rect | The size and position of the slider. |
orientation | The orientation of the slider. Valid values are: IlvLeft , IlvRight , IlvTop , and IlvBottom . |
thickness | The thickness of the slider. |
palette | The palette used to draw the slider. Note: The slider cursor (or thumb) size and the orientation impact the way it is displayed. If the orientation is vertical (that is IlvLeft or IlvRight) and the width of the rectangle is too small, the thumb will not be visible. Similarily, if the orientation is horizontal (that is IlvTop or IlvBottom) and the height of the rectangle is too small, the thumb will not be visible. |
IlvSlider::IlvSlider | ( | IlvDisplay * | display, |
const IlvPoint & | p, | ||
IlvDim | size, | ||
IlvOrientation | orientation = IlvLeft , |
||
IlUShort | thickness = IlvDefaultGadgetThickness , |
||
IlvPalette * | palette = 0 |
||
) |
Constructor.
Initializes a new instance of the IlvSlider
class. The default minimum value is set to 0
. The default maximum value is set to 100
. The default current value is set to 50
, and the default slider size is set to 10
.
display | The connection to the display. |
p | The position of the slider. |
size | The size of the slider. |
orientation | The orientation of the slider. Valid values are: IlvLeft , IlvRight , IlvTop , and IlvBottom . |
thickness | The thickness of the slider. |
palette | The palette used to draw the slider. |
IlInt IlvSlider::getMax | ( | ) | const |
Returns the maximum value of the slider.
setValues()
, getMin()
. IlInt IlvSlider::getMin | ( | ) | const |
Returns the minimum value of the slider.
setValues()
, getMax()
. IlvOrientation IlvSlider::getOrientation | ( | ) | const |
Returns the slider orientation.
IlInt IlvSlider::getPageIncrement | ( | ) | const |
Returns the page increment value of the slider.
setPageIncrement()
. IlvDim IlvSlider::getSliderSize | ( | ) | const |
IlvOrientation IlvSlider::getThumbOrientation | ( | ) | const |
Returns the orientation of the slider thumb.
setThumbOrientation()
. IlInt IlvSlider::getValue | ( | ) | const |
Returns all the parameters of the slider.
setValues()
. IlInt IlvSlider::positionToValue | ( | const IlvPoint & | point, |
const IlvTransformer * | t = 0 |
||
) | const |
Returns the value stored in this object when the slider is located at the specified point.
point | The point where the slider is located. |
t | The transformer applied to this object. |
void IlvSlider::setOrientation | ( | IlvOrientation | orientation | ) |
Sets the slider orientation.
orientation | The new slider orientation. Valid values are: IlvTop (vertical slider with its minimum value at the top), IlvBottom (vertical slider with its minimum value at the bottom), IlvLeft (horizontal slider with its minimum value on the left), IlvRight (horizontal slider with its minimum value on the right). IlvVertical is equivalent to IlvTop and IlvHorizontal to IlvLeft . |
void IlvSlider::setPageIncrement | ( | IlInt | value | ) |
Sets the page increment value of the slider.
The page increment value is the value added to the slider value when the user presses the PageUp key or clicks outside the slider.
value | The new page increment value. |
getPageIncrement()
. void IlvSlider::setThumbOrientation | ( | IlvOrientation | orientation | ) |
Sets the orientation of the slider thumb.
This value is used to compute the thumb that is drawn on the slider track. This value is only used in the Microsoft Windows 95 or ViewsX look-and-feel.
orientation | The new thumb orientation. The valid values are: IlvTop , IlvBottom , or both, for an horizontal slider, and IlvLeft , IlvRight , or both, for a vertical slider. |
Sets the slider value.
value | The new slider value. |
redraw | Specifies whether the slider should be redrawn. |
getValue()
. Sets the minimum, maximum, and current values for the slider.
min | The minimum slider value. |
max | The maximum slider value. |
value | The current slider value. |
getValues()
. Sets the minimum, maximum, and current values of the slider.
min | The minimum slider value. |
max | The maximum slider value. |
value | The current slider value. |
size | The slider size. |
getValues()
.
|
virtual |
Is called whenever the user changes the value of the slider.
The default implementation calls the Main callback of the slider.