Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IlvSlider Class Reference

Gadget class. More...

#include <ilviews/gadgets/slider.h>

Inheritance diagram for IlvSlider:
IlvGadget IlvSimpleGraphic IlvStylable IlvGraphic IlvValueInterface

Public Member Functions

 IlvSlider (IlvDisplay *display, const IlvRect &rect, IlvOrientation orientation=IlvLeft, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
 IlvSlider (IlvDisplay *display, const IlvPoint &p, IlvDim size, 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, IlvDim size)
 Sets the minimum, maximum, and current values of the slider. More...
 
void setValues (IlInt min, IlInt max, IlInt value)
 Sets the minimum, maximum, and current values for the slider. More...
 
virtual void valueChanged ()
 Is called whenever the user changes the value of the slider. More...
 

Friends

class IlvDefaultSliderLFHandler
 

Detailed Description

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.

Accessors

Accessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods IlvValueInterface::queryValue(), IlvValueInterface::queryValues(), IlvValueInterface::changeValue(), IlvValueInterface::changeValues(). This class inherits the accessors of its superclass IlvGadget and adds the following ones:

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()

Styling

This class supports the following CSS properties:

Graphic property CSS property Type
Background color background-colorColor

Constructor & Destructor Documentation

§ IlvSlider() [1/2]

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.

Parameters
displayThe connection to the display.
rectThe size and position of the slider.
orientationThe orientation of the slider. Valid values are: IlvLeft, IlvRight, IlvTop, and IlvBottom.
thicknessThe thickness of the slider.
paletteThe 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() [2/2]

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.

Parameters
displayThe connection to the display.
pThe position of the slider.
sizeThe size of the slider.
orientationThe orientation of the slider. Valid values are: IlvLeft, IlvRight, IlvTop, and IlvBottom.
thicknessThe thickness of the slider.
paletteThe palette used to draw the slider.

Member Function Documentation

§ getMax()

IlInt IlvSlider::getMax ( ) const

Returns the maximum value of the slider.

Returns
The maximum value of the slider.
See also
setValues(), getMin().

§ getMin()

IlInt IlvSlider::getMin ( ) const

Returns the minimum value of the slider.

Returns
The minimum value of the slider.
See also
setValues(), getMax().

§ getOrientation()

IlvOrientation IlvSlider::getOrientation ( ) const

Returns the slider orientation.

Returns
The slider orientation.

§ getPageIncrement()

IlInt IlvSlider::getPageIncrement ( ) const

Returns the page increment value of the slider.

Returns
The page increment value of the slider.
See also
setPageIncrement().

§ getSliderSize()

IlvDim IlvSlider::getSliderSize ( ) const

Returns the slider size.

Returns
The slider size.
See also
setValues().

§ getThumbOrientation()

IlvOrientation IlvSlider::getThumbOrientation ( ) const

Returns the orientation of the slider thumb.

Returns
The orientation of the slider thumb.
See also
setThumbOrientation().

§ getValue()

IlInt IlvSlider::getValue ( ) const

Returns the current value of the slider.

Returns
The current slider value.
See also
setValue().

§ getValues()

void IlvSlider::getValues ( IlInt min,
IlInt max,
IlInt value,
IlvDim sSize 
) const

Returns all the parameters of the slider.

Returns
All the parameters of this slider.
See also
setValues().

§ positionToValue()

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.

Parameters
pointThe point where the slider is located.
tThe transformer applied to this object.
Returns
The value stored in this object when the slider is located at point and drawn with the transformer t.

§ setOrientation()

void IlvSlider::setOrientation ( IlvOrientation  orientation)

Sets the slider orientation.

Parameters
orientationThe 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.

§ setPageIncrement()

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.

Parameters
valueThe new page increment value.
See also
getPageIncrement().

§ setThumbOrientation()

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.

Parameters
orientationThe new thumb orientation. The valid values are: IlvTop, IlvBottom, or both, for an horizontal slider, and IlvLeft, IlvRight, or both, for a vertical slider.

§ setValue()

void IlvSlider::setValue ( IlInt  value,
IlBoolean  redraw = IlFalse 
)

Sets the slider value.

Parameters
valueThe new slider value.
redrawSpecifies whether the slider should be redrawn.
See also
getValue().

§ setValues() [1/2]

void IlvSlider::setValues ( IlInt  min,
IlInt  max,
IlInt  value,
IlvDim  size 
)

Sets the minimum, maximum, and current values of the slider.

Parameters
minThe minimum slider value.
maxThe maximum slider value.
valueThe current slider value.
sizeThe slider size.
See also
getValues().

§ setValues() [2/2]

void IlvSlider::setValues ( IlInt  min,
IlInt  max,
IlInt  value 
)

Sets the minimum, maximum, and current values for the slider.

Parameters
minThe minimum slider value.
maxThe maximum slider value.
valueThe current slider value.
See also
getValues().

§ valueChanged()

virtual void IlvSlider::valueChanged ( )
virtual

Is called whenever the user changes the value of the slider.

The default implementation calls the Main callback of the slider.


© Copyright 2017, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.