Views
Gadgets Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions | Friends
IlvScrollBar Class Reference

Gadget class. More...

#include <ilviews/gadgets/scrollb.h>

Inheritance diagram for IlvScrollBar:
IlvGadget IlvSimpleGraphic IlvStylable IlvGraphic IlvValueInterface

Public Member Functions

 IlvScrollBar (IlvDisplay *display, const IlvRect &rect, IlvOrientation orientation=IlvVertical, IlUShort thickness=IlvDefaultGadgetThickness, IlvPalette *palette=0)
 Constructor. More...
 
virtual void computeBBox (IlvRect &tlArrow, IlvRect &scrollingBox, IlvRect &brArrow, IlvRect &scrollerBox, const IlvTransformer *t=0) const
 Computes the bounding boxes of each component of the scroll bar. More...
 
virtual void drag ()
 Is called whenever the user moves the slider of the scroll bar. More...
 
virtual void dragged ()
 Is called when the user releases the slider of the scroll bar after dragging it. More...
 
IlInt getDecrement () const
 Returns the decrement value of the scroll bar. More...
 
IlInt getIncrement () const
 Returns the increment value of the scroll bar. More...
 
IlInt getMax () const
 Returns the maximum value of the scroll bar. More...
 
IlInt getMin () const
 Returns the minimum value of the scroll bar. More...
 
IlvOrientation getOrientation () const
 Returns the orientation of the scroll bar. More...
 
IlInt getPageDecrement () const
 Returns the page decrement of the scroll bar. More...
 
IlInt getPageIncrement () const
 Returns the page increment of the scroll bar. More...
 
IlInt getSliderSize () const
 Returns the size of the slider. More...
 
IlInt getValue () const
 Returns the value that is currently displayed by the scroll bar. More...
 
void getValues (IlInt &min, IlInt &max, IlInt &value, IlInt &sliderSize) const
 Returns the values of the scroll bar. More...
 
virtual IlInt positionToValue (const IlvPoint &point, const IlvTransformer *t=0) const
 Returns the value that is set by the scroll bar when the slider is positioned at the specified location. More...
 
void setDecrement (IlInt value)
 Sets the decrement value of the scroll bar. More...
 
void setIncrement (IlInt value)
 Sets the increment value of the scroll bar. More...
 
void setOrientation (IlvPosition orientation)
 Sets the orientation of the scroll bar. More...
 
void setPageDecrement (IlInt value)
 Sets the page decrement value of the scroll bar. More...
 
void setPageIncrement (IlInt value)
 Sets the page increment value of the scroll bar. More...
 
void setValue (IlInt value, IlBoolean redraw=IlFalse)
 Sets the current value displayed by the scroll bar. More...
 
void setValues (IlInt min, IlInt max, IlInt value, IlInt size)
 Sets the scroll bar parameters. More...
 
virtual void valueChanged ()
 Is called whenever the user changes the value of the scroll bar. More...
 

Friends

class IlvDefaultScrollBarLFHandler
 
class IlvStringList
 

Detailed Description

Gadget class.

Library: ilvgadgt

The IlvScrollBar class displays a rectangular area that contains two direction arrows, one at each end, and a slider that refers to a range. It is mainly used to scroll parts of windows.

Scroll Bars

The location of the slider can be set by dragging it inside the larger rectangular area.

See also
IlvScrolledGadget, IlvScrolledView, IlvSlider.

Accessors\nAccessors provide a scriptable and uniform way to inspect and modify an object by using its base class methods <tt>IlvValueInterface::queryValue()</tt>, <tt>IlvValueInterface::queryValues()</tt>, <tt>IlvValueInterface::changeValue()</tt>, <tt>IlvValueInterface::changeValues()</tt>.\n\n\nThis class inherits the accessors of its superclass \c IlvGadget and adds the following ones:

