UXStepper
UXStepper is the small two-part control beside a numeric field. The top half
steps the value up and the bottom half steps it down, clamped to a range or, if
requested, wrapping. The value logic is pure and unit-testable. Drawing and the
up/down hit-test go through the
UXControl seam. Where the platform has a
native stepper (macOS NSStepper, Win32 up-down, iOS UIStepper, GTK
GtkSpinButton) the driver realizes one; elsewhere the control draws the
theme’s stepper.up / stepper.down bezels.
#use <UXKit>Overview
Section titled “Overview”UXStepper* qty = new UXStepper();qty.setRange(1, 99);qty.setValue(1);qty.setAction(&controller.onQty);content.addSubview(qty, UXGeom.make(96, 8, 20, 24));The action fires after each step; the handler reads the value from the sender:
void onQty(UXControl* sender) { field.setText(itoa(((UXStepper* ?)sender).intValue()));}Conforms to
Section titled “Conforms to”- Inherits
UXControl: theweak:callback action, enablement, the fire path.
Topics
Section titled “Topics”Value · setRange · setStep · setWraps · setValue · intValue Stepping · increment · decrement
setRange
Section titled “setRange”void setRange(i32 lo, i32 hi)Sets the bounds and clamps the current value into them.
setStep
Section titled “setStep”void setStep(i32 s)The per-click delta (a non-positive step is repaired to 1).
setWraps
Section titled “setWraps”void setWraps(bool w)Whether stepping past an end wraps to the other end. A clock’s minutes wrap; a quantity doesn’t.
setValue
Section titled “setValue”void setValue(i32 v)Sets the value programmatically, clamped. Does not fire the action.
intValue
Section titled “intValue”i32 intValue(void)The current value. The neutral object holds it, whatever realized the control.
increment
Section titled “increment”void increment(void)One step up: clamps at the top, or wraps to the minimum when
setWraps is set.
decrement
Section titled “decrement”void decrement(void)One step down, the mirror of increment.
Platform appearance
Section titled “Platform appearance”
The theme’s stepper.up / stepper.down bezels at their natural 25×25, never stretched. The same Aristo art GEM draws, on canvas.

A real UIStepper, the platform’s ± pair; value changes land through applyNativeValue.

A composed pair of real Buttons. Android has no platform stepper, and the −/+ pair is the Material inline idiom; each half reports its direction through the bridge.

A real NSStepper.

A real msctls_updown32.

A real GtkSpinButton. The platform folds the field and the stepper into one control, so the value shows inline.

The same themed bezels at their natural size, drawn by the same drawRect.
Example
Section titled “Example”A stepper driving a field:
UXTextField* qtyField = new UXTextField();UXStepper* qtySteps = new UXStepper();qtySteps.setRange(1, 99);qtySteps.setAction(&controller.onQty);content.addSubview(qtyField, UXGeom.make(8, 8, 84, 24));content.addSubview(qtySteps, UXGeom.make(96, 8, 20, 24));