Rogue Wave Views
Gadgets Package API Reference Guide
Product Documentation:

Rogue Wave 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 IlvScrollBarMLFHandler
 
class IlvScrollBarWLFHandler
 
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

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 Int getSliderSize(), setValues()
increment Int getIncrement(), setIncrement()
decrement Int getDecrement(), setDecrement()
pageIncrement Int getPageIncrement(), setPageIncrement()
pageDecrement Int getPageDecrement(), setPageDecrement()
orientation Direction getOrientation(), setOrientation()

Styling

This class supports the following CSS properties:

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

Constructor & Destructor Documentation

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

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.
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().
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().
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().
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().
IlInt IlvScrollBar::getMax ( ) const

Returns the maximum value of the scroll bar.

Returns
The maximum value of the scroll bar.
See also
setMax(), 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().
IlvOrientation IlvScrollBar::getOrientation ( ) const

Returns the orientation of the scroll bar.

Returns
The orientation of the scroll bar.
See also
setOrientation().
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().
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().
IlInt IlvScrollBar::getSliderSize ( ) const

Returns the size of the slider.

Returns
The size of the slider
See also
setValues().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().

© Copyright 2016, 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.