FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<NumericUpDown>
    

    Returns a strong reference to this object.

    Source

    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.

    Source

    on_format_string_changed

    fn on_format_string_changed(self: &Self, old_value: &str, new_value: &str)
    

    Called when the FormatString property value changed.

    Source

    on_increment_changed

    fn on_increment_changed(self: &Self, old_value: Decimal, new_value: Decimal)
    

    Called when the Increment property value changed.

    Source

    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.

    Source

    on_maximum_changed

    fn on_maximum_changed(self: &Self, old_value: Decimal, new_value: Decimal)
    

    Called when the Maximum property value changed.

    Source

    on_minimum_changed

    fn on_minimum_changed(self: &Self, old_value: Decimal, new_value: Decimal)
    

    Called when the Minimum property value changed.

    Source

    on_text_changed

    fn on_text_changed(self: &Self, old_value: Option<&str>, new_value: Option<&str>)
    

    Called when the Text property value changed.

    Source

    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.

    Source

    on_value_changed

    fn on_value_changed(self: &Self, old_value: Option<Decimal>, new_value: Option<Decimal>)
    

    Called when the Value property value changed.

    Source

    on_coerce_increment

    fn on_coerce_increment(self: &Self, base_value: Decimal) -> Decimal
    

    Called when the Increment property has to be coerced.

    Source

    on_coerce_maximum

    fn on_coerce_maximum(self: &Self, base_value: Decimal) -> Decimal
    

    Called when the Maximum property has to be coerced.

    Source

    on_coerce_minimum

    fn on_coerce_minimum(self: &Self, base_value: Decimal) -> Decimal
    

    Called when the Minimum property has to be coerced.

    Source

    on_coerce_value

    fn on_coerce_value(self: &Self, base_value: Option<Decimal>) -> Option<Decimal>
    

    Called when the Value property has to be coerced.

    Source

    on_spin

    fn on_spin(self: &Self, e: &SpinEventArgs)
    

    Raises the Spinned event when spinning is initiated by the end-user.

    Source

    raise_value_changed_event

    fn raise_value_changed_event(self: &Self, old_value: Option<Decimal>, new_value: Option<Decimal>)
    

    Raises the ValueChanged event.

    Source

    allow_spin_property

    fn allow_spin_property() -> &'static StyledProperty<bool>
    

    Defines the AllowSpin property.

    Source

    button_spinner_location_property

    fn button_spinner_location_property() -> &'static StyledProperty<Location>
    

    Defines the ButtonSpinnerLocation property.

    Source

    show_button_spinner_property

    fn show_button_spinner_property() -> &'static StyledProperty<bool>
    

    Defines the ShowButtonSpinner property.

    Source

    clip_value_to_min_max_property

    fn clip_value_to_min_max_property() -> &'static StyledProperty<bool>
    

    Defines the ClipValueToMinMax property.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    number_format_property

    fn number_format_property() -> &'static StyledProperty<Option<Rc<NumberFormatInfo>>>
    

    Defines the NumberFormat property.

    Source

    format_string_property

    fn format_string_property() -> &'static StyledProperty<String>
    

    Defines the FormatString property.

    Source

    increment_property

    fn increment_property() -> &'static StyledProperty<Decimal>
    

    Defines the Increment property.

    Source

    is_read_only_property

    fn is_read_only_property() -> &'static StyledProperty<bool>
    

    Defines the IsReadOnly property.

    Source

    maximum_property

    fn maximum_property() -> &'static StyledProperty<Decimal>
    

    Defines the Maximum property.

    Source

    minimum_property

    fn minimum_property() -> &'static StyledProperty<Decimal>
    

    Defines the Minimum property.

    Source

    parsing_number_style_property

    fn parsing_number_style_property() -> &'static StyledProperty<NumberStyles>
    

    Defines the ParsingNumberStyle property.

    Source

    text_property

    fn text_property() -> &'static StyledProperty<Option<String>>
    

    Defines the Text property.

    Source

    text_converter_property

    fn text_converter_property() -> &'static StyledProperty<Option<Rc<dyn IValueConverter>>>
    

    Defines the TextConverter property.

    Source

    value_property

    fn value_property() -> &'static StyledProperty<Option<Decimal>>
    

    Defines the Value property.

    Source

    placeholder_text_property

    fn placeholder_text_property() -> &'static StyledProperty<Option<String>>
    

    Defines the PlaceholderText property.

    Source

    placeholder_foreground_property

    fn placeholder_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the PlaceholderForeground property.

    Source

    horizontal_content_alignment_property

    fn horizontal_content_alignment_property() -> &'static StyledProperty<HorizontalAlignment>
    

    Defines the HorizontalContentAlignment property.

    Source

    vertical_content_alignment_property

    fn vertical_content_alignment_property() -> &'static StyledProperty<VerticalAlignment>
    

    Defines the VerticalContentAlignment property.

    Source

    text_alignment_property

    fn text_alignment_property() -> &'static AttachedProperty<TextAlignment>
    

    Defines the TextAlignment property.

    Source

    inner_left_content_property

    fn inner_left_content_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the InnerLeftContent property.

    Source

    inner_right_content_property

    fn inner_right_content_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Defines the InnerRightContent property.

    Source

    watermark_property

    fn watermark_property() -> &'static StyledProperty<Option<String>>
    

    Defines the Watermark property.

    Deprecated. Use placeholder_text_property instead.

    Source

    watermark_foreground_property

    fn watermark_foreground_property() -> &'static StyledProperty<Option<Rc<dyn IBrush>>>
    

    Defines the WatermarkForeground property.

    Deprecated. Use placeholder_foreground_property instead.

    Source

    value_changed_event

    fn value_changed_event() -> &'static RoutedEvent<NumericUpDownValueChangedEventArgs>
    

    Defines the ValueChanged event.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a numeric up-down control.

    Source

    allow_spin

    fn allow_spin(self: &Self) -> bool
    

    Whether increment/decrement operations via the keyboard, the button spinners or the mouse wheel are possible.

    Source

    set_allow_spin

    fn set_allow_spin(self: &Self, value: bool)
    

    Source

    button_spinner_location

    fn button_spinner_location(self: &Self) -> Location
    

    The current location of the button spinner.

    Source

    set_button_spinner_location

    fn set_button_spinner_location(self: &Self, value: Location)
    

    Source

    show_button_spinner

    fn show_button_spinner(self: &Self) -> bool
    

    Whether the spin buttons should be shown.

    Source

    set_show_button_spinner

    fn set_show_button_spinner(self: &Self, value: bool)
    

    Source

    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.

    Source

    set_clip_value_to_min_max

    fn set_clip_value_to_min_max(self: &Self, value: bool)
    

    Source

    accepts_expression

    fn accepts_expression(self: &Self) -> bool
    

    Gets whether text that is not a number is evaluated as an arithmetic expression.

    Source

    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.

    Source

    large_change

    fn large_change(self: &Self) -> Option<Decimal>
    

    Gets the step of PageUp and PageDown; None leaves the keys unhandled.

    Source

    set_large_change

    fn set_large_change(self: &Self, value: Option<Decimal>)
    

    Sets the step of PageUp and PageDown; None leaves the keys unhandled.

    Source

    is_wrap_enabled

    fn is_wrap_enabled(self: &Self) -> bool
    

    Gets whether a step past one bound goes to the other.

    Source

    set_is_wrap_enabled

    fn set_is_wrap_enabled(self: &Self, value: bool)
    

    Sets whether a step past one bound goes to the other.

    Source

    number_format

    fn number_format(self: &Self) -> Option<Rc<NumberFormatInfo>>
    

    The current number format information.

    Source

    set_number_format

    fn set_number_format(self: &Self, value: Option<Rc<NumberFormatInfo>>)
    

    Source

    format_string

    fn format_string(self: &Self) -> String
    

    The display format of the Value.

    Source

    set_format_string

    fn set_format_string(self: &Self, value: &str)
    

    Source

    increment

    fn increment(self: &Self) -> Decimal
    

    The amount in which to increment the Value.

    Source

    set_increment

    fn set_increment(self: &Self, value: Decimal)
    

    Source

    is_read_only

    fn is_read_only(self: &Self) -> bool
    

    Whether the control is read only.

    Source

    set_is_read_only

    fn set_is_read_only(self: &Self, value: bool)
    

    Source

    maximum

    fn maximum(self: &Self) -> Decimal
    

    The maximum allowed value.

    Source

    set_maximum

    fn set_maximum(self: &Self, value: Decimal)
    

    Source

    minimum

    fn minimum(self: &Self) -> Decimal
    

    The minimum allowed value.

    Source

    set_minimum

    fn set_minimum(self: &Self, value: Decimal)
    

    Source

    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.

    Source

    set_parsing_number_style

    fn set_parsing_number_style(self: &Self, value: NumberStyles)
    

    Source

    text

    fn text(self: &Self) -> Option<String>
    

    The formatted string representation of the value.

    Source

    set_text

    fn set_text(self: &Self, value: Option<&str>)
    

    Source

    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.

    Source

    set_text_converter

    fn set_text_converter(self: &Self, value: Option<Rc<dyn IValueConverter>>)
    

    Source

    value

    fn value(self: &Self) -> Option<Decimal>
    

    The value.

    Source

    set_numeric_value

    fn set_numeric_value(self: &Self, value: Option<Decimal>)
    

    Source

    placeholder_text

    fn placeholder_text(self: &Self) -> Option<String>
    

    The text to use as a placeholder if the Value is null.

    Source

    set_placeholder_text

    fn set_placeholder_text(self: &Self, value: Option<&str>)
    

    Source

    watermark

    fn watermark(self: &Self) -> Option<String>
    

    The text to use as a placeholder if the Value is null.

    Deprecated. Use placeholder_text instead.

    Source

    set_watermark

    fn set_watermark(self: &Self, value: Option<&str>)
    

    Deprecated. Use set_placeholder_text instead.

    Source

    placeholder_foreground

    fn placeholder_foreground(self: &Self) -> Option<Rc<dyn IBrush>>
    

    The brush used for the foreground color of the placeholder text.

    Source

    set_placeholder_foreground

    fn set_placeholder_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Source

    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.

    Source

    set_watermark_foreground

    fn set_watermark_foreground(self: &Self, value: Option<Rc<dyn IBrush>>)
    

    Deprecated. Use set_placeholder_foreground instead.

    Source

    horizontal_content_alignment

    fn horizontal_content_alignment(self: &Self) -> HorizontalAlignment
    

    The horizontal alignment of the content within the control.

    Source

    set_horizontal_content_alignment

    fn set_horizontal_content_alignment(self: &Self, value: HorizontalAlignment)
    

    Source

    vertical_content_alignment

    fn vertical_content_alignment(self: &Self) -> VerticalAlignment
    

    The vertical alignment of the content within the control.

    Source

    set_vertical_content_alignment

    fn set_vertical_content_alignment(self: &Self, value: VerticalAlignment)
    

    Source

    text_alignment

    fn text_alignment(self: &Self) -> TextAlignment
    

    The text alignment of the control.

    Source

    set_text_alignment

    fn set_text_alignment(self: &Self, value: TextAlignment)
    

    Source

    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.

    Source

    set_inner_left_content

    fn set_inner_left_content(self: &Self, value: Option<BoxedValue>)
    

    Source

    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.

    Source

    set_inner_right_content

    fn set_inner_right_content(self: &Self, value: Option<BoxedValue>)
    

    Source

    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.

    Source

    value_changed

    fn value_changed(self: &Self, handler: impl Fn(&Interactive, &NumericUpDownValueChangedEventArgs) -> () + 'static) -> RoutedEventHandlerToken
    

    Raised when the Value changes.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.