Vaca::Slider Class Reference

#include <Slider.h>

Inheritance diagram for Vaca::Slider:

Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable

List of all members.

Public Member Functions

 Slider (Widget *parent, Style style=SliderStyle)
 Slider (int minValue, int maxValue, int value, Widget *parent, Style style=SliderStyle)
virtual ~Slider ()
Orientation getOrientation ()
void setOrientation (Orientation orientation)
Sides getSides ()
void setSides (Sides sides)
void setTickVisible (bool state)
 Sets the visibility state of the tick marks in the slider.
void setTickFreq (int freq)
 Sets the frequency of the tick marks in the slider.
int getMinValue ()
int getMaxValue ()
void getRange (int &minValue, int &maxValue)
 Gets the current range of the slider which indicates the posible values that the user can select.
void setRange (int minValue, int maxValue)
 Sets the range of values which the user can select from.
int getValue ()
 Returns the selected value in the range of the slider.
void setValue (int posValue)
 Sets the selected value in the slider.
int getLineSize ()
 Returns the current line size, it is how many units the value will move when the user press the arrow keys.
void setLineSize (int lineSize)
 Sets the current line size, it is how many units the value will move when the user press the arrow keys.
int getPageSize ()
 Returns the current page size, it is how many units the value will move when the user press the PageUp/Down keys.
void setPageSize (int pageSize)
 Sets the current page size, it is how many units the value will move when the user press the PageUp/Down keys.

Public Attributes

Signal1< void, Event & > Change

Static Public Attributes

static const int MinLimit = SHRT_MIN
static const int MaxLimit = SHRT_MAX

Protected Member Functions

virtual void onPreferredSize (Size &sz)
 It should calculates the preferred size for this widget.
virtual void onScroll (Orientation orientation, int code)
virtual void onChange (Event &ev)


Constructor & Destructor Documentation

Slider::Slider ( Widget parent,
Style  style = SliderStyle 
)

Slider::Slider ( int  minValue,
int  maxValue,
int  value,
Widget parent,
Style  style = SliderStyle 
)

Slider::~Slider (  )  [virtual]


Member Function Documentation

Orientation Slider::getOrientation (  ) 

void Slider::setOrientation ( Orientation  orientation  ) 

Sides Slider::getSides (  ) 

void Slider::setSides ( Sides  sides  ) 

void Slider::setTickVisible ( bool  state  ) 

Sets the visibility state of the tick marks in the slider.

See also:
setTickFreq

void Slider::setTickFreq ( int  freq  ) 

Sets the frequency of the tick marks in the slider.

See also:
setTickVisible

int Slider::getMinValue (  ) 

int Slider::getMaxValue (  ) 

void Slider::getRange ( int &  minValue,
int &  maxValue 
)

Gets the current range of the slider which indicates the posible values that the user can select.

Parameters:
minValue Minimum value in the range.
maxValue Maximum value in the range.
See also:
getMinValue, getMaxValue

void Slider::setRange ( int  minValue,
int  maxValue 
)

Sets the range of values which the user can select from.

Parameters:
minValue Must be great or equal to MinLimit.
maxValue Must be less or equal to MaxLimit. And it must be also equal Must be greater or equal to minValue.
See also:
getRange, MinLimit, MaxLimit

int Slider::getValue (  ) 

Returns the selected value in the range of the slider.

void Slider::setValue ( int  value  ) 

Sets the selected value in the slider.

Parameters:
value Must be inside the slider's range. You can obtain the current minimum and maximum values using the getRange method.

int Slider::getLineSize (  ) 

Returns the current line size, it is how many units the value will move when the user press the arrow keys.

See also:
setLineSize

void Slider::setLineSize ( int  lineSize  ) 

Sets the current line size, it is how many units the value will move when the user press the arrow keys.

See also:
getLineSize

int Slider::getPageSize (  ) 

Returns the current page size, it is how many units the value will move when the user press the PageUp/Down keys.

See also:
setPageSize

void Slider::setPageSize ( int  pageSize  ) 

Sets the current page size, it is how many units the value will move when the user press the PageUp/Down keys.

See also:
getPageSize

void Slider::onPreferredSize ( Size sz  )  [protected, virtual]

It should calculates the preferred size for this widget.

Parameters:
sz It's for input and output. You should put the preferred size in this value, but also you should read the input value to know if you must to fit the widget in some size. The possible values for sz are:
  • sz = Size(0, 0) to calculate the preferred size without restrictions.
  • sz = Size(width, 0) to calculate the preferred size with restricted <= width.
  • sz = Size(0, height) to calculate the preferred size with restricted <= height.

Reimplemented from Vaca::Widget.

void Slider::onScroll ( Orientation  orient,
int  code 
) [protected, virtual]

Todo:
docme

Reimplemented from Vaca::Widget.

void Slider::onChange ( Event ev  )  [protected, virtual]


Member Data Documentation

const int Slider::MinLimit = SHRT_MIN [static]

const int Slider::MaxLimit = SHRT_MAX [static]

See also:
onChange