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.
- See Also:
-
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_, noDefaultFields inherited from class eu.webtoolkit.jwt.WWidget
WT_GETEXTRAMS_JS -
Constructor Summary
ConstructorsConstructorDescriptionWSpinBox()Creates a spin-box.WSpinBox(WContainerWidget parentContainer) Creates a spin-box. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum value.intReturns the minimum value.intReturns the step value.protected Stringprotected WValidator.ResultintgetValue()Returns the value.booleanReturns if the spinbox wraps around.voidsetMaximum(int maximum) Sets the maximum value.voidsetMinimum(int minimum) Sets the minimum value.voidsetRange(int minimum, int maximum) Sets the range.voidsetSingleStep(int step) Sets the step value.voidsetValue(int value) Sets the value.voidsetWrapAroundEnabled(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, validateMethods inherited from class eu.webtoolkit.jwt.WLineEdit
boxBorder, getAutoCompleteToken, getCursorPosition, getDisplayText, getDomChanges, getEchoMode, getInputMask, getInputMode, getMaxLength, getSelectedText, getSelectionStart, getText, getTextSize, getType, getValueText, hasSelectedText, isAutoComplete, setAutoComplete, setAutoComplete, setEchoMode, setInputMask, setInputMask, setInputMask, setInputMask, setInputMode, setMaxLength, setSelection, setTextSize, setValueText, textInputMethods inherited from class eu.webtoolkit.jwt.WFormWidget
changed, enableAjax, getLabel, getPlaceholderText, getRealValidator, getTabIndex, getValidator, hasValidatorChanged, isCanReceiveFocus, isReadOnly, propagateSetEnabled, remove, setEnabled, setHidden, setPlaceholderText, setReadOnly, setToolTip, setValidator, validated, validatorChangedMethods 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, unsetDraggableMethods inherited from class eu.webtoolkit.jwt.WWebWidget
addStyleClass, anchorAt, becomePositionAnchor, beingDeleted, blurred, callJavaScriptMember, childrenChanged, createDomElement, doJavaScript, escapeText, escapeText, escapeText, escapeText, find, findById, focussed, formDataChanged, getAttributeValue, getBaseZIndex, getChildren, getClearSides, getDecorationStyle, getFloatSide, getHeight, getHtmlTagName, getId, getJavaScriptMember, getLineHeight, getMargin, getMaximumHeight, getMaximumWidth, getMinimumHeight, getMinimumWidth, getOffset, getPositionAnchor, getPositionAnchorName, getPositionScheme, getScrollVisibilityMargin, getStyleClass, getToolTip, getVerticalAlignment, getVerticalAlignmentLength, getWidth, hasFocus, hasStyleClass, hideToolTip, isDefaultNativeControl, isDisabled, isHidden, isHiddenKeepsGeometry, isInline, isLoaded, isPopup, isRendered, isScrollVisibilityEnabled, isScrollVisible, isSetFirstFocus, isThemeStyleEnabled, isVisible, iterateChildren, jsStringLiteral, jsStringLiteral, manageWidget, parentResized, parentResized, propagateSetVisible, removeScript, removeStyleClass, resendFormData, resize, scrollVisibilityChanged, setAttributeValue, setBaseZIndex, setCanReceiveFocus, setClearSides, setDecorationStyle, setDefaultNativeControl, setDeferredToolTip, setDisabled, setFlexBox, setFloatSide, setFocus, setHiddenKeepsGeometry, setHtmlTagName, setId, setInline, setJavaScriptMember, setLineHeight, setLoadLaterWhenInvisible, setMargin, setMaximumSize, setMinimumSize, setObjectName, setOffsets, setParentWidget, setPositionAnchor, setPositionAnchor, setPositionScheme, setScrollVisibilityEnabled, setScrollVisibilityMargin, setSelectable, setStyleClass, setTabIndex, setThemeStyleEnabled, setVerticalAlignment, showToolTip, showToolTipOnHover, unescapeText, updateSignalConnection, voidEventSignal, widgetAdded, widgetRemovedMethods inherited from class eu.webtoolkit.jwt.WWidget
acceptDrops, acceptDrops, addCssRule, addCssRule, addJSignal, addStyleClass, anchorAt, animateHide, animateShow, applyThemeStyles, createJavaScript, disable, dropEvent, enable, getDropTouch, getJsRef, getParent, hide, htmlText, htmlText, isExposed, isGlobalWidget, isLayoutSizeAware, isPositionAnchor, layoutSizeChanged, needsRerender, positionAt, positionAt, positionAt, positionAt, removeFromParent, removeStyleClass, removeWidget, render, resize, scheduleRender, scheduleRender, scheduleRender, scheduleThemeStyleApply, setClearSides, setDeferredToolTip, setFocus, setHeight, setHidden, setLayoutSizeAware, setMargin, setMargin, setMargin, setMargin, setMargin, setOffsets, setOffsets, setOffsets, setOffsets, setOffsets, setToolTip, setVerticalAlignment, setWidth, show, stopAcceptDrops, toggleStyleClass, toggleStyleClass, trMethods 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.- See Also:
-
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.valuemust 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:
getTextFromValuein classWAbstractSpinBox
-
getValidateRange
- Specified by:
getValidateRangein classWAbstractSpinBox
-