NumberPicker
ReferencesStandard 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
Properties
Bounds
#public RectangleF Bounds { get; set; }
Gets or sets the layout bounds for this picker. Resizing retains the zoom, not the visible limits.
Centre
#Gets or sets the exact number underneath the marker line. Unlike Value this number is never rounded.
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.
Quantum
#Gets the distance between the smallest visible ticks. This is the quantum the value is rounded to when snapping.
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.
Value
#Gets the picked value. This is the number underneath the marker line, rounded to the visible tick density when SnapToTicks is on.
Methods
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.
Parameters:
| context (Context) | Graphics context. |
| fill (Color) | Solid balloon colour, the text is drawn in a contrasting colour. |
FormatValue
#Write a number to the decimals of a tick class.
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.
Parameters:
| value (decimal) | Number to format. |
Returns: Formatted number.
QuantumFor
#Compute the distance between the smallest ticks visible at a zoom.
Parameters:
| scale (decimal) | Zoom, expressed as numberline units per pixel. |
Returns: Quantum at that zoom.
SetValue
#Assign a value. The numberline is recentred exactly on the new value, the zoom is retained.
Parameters:
| value (decimal) | New value. |
SnapBack
#public void SnapBack()
Recentre the numberline exactly on the current value. The motion is animated, the value itself does not change.
SnapBackWhenIdle
#public void SnapBackWhenIdle()
Snap back once navigation has been quiet for a moment. Used by navigation paths which have no explicit end signal.
TickExponentFor
#Compute the power-of-ten exponent of the smallest tick class visible at a zoom.
Parameters:
| scale (decimal) | Zoom, expressed as numberline units per pixel. |
Returns: Exponent of the finest visible tick class.