Name Type Equivalent methods
minValue Int getMin(), setValues()
maxValue Int getMax(), setValues()
value Int getValue(), setValues()
sliderSize Int getSliderSize(), setValues()
increment Int getIncrement(), setIncrement()
decrement Int getDecrement(), setDecrement()
pageIncrement Int getPageIncrement(), setPageIncrement()
pageDecrement Int getPageDecrement(), setPageDecrement()
orientation Direction getOrientation(), setOrientation()

Styling\nThis class supports the following CSS properties:

Graphic property CSS property Type
Background color background-color Color
Foreground color color Color

Constructor & Destructor Documentation

◆ IlvScrollBar()

IlvScrollBar::IlvScrollBar ( IlvDisplay display,
const IlvRect rect,
IlvOrientation  orientation = IlvVertical,
IlUShort  thickness = IlvDefaultGadgetThickness,
IlvPalette palette = 0 
)

Constructor.

Initializes a new instance of the IlvScrollBar class. The initial minimum value is set to 0. The initial maximum value is set to 100. The initial current value is set to 50. The initial slider size is set to 10.

Parameters
displayThe connection to the display.
rectThe size and position of the scroll bar.
orientationThe orientation of the scroll bar. Valid values are: IlvVertical and IlvHorizontal.
thicknessThe thickness of the scroll bar.
paletteThe palette of the scroll bar.

Member Function Documentation

◆ computeBBox()

virtual void IlvScrollBar::computeBBox ( IlvRect tlArrow,
IlvRect scrollingBox,
IlvRect brArrow,
IlvRect scrollerBox,
const IlvTransformer t = 0 
) const
virtual

Computes the bounding boxes of each component of the scroll bar.

Parameters
tlArrowThe bounding box of the top (or left) arrow box.
scrollingBoxThe bounding box of the scrolling area.
brArrowThe bounding box of the bottom (or right) arrow box.
scrollerBoxThe bounding box of the slider.
tThe transformer applied to the bounding boxes.

◆ drag()

virtual void IlvScrollBar::drag ( )
virtual

Is called whenever the user moves the slider of the scroll bar.

The default implementation calls the valueChanged method.

See also
valueChanged().

◆ dragged()

virtual void IlvScrollBar::dragged ( )
virtual

Is called when the user releases the slider of the scroll bar after dragging it.

The default implementation calls the Secondary callback of the scroll bar.

See also
drag(), IlvGraphic::SCallbackSymbol().

◆ getDecrement()

IlInt IlvScrollBar::getDecrement ( ) const

Returns the decrement value of the scroll bar.

The decrement value is subtracted from the current value of the scroll bar in the following cases: The scroll bar decrement arrow has been released, or the IlvUpKey has been pressed while the scroll bar had the keyboard focus, or the internal scroll bar timer has been triggered after the decrement arrow has been clicked on.

Returns
The decrement value of the scroll bar.
See also
setDecrement(), getIncrement().

◆ getIncrement()

IlInt IlvScrollBar::getIncrement ( ) const

Returns the increment value of the scroll bar.

The increment value is added to the current value of the scroll bar in the following cases: The scroll bar increment arrow has been released , or the IlvDownKey has been pressed while the scroll bar had the keyboard focus, or the internal scroll bar timer has been triggered after the increment arrow has been clicked on.

Returns
The increment value of the scroll bar.
See also
setIncrement(), getDecrement().

◆ getMax()

IlInt IlvScrollBar::getMax ( ) const

Returns the maximum value of the scroll bar.

Returns
The maximum value of the scroll bar.
See also
setMax(), getMin().

◆ getMin()

IlInt IlvScrollBar::getMin ( ) const

Returns the minimum value of the scroll bar.

Returns
The minimum value of the scroll bar.
See also
setMin(), getMax().

◆ getOrientation()

IlvOrientation IlvScrollBar::getOrientation ( ) const

Returns the orientation of the scroll bar.

Returns
The orientation of the scroll bar.
See also
setOrientation().

◆ getPageDecrement()

IlInt IlvScrollBar::getPageDecrement ( ) const

Returns the page decrement of the scroll bar.

The page decrement value is subtracted from the current value of the scroll bar in the following cases: The scroll bar has been clicked in the area located above the slider, or the IlvPageUpKey has been pressed while the scroll bar had the keyboard focus.

