Wt  3.3.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Protected Member Functions
Wt::WDoubleSpinBox Class Reference

An input control for fixed point numbers. More...

#include <Wt/WDoubleSpinBox>

Inheritance diagram for Wt::WDoubleSpinBox:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 WDoubleSpinBox (WContainerWidget *parent=0)
 Creates a spin-box.
void setMinimum (double minimum)
 Sets the minimum value.
double minimum () const
 Returns the minimum value.
void setMaximum (double maximum)
 Sets the maximum value.
double maximum () const
 Returns the maximum value.
void setRange (double minimum, double maximum)
 Sets the range.
void setSingleStep (double step)
 Sets the step value.
double singleStep () const
 Returns the step value.
void setDecimals (int precision)
 Sets the precision.
int decimals () const
 Returns the precision.
void setValue (double value)
 Sets the value.
double value () const
 Returns the value.
Signal< double > & valueChanged ()
 A signal that indicates when the value has changed.
virtual void refresh ()
 Refresh the widget.

Protected Member Functions

virtual void render (WFlags< RenderFlag > flags)
 Renders the widget.

Detailed Description

An input control for fixed point numbers.

The spin box provides a control for entering a fixed point number. It consists of a line edit, and buttons which allow to increase or decrease the value. If you rather need input of an integer number number, use WSpinBox instead.

WDoubleSpinBox is an inline widget.

See also:
WSpinBox
Note:
A spinbox configures a validator for validating the input. Therefore you cannot set a validator yourself.

Constructor & Destructor Documentation

Creates a spin-box.

The range is (0.0 - 99.99), the step size 1.0, and the spin box has a precision of 2 decimals.

The initial value is 0.0.


Member Function Documentation

int Wt::WDoubleSpinBox::decimals ( ) const [virtual]

Returns the precision.

See also:
setDecimals()

Implements Wt::WAbstractSpinBox.

double Wt::WDoubleSpinBox::maximum ( ) const

Returns the maximum value.

See also:
setMaximum()
double Wt::WDoubleSpinBox::minimum ( ) const

Returns the minimum value.

See also:
setMinimum()
void Wt::WDoubleSpinBox::refresh ( ) [virtual]

Refresh the widget.

The refresh method is invoked when the locale is changed using WApplication::setLocale() or when the user hit the refresh button.

The widget must actualize its contents in response.

Note:
This does *not* rerender the widget! Calling refresh() usually does not have any effect (unless you've reimplemented refresh() to attach to it an effect).

Reimplemented from Wt::WAbstractSpinBox.

void Wt::WDoubleSpinBox::render ( WFlags< RenderFlag flags) [protected, virtual]

Renders the widget.

This function renders the widget (or an update for the widget), after this has been scheduled using scheduleRender().

The default implementation will render the widget by serializing changes to JavaScript and HTML. You may want to reimplement this widget if you have been postponing some of the layout / rendering implementation until the latest moment possible. In that case you should make sure you call the base implementation however.

Reimplemented from Wt::WAbstractSpinBox.

void Wt::WDoubleSpinBox::setDecimals ( int  precision)

Sets the precision.

This sets the number of digits after the decimal point shown

The default precision is 2.

void Wt::WDoubleSpinBox::setMaximum ( double  maximum)

Sets the maximum value.

The default value is 99.99.

void Wt::WDoubleSpinBox::setMinimum ( double  minimum)

Sets the minimum value.

The default value is 0.0.

void Wt::WDoubleSpinBox::setRange ( double  minimum,
double  maximum 
)

Sets the range.

See also:
setMinimum(), setMaximum()
void Wt::WDoubleSpinBox::setSingleStep ( double  step)

Sets the step value.

The default value is 1.0.

void Wt::WDoubleSpinBox::setValue ( double  value)

Sets the value.

value must be a value between minimum() and maximum().

The default value is 0

Returns the step value.

See also:
setSingleStep()

A signal that indicates when the value has changed.

This signal is emitted when setValue() is called.

See also:
setValue()
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1