Public Member Functions | Protected Member Functions

Wt::WAbstractSpinBox Class Reference

An abstract spin box. More...

#include <Wt/WAbstractSpinBox>

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

List of all members.

Public Member Functions

void setNativeControl (bool nativeControl)
 Configures whether a native HTML5 control should be used.
bool nativeControl () const
 Returns whether a native HTML5 control is used.
void setPrefix (const WString &prefix)
 Sets a prefix.
const WStringprefix () const
 Returns the prefix.
void setSuffix (const WString &suffix)
 Sets a suffix.
const WStringsuffix () const
 Returns the suffix.
virtual void setText (const WString &text)
 Sets the content of the line edit.

Protected Member Functions

 WAbstractSpinBox (WContainerWidget *parent=0)
 Constructor.
virtual int boxPadding (Orientation orientation) const
 Returns the widget's built-in padding.

Detailed Description

An abstract spin box.

CSS

Using HTML4, the widget is implemented using a <input type="text"> The element can be styled using the Wt-spinbox style. It may be styled through the current theme, or you can override the style using internal or external CSS as appropriate.


Member Function Documentation

int Wt::WAbstractSpinBox::boxPadding ( Orientation  orientation ) const [protected, virtual]

Returns the widget's built-in padding.

This is used by the layout managers to correct for a built-in padding which interferes with setting a widget's width (or height) to 100%.

A layout manager needs to set the width to 100% only for form widgets (WTextArea, WLineEdit, WComboBox, etc...). Therefore, only for those widgets this needs to return the padding (the default implementation returns 0).

For form widgets, the padding depends on the specific browser/platform combination, unless an explicit padding is set for the widget.

When setting an explicit padding for the widget using a style class, you will want to reimplement this method to return this padding in case you want to set the widget inside a layout manager.

See also:
boxBorder()

Reimplemented from Wt::WLineEdit.

bool Wt::WAbstractSpinBox::nativeControl (  ) const

Returns whether a native HTML5 control is used.

Taking into account the preference for a native control, configured using setNativeControl(), this method returns whether a native control is actually being used.

const WString& Wt::WAbstractSpinBox::prefix (  ) const

Returns the prefix.

See also:
setPrefix()
void Wt::WAbstractSpinBox::setNativeControl ( bool  nativeControl )

Configures whether a native HTML5 control should be used.

When native, the new "number" input element, specified by HTML5 and when implemented by the browser, is used rather than the built-in element. The native control is styled by the browser (usually in sync with the OS) rather than through the theme chosen.

The default is false (as native support is now well implemented).

void Wt::WAbstractSpinBox::setPrefix ( const WString prefix )

Sets a prefix.

Option to set a prefix string shown in front of the value, e.g.:

   spinBox->setPrefix("$ ");

The default prefix is empty.

Note:
Not supported by the native controls.
void Wt::WAbstractSpinBox::setSuffix ( const WString suffix )

Sets a suffix.

Option to set a suffix string shown to the right of the value, e.g.:

   spinBox->setSuffix(" crates");

The default suffix is empty.

Note:
Not supported by the native controls.
void Wt::WAbstractSpinBox::setText ( const WString text ) [virtual]

Sets the content of the line edit.

The default value is "".

See also:
text()

Reimplemented from Wt::WLineEdit.

const WString& Wt::WAbstractSpinBox::suffix (  ) const

Returns the suffix.

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

Generated on Fri Jul 8 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.2