Returns
The page decrement of the scroll bar.
See also
setPageDecrement(), getPageIncrement().

◆ getPageIncrement()

IlInt IlvScrollBar::getPageIncrement ( ) const

Returns the page increment of the scroll bar.

The page increment value is added to the current value of the scroll bar in the following cases: The scroll bar has been clicked in the area located below the slider, or the IlvPageDownKey has been pressed while the scroll bar had the keyboard focus.

Returns
The page increment of the scroll bar.
See also
setPageIncrement(), getPageDecrement().

◆ getSliderSize()

IlInt IlvScrollBar::getSliderSize ( ) const

Returns the size of the slider.

Returns
The size of the slider
See also
setValues().

◆ getValue()

IlInt IlvScrollBar::getValue ( ) const

Returns the value that is currently displayed by the scroll bar.

Returns
The value that is currently displayed by the scroll bar.
See also
setValue(), getValues().

◆ getValues()

void IlvScrollBar::getValues ( IlInt min,
IlInt max,
IlInt value,
IlInt sliderSize 
) const

Returns the values of the scroll bar.

Parameters
minThe returned minimum scroll bar value.
maxThe returned maximum scroll bar value.
valueThe returned scroll bar value.
sliderSizeThe returned slider size.
See also
setValues(), setValue().

◆ positionToValue()

virtual IlInt IlvScrollBar::positionToValue ( const IlvPoint point,
const IlvTransformer t = 0 
) const
virtual

Returns the value that is set by the scroll bar when the slider is positioned at the specified location.

Parameters
pointThe point where the scroll bar is located.
tThe transformer applied to the scroll bar.
Returns
The value that is set by the scroll bar when the slider is positioned at the location indicated by point.
See also
setValue().

◆ setDecrement()

void IlvScrollBar::setDecrement ( IlInt  value)

Sets the decrement value of the scroll bar.

By default the decrement value is set to the increment value (see setIncrement()).

Parameters
valueThe new decrement value.
See also
setIncrement(), setPageDecrement(), getDecrement().

◆ setIncrement()

void IlvScrollBar::setIncrement ( IlInt  value)

Sets the increment value of the scroll bar.

Also sets the decrement value to value. To have a decrement value different from the increment value, use the setDecrement() method.

Parameters
valueThe new increment value.
See also
setDecrement(), setPageIncrement(), getIncrement().

◆ setOrientation()

void IlvScrollBar::setOrientation ( IlvPosition  orientation)

Sets the orientation of the scroll bar.

Returns
The new orientation of the scroll bar. Valid values are: IlvHorizontal and IlvVertical.
See also
getOrientation().

◆ setPageDecrement()

void IlvScrollBar::setPageDecrement ( IlInt  value)

Sets the page decrement value of the scroll bar.

By default the page decrement value is set to the page increment value (see setPageIncrement()).

Parameters
valueThe new page decrement value.
See also
setPageIncrement(), getPageIncrement(), getPageDecrement().

◆ setPageIncrement()

void IlvScrollBar::setPageIncrement ( IlInt  value)

Sets the page increment value of the scroll bar.

Also sets the page decrement value to value. To have a page decrement value different from the page increment value, use the setPageDecrement() method.

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

◆ setValue()

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

Sets the current value displayed by the scroll bar.

If value is less than the minimum value, the scroll bar is set to the minimum value. If value is greater than the maximum value, the scroll bar is set to the maximum value.

Parameters
valueThe new scroll bar value.
redrawSpecifies whether the scroll bar should be redrawn.
See also
setValues(), getValue().

◆ setValues()

void IlvScrollBar::setValues ( IlInt  min,
IlInt  max,
IlInt  value,
IlInt  size 
)

Sets the scroll bar parameters.

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

◆ valueChanged()

virtual void IlvScrollBar::valueChanged ( )
virtual

Is called whenever the user changes the value of the scroll bar.

The default implementation calls the Main callback of the scroll bar.

See also
drag().