NumberPicker

References
public sealed class NumberPicker : IResponsive
Standard numberline picker UX object. The picked value is always the number underneath a fixed marker line in the horizontal centre of the control. The numberline itself is dragged and zoomed underneath that marker.

Constructors

NumberPicker

#
Create a default number picker.
public NumberPicker()

NumberPicker

#
Create a number picker based on an initial value and zoom.
public NumberPicker(
number,
Initial value.
scale
Zoom, expressed as numberline units per pixel.
)

NumberPicker

#
Create a number picker based on an initial value.
public NumberPicker(
number
)

NumberPicker

#
Create a number picker initialised to a specific number. The number specifies the zoom and value, the lower and upper limits define the range of numbers that can be picked.
public NumberPicker(
initial
)

Properties

BackColour

#
Gets or sets the colour of the picker background.
public Color BackColour { get; set; }

Bounds

#
Gets or sets the layout bounds for this picker. Resizing retains the zoom, not the visible limits.
public RectangleF Bounds { get; set; }

Centre

#
Gets or sets the exact number underneath the marker line. Unlike Value this number is never rounded.
public decimal Centre { get; set; }

Limits

#
Gets the limits for this picker. The limits define the lowest and highest allowed values. The value of the UiNumber represents the original value.
public UiNumber Limits { get; }

LineColour

#
Gets or sets the colour of the marker line.
public Color LineColour { get; set; }

Quantum

#
Gets the distance between the smallest visible ticks. This is the quantum the value is rounded to when snapping.
public decimal Quantum { get; }

Responder

#
public Responses Responder { get; }
Responder

Scale

#
Gets or sets the zoom of the numberline, expressed as numberline units per pixel.
public decimal Scale { get; set; }

ShowBalloon

#
Gets or sets whether a value balloon is drawn above the marker line while the cursor hovers over the picker or the numberline is navigated.
public bool ShowBalloon { get; set; }

SnapToTicks

#
Gets or sets whether the value is rounded to the visible tick density.
public bool SnapToTicks { get; set; }

TickExponent

#
Gets the power-of-ten exponent of the smallest visible tick class.
public int TickExponent { get; }

Value

#
Gets the picked value. This is the number underneath the marker line, rounded to the visible tick density when SnapToTicks is on.
public decimal Value { get; }

Methods

Draw

#
Render this picker into a context.
public void Draw(
context
Graphics context.
)

DrawBalloon

#
Render the value balloon above the marker line. The balloon sticks out above the bounds, so this must be called without a clipping region in place.
public void DrawBalloon(
context,
Graphics context.
Color
fill
Solid balloon colour, the text is drawn in a contrasting colour.
)

FormatValue

#
Write a number to the decimals of a tick class.
public static string FormatValue(
value,
Number to format.
exponent
Power-of-ten exponent of the tick class.
)
Formatted number.

FormatValue

#
Write a number the way the balloon would show it at the current zoom. With snapping on the decimals follow the finest visible tick class, without it the number is written out in full.
public string FormatValue(
value
Number to format.
)
Formatted number.

QuantumFor

#
Compute the distance between the smallest ticks visible at a zoom.
public static decimal QuantumFor(
scale
Zoom, expressed as numberline units per pixel.
)
Quantum at that zoom.

SetValue

#
Assign a value. The numberline is recentred exactly on the new value, the zoom is retained.
public void SetValue(
value
New value.
)

SnapBack

#
Recentre the numberline exactly on the current value. The motion is animated, the value itself does not change.
public void SnapBack()

SnapBackWhenIdle

#
Snap back once navigation has been quiet for a moment. Used by navigation paths which have no explicit end signal.
public void SnapBackWhenIdle()

TickExponentFor

#
Compute the power-of-ten exponent of the smallest tick class visible at a zoom.
public static int TickExponentFor(
scale
Zoom, expressed as numberline units per pixel.
)
Exponent of the finest visible tick class.

Zoom

#
Compute a zoomed scale from a base scale and a vertical mouse motion. Uses the same convention as Movement zooming, a downward motion of fifty pixels doubles the scale.
public static decimal Zoom(
scale,
Base scale.
dy
Vertical mouse motion in pixels.
)
Zoomed scale.

Events

PickerDisplayChanged

#
This event is raised whenever the picker state, but not the value changes.
public event EventHandler<NumberPickerEventArgs> PickerDisplayChanged

PickerValueChanged

#
This event is raised whenever the picker value changes.
public event EventHandler<NumberPickerEventArgs> PickerValueChanged