NumericUpDown
struct · ferroui-controls · v0.5.0
struct NumericUpDown
Control that represents a text box with button spinners that allow incrementing and decrementing numeric values.
Members
TYPEto_refon_number_format_changedon_format_string_changedon_increment_changedon_is_read_only_changedon_maximum_changedon_minimum_changedon_text_changedon_text_converter_changedon_value_changedon_coerce_incrementon_coerce_maximumon_coerce_minimumon_coerce_valueon_spinraise_value_changed_eventallow_spin_propertybutton_spinner_location_propertyshow_button_spinner_propertyclip_value_to_min_max_propertyaccepts_expression_propertylarge_change_propertyis_wrap_enabled_propertynumber_format_propertyformat_string_propertyincrement_propertyis_read_only_propertymaximum_propertyminimum_propertyparsing_number_style_propertytext_propertytext_converter_propertyvalue_propertyplaceholder_text_propertyplaceholder_foreground_propertyhorizontal_content_alignment_propertyvertical_content_alignment_propertytext_alignment_propertyinner_left_content_propertyinner_right_content_propertywatermark_propertywatermark_foreground_propertyvalue_changed_eventconstructnewallow_spinset_allow_spinbutton_spinner_locationset_button_spinner_locationshow_button_spinnerset_show_button_spinnerclip_value_to_min_maxset_clip_value_to_min_maxaccepts_expressionset_accepts_expressionlarge_changeset_large_changeis_wrap_enabledset_is_wrap_enablednumber_formatset_number_formatformat_stringset_format_stringincrementset_incrementis_read_onlyset_is_read_onlymaximumset_maximumminimumset_minimumparsing_number_styleset_parsing_number_styletextset_texttext_converterset_text_convertervalueset_numeric_valueplaceholder_textset_placeholder_textwatermarkset_watermarkplaceholder_foregroundset_placeholder_foregroundwatermark_foregroundset_watermark_foregroundhorizontal_content_alignmentset_horizontal_content_alignmentvertical_content_alignmentset_vertical_content_alignmenttext_alignmentset_text_alignmentinner_left_contentset_inner_left_contentinner_right_contentset_inner_right_contentspinnedvalue_changed
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<NumericUpDown>
Returns a strong reference to this object.
on_number_format_changed
fn on_number_format_changed(self: &Self, old_value: Option<Rc<NumberFormatInfo>>, new_value: Option<Rc<NumberFormatInfo>>)
Called when the NumberFormat property value changed.
on_format_string_changed
fn on_format_string_changed(self: &Self, old_value: &str, new_value: &str)
Called when the FormatString property value changed.
on_increment_changed
fn on_increment_changed(self: &Self, old_value: Decimal, new_value: Decimal)
Called when the Increment property value changed.
on_is_read_only_changed
fn on_is_read_only_changed(self: &Self, old_value: bool, new_value: bool)
Called when the IsReadOnly property value changed.
on_maximum_changed
fn on_maximum_changed(self: &Self, old_value: Decimal, new_value: Decimal)
Called when the Maximum property value changed.
on_minimum_changed
fn on_minimum_changed(self: &Self, old_value: Decimal, new_value: Decimal)
Called when the Minimum property value changed.
on_text_changed
fn on_text_changed(self: &Self, old_value: Option<&str>, new_value: Option<&str>)
Called when the Text property value changed.
on_text_converter_changed
fn on_text_converter_changed(self: &Self, old_value: Option<Rc<dyn IValueConverter>>, new_value: Option<Rc<dyn IValueConverter>>)
Called when the TextConverter property value changed.
on_value_changed
fn on_value_changed(self: &Self, old_value: Option<Decimal>, new_value: Option<Decimal>)
Called when the Value property value changed.
on_coerce_increment
fn on_coerce_increment(self: &Self, base_value: Decimal) -> Decimal
Called when the Increment property has to be coerced.
on_coerce_maximum
fn on_coerce_maximum(self: &Self, base_value: Decimal) -> Decimal
Called when the Maximum property has to be coerced.
on_coerce_minimum
fn on_coerce_minimum(self: &Self, base_value: Decimal) -> Decimal
Called when the Minimum property has to be coerced.
on_coerce_value
fn on_coerce_value(self: &Self, base_value: Option<Decimal>) -> Option<Decimal>
Called when the Value property has to be coerced.
on_spin
fn on_spin(self: &Self, e: &SpinEventArgs)
Raises the Spinned event when spinning is initiated by the
end-user.
raise_value_changed_event
fn raise_value_changed_event(self: &Self, old_value: Option<Decimal>, new_value: Option<Decimal>)
Raises the ValueChanged event.
allow_spin_property
fn allow_spin_property() -> &'static StyledProperty<bool>
Defines the AllowSpin property.
button_spinner_location_property
fn button_spinner_location_property() -> &'static StyledProperty<Location>
Defines the ButtonSpinnerLocation property.
show_button_spinner_property
fn show_button_spinner_property() -> &'static StyledProperty<bool>
Defines the ShowButtonSpinner property.
clip_value_to_min_max_property
fn clip_value_to_min_max_property() -> &'static StyledProperty<bool>
Defines the ClipValueToMinMax property.
accepts_expression_property
fn accepts_expression_property() -> &'static StyledProperty<bool>
Defines the AcceptsExpression property: a FerroUI addition after WinUI's
NumberBox.AcceptsExpression (DEVIATIONS.md, "WinUI additions to upstream controls").
With it, text that is not a number is evaluated as an arithmetic expression
(utils::number_expression). false by default, which keeps upstream's parsing.
large_change_property
fn large_change_property() -> &'static StyledProperty<Option<Decimal>>
Defines the LargeChange property: a FerroUI addition after WinUI's
NumberBox.LargeChange, the step of PageUp and PageDown. None by default: the keys
are not handled and bubble (to a scroll viewer), as upstream.
is_wrap_enabled_property
fn is_wrap_enabled_property() -> &'static StyledProperty<bool>
Defines the IsWrapEnabled property: a FerroUI addition after WinUI's
NumberBox.IsWrapEnabled. With it, a step past Maximum goes to Minimum and a step
below Minimum to Maximum. false by default: a step stops at the bounds, as
upstream.
number_format_property
fn number_format_property() -> &'static StyledProperty<Option<Rc<NumberFormatInfo>>>
Defines the NumberFormat property.
format_string_property
fn format_string_property() -> &'static StyledProperty<String>
Defines the FormatString property.
increment_property
fn increment_property() -> &'static StyledProperty<Decimal>
Defines the Increment property.
is_read_only_property
fn is_read_only_property() -> &'static StyledProperty<bool>
Defines the IsReadOnly property.
maximum_property
fn maximum_property() -> &'static StyledProperty<Decimal>
Defines the Maximum property.
minimum_property
fn minimum_property() -> &'static StyledProperty<Decimal>
Defines the Minimum property.
parsing_number_style_property
fn parsing_number_style_property() -> &'static StyledProperty<NumberStyles>
Defines the ParsingNumberStyle property.
text_property
fn text_property() -> &'static StyledProperty<Option<String>>
Defines the Text property.
text_converter_property
fn text_converter_property() -> &'static StyledProperty<Option<Rc<dyn IValueConverter>>>
Defines the TextConverter property.
value_property
fn value_property() -> &'static StyledProperty<Option<Decimal>>
Defines the Value property.
placeholder_text_property
fn placeholder_text_property() -> &'static StyledProperty<Option<String>>
Defines the PlaceholderText property.
placeholder_foreground_property
fn placeholder_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the PlaceholderForeground property.
horizontal_content_alignment_property
fn horizontal_content_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
Defines the HorizontalContentAlignment property.
vertical_content_alignment_property
fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
Defines the VerticalContentAlignment property.
text_alignment_property
fn text_alignment_property() -> &'static AttachedProperty<TextAlignment>
Defines the TextAlignment property.
inner_left_content_property
fn inner_left_content_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the InnerLeftContent property.
inner_right_content_property
fn inner_right_content_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the InnerRightContent property.
watermark_property
fn watermark_property() -> &'static StyledProperty<Option<String>>
Defines the Watermark property.
Deprecated. Use placeholder_text_property instead.
watermark_foreground_property
fn watermark_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
Defines the WatermarkForeground property.
Deprecated. Use placeholder_foreground_property instead.
value_changed_event
fn value_changed_event() -> &'static RoutedEvent<NumericUpDownValueChangedEventArgs>
Defines the ValueChanged event.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a numeric up-down control.
allow_spin
fn allow_spin(self: &Self) -> bool
Whether increment/decrement operations via the keyboard, the button spinners or the mouse wheel are possible.
set_allow_spin
fn set_allow_spin(self: &Self, value: bool)
button_spinner_location
fn button_spinner_location(self: &Self) -> Location
The current location of the button spinner.
set_button_spinner_location
fn set_button_spinner_location(self: &Self, value: Location)
show_button_spinner
fn show_button_spinner(self: &Self) -> bool
Whether the spin buttons should be shown.
set_show_button_spinner
fn set_show_button_spinner(self: &Self, value: bool)
clip_value_to_min_max
fn clip_value_to_min_max(self: &Self) -> bool
Whether the value should be clipped when the minimum/maximum is reached.
set_clip_value_to_min_max
fn set_clip_value_to_min_max(self: &Self, value: bool)
accepts_expression
fn accepts_expression(self: &Self) -> bool
Gets whether text that is not a number is evaluated as an arithmetic expression.
set_accepts_expression
fn set_accepts_expression(self: &Self, value: bool)
Sets whether text that is not a number is evaluated as an arithmetic expression.
large_change
fn large_change(self: &Self) -> Option<Decimal>
Gets the step of PageUp and PageDown; None leaves the keys unhandled.
set_large_change
fn set_large_change(self: &Self, value: Option<Decimal>)
Sets the step of PageUp and PageDown; None leaves the keys unhandled.
is_wrap_enabled
fn is_wrap_enabled(self: &Self) -> bool
Gets whether a step past one bound goes to the other.
set_is_wrap_enabled
fn set_is_wrap_enabled(self: &Self, value: bool)
Sets whether a step past one bound goes to the other.
number_format
fn number_format(self: &Self) -> Option<Rc<NumberFormatInfo>>
The current number format information.
set_number_format
fn set_number_format(self: &Self, value: Option<Rc<NumberFormatInfo>>)
format_string
fn format_string(self: &Self) -> String
The display format of the Value.
set_format_string
fn set_format_string(self: &Self, value: &str)
increment
fn increment(self: &Self) -> Decimal
The amount in which to increment the Value.
set_increment
fn set_increment(self: &Self, value: Decimal)
is_read_only
fn is_read_only(self: &Self) -> bool
Whether the control is read only.
set_is_read_only
fn set_is_read_only(self: &Self, value: bool)
maximum
fn maximum(self: &Self) -> Decimal
The maximum allowed value.
set_maximum
fn set_maximum(self: &Self, value: Decimal)
minimum
fn minimum(self: &Self) -> Decimal
The minimum allowed value.
set_minimum
fn set_minimum(self: &Self, value: Decimal)
parsing_number_style
fn parsing_number_style(self: &Self) -> NumberStyles
The parsing style (ALLOW_LEADING_WHITE, FLOAT, ...). By default,
ANY. Note that the hexadecimal styles do not work with decimals:
for a hexadecimal display, use the TextConverter.
set_parsing_number_style
fn set_parsing_number_style(self: &Self, value: NumberStyles)
text
fn text(self: &Self) -> Option<String>
The formatted string representation of the value.
set_text
fn set_text(self: &Self, value: Option<&str>)
text_converter
fn text_converter(self: &Self) -> Option<Rc<dyn IValueConverter>>
The custom bidirectional text-value converter. A converter overrides
the ParsingNumberStyle, providing finer control over the string
representation of the underlying value.
set_text_converter
fn set_text_converter(self: &Self, value: Option<Rc<dyn IValueConverter>>)
value
fn value(self: &Self) -> Option<Decimal>
The value.
set_numeric_value
fn set_numeric_value(self: &Self, value: Option<Decimal>)
placeholder_text
fn placeholder_text(self: &Self) -> Option<String>
The text to use as a placeholder if the Value is null.
set_placeholder_text
fn set_placeholder_text(self: &Self, value: Option<&str>)
watermark
fn watermark(self: &Self) -> Option<String>
The text to use as a placeholder if the Value is null.
Deprecated. Use placeholder_text instead.
set_watermark
fn set_watermark(self: &Self, value: Option<&str>)
Deprecated. Use set_placeholder_text instead.
placeholder_foreground
fn placeholder_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
The brush used for the foreground color of the placeholder text.
set_placeholder_foreground
fn set_placeholder_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
watermark_foreground
fn watermark_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
The brush used for the foreground color of the placeholder text.
Deprecated. Use placeholder_foreground instead.
set_watermark_foreground
fn set_watermark_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
Deprecated. Use set_placeholder_foreground instead.
horizontal_content_alignment
fn horizontal_content_alignment(self: &Self) -> HorizontalAlignment
The horizontal alignment of the content within the control.
set_horizontal_content_alignment
fn set_horizontal_content_alignment(self: &Self, value: HorizontalAlignment)
vertical_content_alignment
fn vertical_content_alignment(self: &Self) -> VerticalAlignment
The vertical alignment of the content within the control.
set_vertical_content_alignment
fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
text_alignment
fn text_alignment(self: &Self) -> TextAlignment
The text alignment of the control.
set_text_alignment
fn set_text_alignment(self: &Self, value: TextAlignment)
inner_left_content
fn inner_left_content(self: &Self) -> Option<BoxedValue>
Custom content that is positioned on the left side of the text layout box.
set_inner_left_content
fn set_inner_left_content(self: &Self, value: Option<BoxedValue>)
inner_right_content
fn inner_right_content(self: &Self) -> Option<BoxedValue>
Custom content that is positioned on the right side of the text layout box.
set_inner_right_content
fn set_inner_right_content(self: &Self, value: Option<BoxedValue>)
spinned
fn spinned(self: &Self, handler: impl Fn(&SpinEventArgs) -> () + 'static) -> Subscription
Occurs when spinning is initiated by the end-user.
Dropping the returned guard removes the handler;
Subscription::detach keeps it for the life of the control.
value_changed
fn value_changed(self: &Self, handler: impl Fn(&Interactive, &NumericUpDownValueChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
Raised when the Value changes.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtNumericUpDownImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<NumericUpDown>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplControlImplFerroObjectImplInputElementImplTemplatedControlImplNumericUpDownImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.