Class WSpinBox
The spin box provides a control for entering an integer number. It consists of a line edit,
and buttons which allow to increase or decrease the value. If you rather need input of a
fractional number, use WDoubleSpinBox
instead.
WSpinBox is an inline
widget.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Field Summary
Fields inherited from class eu.webtoolkit.jwt.WInteractWidget
dragTouchEndSlot_, dragTouchSlot_
-
Constructor Summary
ConstructorDescriptionWSpinBox()
Creates a spin-box.WSpinBox
(WContainerWidget parentContainer) Creates a spin-box. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the maximum value.int
Returns the minimum value.int
Returns the step value.protected String
protected WValidator.Result
int
getValue()
Returns the value.boolean
Returns if the spinbox wraps around.void
setMaximum
(int maximum) Sets the maximum value.void
setMinimum
(int minimum) Sets the minimum value.void
setRange
(int minimum, int maximum) Sets the range.void
setSingleStep
(int step) Sets the step value.void
setValue
(int value) Sets the value.void
setWrapAroundEnabled
(boolean enabled) Sets if this spinbox wraps around to stay in the valid range.A signal that indicates when the value has changed.Methods inherited from class eu.webtoolkit.jwt.WAbstractSpinBox
boxPadding, getPrefix, getSuffix, isNativeControl, jsValueChanged, refresh, render, setFormData, setNativeControl, setPrefix, setSuffix, setText, validate
Methods inherited from class eu.webtoolkit.jwt.WLineEdit
boxBorder, getCursorPosition, getDisplayText, getDomChanges, getEchoMode, getInputMask, getMaxLength, getSelectedText, getSelectionStart, getText, getTextSize, getValueText, hasSelectedText, isAutoComplete, setAutoComplete, setEchoMode, setInputMask, setInputMask, setInputMask, setInputMask, setMaxLength, setSelection, setTextSize, setValueText, textInput
Methods inherited from class eu.webtoolkit.jwt.WFormWidget
changed, enableAjax, getLabel, getPlaceholderText, getTabIndex, getValidator, isCanReceiveFocus, isReadOnly, propagateSetEnabled, remove, setEnabled, setHidden, setPlaceholderText, setReadOnly, setToolTip, setValidator, validated, validatorChanged
Methods inherited from class eu.webtoolkit.jwt.WInteractWidget
clicked, doubleClicked, enterPressed, escapePressed, gestureChanged, gestureEnded, gestureStarted, getMouseOverDelay, isEnabled, keyPressed, keyWentDown, keyWentUp, load, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, setDraggable, setDraggable, setDraggable, setDraggable, setMouseOverDelay, setPopup, touchEnded, touchMoved, touchStarted, unsetDraggable
Methods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemoved
Methods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, animateHide, animateShow, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, layoutSizeChanged, needsRerender, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, tr
Methods inherited from class eu.webtoolkit.jwt.WObject
getObjectName
-
Constructor Details
-
WSpinBox
Creates a spin-box.The range is (0 - 99) and the step size 1.
The initial value is 0.
-
WSpinBox
public WSpinBox()Creates a spin-box.
-
-
Method Details
-
setMinimum
public void setMinimum(int minimum) Sets the minimum value.The default value is 0.
-
getMinimum
public int getMinimum()Returns the minimum value.- See Also:
-
setMaximum
public void setMaximum(int maximum) Sets the maximum value.The default value is 99.
-
getMaximum
public int getMaximum()Returns the maximum value.- See Also:
-
setRange
public void setRange(int minimum, int maximum) Sets the range. -
setSingleStep
public void setSingleStep(int step) Sets the step value.The default value is 1.
-
getSingleStep
public int getSingleStep()Returns the step value. -
setValue
public void setValue(int value) Sets the value.value
must be a value betweengetMinimum()
andgetMaximum()
.The default value is 0
-
getValue
public int getValue()Returns the value.Note: This value may not correctly reflect the
WLineEdit.getValueText()
of the spin box ifWLineEdit.getValueText()
is empty or if the contents are not in avalid state
. -
setWrapAroundEnabled
public void setWrapAroundEnabled(boolean enabled) Sets if this spinbox wraps around to stay in the valid range.Note: Not supported by the native controls.
-
isWrapAroundEnabled
public boolean isWrapAroundEnabled()Returns if the spinbox wraps around.- See Also:
-
valueChanged
A signal that indicates when the value has changed.This signal is emitted when
WFormWidget.changed()
is emitted, but supplies the new value as an argument. TheWFormWidget.changed()
signal is emitted when the user changes the value of the spinbox by pressing the up/down arrow, or entering a different value and pressing enter or moving focus.- See Also:
-
getTextFromValue
- Specified by:
getTextFromValue
in classWAbstractSpinBox
-
getValidateRange
- Specified by:
getValidateRange
in classWAbstractSpinBox
-