#include <Wt/WSlider>

Public Types | |
| enum | TickPosition { TicksAbove = 0x1, TicksBelow = 0x2, TicksLeft = 0x1, TicksRight = 0x2 } |
| Enumeration that specifies the location of ticks. More... | |
Public Member Functions | |
| WSlider (WContainerWidget *parent=0) | |
| Create a default horizontal slider. | |
| WSlider (Orientation orientation, WContainerWidget *parent=0) | |
| Create a default slider of the given orientation. | |
| ~WSlider () | |
| Destructor. | |
| void | setOrientation (Wt::Orientation orientation) |
| Change the slider orientation. | |
| Orientation | orientation () const |
| Returns the slider orientation. | |
| void | setTickInterval (int tickInterval) |
| Change the tick interval. | |
| int | tickInterval () const |
| Returns the tick interval. | |
| void | setTickPosition (WFlags< TickPosition > tickPosition) |
| Set the tick position. | |
| WFlags< TickPosition > | tickPosition () const |
| Return the tick position. | |
| void | setValue (int value) |
| Change the slider value. | |
| int | value () const |
| Returns the current slider value. | |
| void | setMaximum (int maximum) |
| Set the maximum value. | |
| int | maximum () const |
| Returns the maximum value. | |
| void | setMinimum (int minimum) |
| Set the minimum value. | |
| int | minimum () const |
| Returns the minimum value. | |
| void | setRange (int minimum, int maximum) |
| Set the value range. | |
| Signal< int > & | valueChanged () |
| Signal emitted when the user has changed the value of the slider. | |
| virtual void | resize (const WLength &width, const WLength &height) |
| Resizes the widget. | |
Static Public Attributes | |
|
static const Wt::WFlags < TickPosition > | NoTicks = 0 |
| Do not render ticks. | |
|
static const Wt::WFlags < TickPosition > | TicksBothSides = TicksAbove | TicksBelow |
| Render ticks on both sides. | |
A slider allows the user to specify an integer value within a particular range using a visual slider.
The slider must be sized explicitly using WWidget::resize(). The default size is 150 x 50 pixels for a horizontal slider, and 50 x 150 pixels for a vertical slider.
Usage example:
Wt::WSlider *scaleSlider = new Wt::WSlider(Wt::Horizontal); scaleSlider->setMinimum(0); scaleSlider->setMaximum(20); scaleSlider->setValue(10); scaleSlider->setTickInterval(5); scaleSlider->setTickPosition(Wt::WSlider::TicksBothSides); scaleSlider->resize(300, 50); scaleSlider->valueChanged().connect(SLOT(this, ThisClass::scaleShape));
Horizontal slider with ticks on both sides.
| Wt::WSlider::WSlider | ( | WContainerWidget * | parent = 0 |
) |
Create a default horizontal slider.
The slider shows no ticks, has a range from 0 to 99, and has tickInterval of 0 (defaulting to three ticks over the whole range).
The initial value is 0.
| Wt::WSlider::WSlider | ( | Orientation | orientation, | |
| WContainerWidget * | parent = 0 | |||
| ) |
Create a default slider of the given orientation.
The slider shows no ticks, has a range from 0 to 99, and has tickInterval of 0 (defaulting to three ticks over the whole range).
The initial value is 0.
| void Wt::WSlider::setOrientation | ( | Wt::Orientation | orientation | ) |
| Orientation Wt::WSlider::orientation | ( | ) | const [inline] |
| void Wt::WSlider::setTickInterval | ( | int | tickInterval | ) |
Change the tick interval.
The tick interval specifies the interval for placing ticks along the slider. The interval is specified in value units (not pixel units). A value of 0 specifies an automatic tick interval, which defaults to 3 ticks spanning the whole range.
| int Wt::WSlider::tickInterval | ( | ) | const [inline] |
| void Wt::WSlider::setTickPosition | ( | WFlags< TickPosition > | tickPosition | ) |
Set the tick position.
The tick position indicates if and where ticks are placed around the slider groove.
| WFlags<TickPosition> Wt::WSlider::tickPosition | ( | ) | const [inline] |
| void Wt::WSlider::setValue | ( | int | value | ) |
| int Wt::WSlider::value | ( | ) | const [inline] |
| void Wt::WSlider::setMaximum | ( | int | maximum | ) |
Set the maximum value.
The maximum value defines the upper limit of the valid range. The lower limit and current value are automatically adjusted to remain valid.
| int Wt::WSlider::maximum | ( | ) | const [inline] |
| void Wt::WSlider::setMinimum | ( | int | minimum | ) |
Set the minimum value.
The minimum value defines the lower limit of the valid range. The upper limit and current value are automatically adjusted to remain valid.
| int Wt::WSlider::minimum | ( | ) | const [inline] |
| void Wt::WSlider::setRange | ( | int | minimum, | |
| int | maximum | |||
| ) |
| Signal<int>& Wt::WSlider::valueChanged | ( | ) | [inline] |
Signal emitted when the user has changed the value of the slider.
The new value is passed as the argument.
Resizes the widget.
Specify a new size for this widget, by specifying width and height. By default a widget has automatic width and height, see WLength::isAuto().
This applies to CSS-based layout.
Reimplemented from Wt::WCompositeWidget.
1.5.6