Vixen
dd8b0a81
csharp
public sealed class Stepper

A number with the two arrows that step it.

Read the guide page for this →

Remarks

The arithmetic was finished and had nothing to press it. Nudge has driven the arrow keys and the scrub since the field was written, and every toolkit's answer to "adjust this by one" is two small arrows next to the box — so an application that wanted a stepper had to draw one and wire it up. ⚠ The field's own summary and the theme's read-only rule both described spinners that did not exist.

⚠ A field with arrows in it rather than arrows beside a field, which is the opposite of AppKit's split. NSStepper is the pair on its own, and the binding between it and whatever text field it sits next to is the application's to keep — a seam that exists because the two are separate views. Here the number, the range, the step, the keys and the scrub are one control already, so the arrows join it and bind:Number goes on working; a second control beside the field would have had to mirror five properties and stay in step with all of them.

The arrows are not tab stops. They do what Up and Down already do in the field they are in, so putting them in the tab order would mean tabbing past a form's number landing on two buttons before reaching the next question. Same argument, and the same TabIndex, as SearchBox's clear button.

⚠ They disable at the ends of the range, which is a picture of something a click cannot show. Number is clamped to [Minimum, Maximum], so an arrow at the end has always done nothing; what is being fixed is that it did nothing silently. A greyed arrow is what tells a person — and, through AccessibleStates.Disabled, an assistive technology — which way there is left to go.

Fields and properties (3)

  • protected override string TagName

    The element name this type answers to when a caller does not choose one.

  • public IconButton DecrementButton

    The arrow that takes one step off.

  • public IconButton IncrementButton

    The arrow that adds one.

Methods (2)

  • protected override void OnCreated()

    Builds whatever this element is made of, once, as it joins a document.

  • protected override void OnPropertyChanged(UiPropertyKey key)

Used by (2)

  • GalleryHelloUi
  • StepperTestsVixen.Ui.Controls.Tests