SpinBox
classin packageklyn.gui.windows
public class SpinBox extends Widget
└ SpinBox

Numeric spin box widget.

value is a signal property, so it can be bound directly to another control without exposing a separate valueChanged event.

spin = SpinBox(value=42, minimum=0, maximum=255)
Binding.watch(spin::value, lambda(value as Object): print(value))
Properties
Modifier and Type Member Description
public property maximum
maximum as Int = 100
Highest allowed value.
public property minimum
minimum as Int = 0
Lowest allowed value.
Inherited Properties
propertyInherited Properties from Widget: accentColor, acceptFileDrops, backgroundColor, borderColor, bottom, canFocus, cornerRadius, cursor, font, foregroundColor, hasFocus, height, isEnabled, isHovered, isManaged, isPressed, isTabStop, isVisible, layoutParams, margin, maxHeight, maxWidth, minHeight, minWidth, parent, preferredHeight, preferredWidth, resolvedStyleCache, resolvedStyleCacheAppearanceMode, resolvedStyleCacheFont, resolvedStyleCacheRevision, resolvedStyleCacheStateKey, resolvedStyleCacheStyleClass, resolvedStyleCacheZoomRevision, right, size, sizePolicy, styleClass, toolTip, width, window, x, y
Signals
Modifier and Type Member Description
public signal property value
value as Int
Current value clamped between minimum and maximum.
Inherited Events
eventInherited Events from Widget: filesDropped, focusGained, focusLost, keyPressed, keyReleased, mouseMoved, mousePressed, mouseReleased, mouseWheel, paintRequested, resized
Constructors
Modifier and Type Member Description
public SpinBox
SpinBox(value as Int = 0, minimum as Int = 0, maximum as Int = 100)
Creates a spin box with an initial value and range.
Methods
Modifier and Type Member Description
public adjustValueBy
adjustValueBy(delta as Int) as Void
Adjusts the value by a signed delta.
public override applyThemeMetrics
applyThemeMetrics(fontPixelSize as Int, paddingLeft as Int, paddingTop as Int, paddingRight as Int, paddingBottom as Int) as Void
No summary.
public beginEdit
beginEdit() as Void
Starts manual keyboard edition of the numeric field.
public cancelEdit
cancelEdit() as Void
Cancels manual edition and keeps the current numeric value.
public clampValue
clampValue(value as Int) as Int
Clamps a value into the configured range.
public clearEdit
clearEdit() as Boolean
Clears the manual edit buffer.
public commitEdit
commitEdit() as Void
Commits the manual edit buffer if it contains a valid integer.
public deleteBackward
deleteBackward() as Boolean
Deletes the last manually edited character.
public insertText
insertText(text as String) as Boolean
Inserts keyboard text into the spin box edit buffer.
public override paint
paint(painter as Painter) as Void
Paints the spin box field and stepper affordance.
public setValue
setValue(value as Int) as Void
Updates the current value and notifies bindings when it changes.
Inherited Methods
methodInherited Methods from Widget: applyThemeMetrics, blur, containsPoint, emitFilesDropped, emitFocusGained, emitFocusLost, emitKeyPressed, emitKeyReleased, emitMouseMoved, emitMousePressed, emitMouseReleased, emitMouseWheel, handleTabKey, notifyPaintRequested, paint, paintClipped, paintForeground, paintOverlay, preferredSizeIncludesContentZoom, repaint, requestFocus, resolvePreferredHeight, resolvePreferredWidth, resolvedFont, setBounds