pub struct SpinboxWidget {
pub value: i32,
pub min: i32,
pub max: i32,
pub step: i32,
pub digits: u8,
pub decimals: u8,
pub focused_digit: u8,
}Expand description
High-precision numeric spinbox widget with digit-level cursor selection.
Fields§
§value: i32§min: i32§max: i32§step: i32§digits: u8§decimals: u8§focused_digit: u8Implementations§
Source§impl SpinboxWidget
impl SpinboxWidget
pub const fn new(min: i32, max: i32, value: i32) -> Self
pub const fn with_decimals(self, decimals: u8) -> Self
pub const fn with_digits(self, digits: u8) -> Self
pub const fn with_step(self, step: i32) -> Self
Sourcepub fn current_digit_multiplier(&self) -> i32
pub fn current_digit_multiplier(&self) -> i32
Step value based on currently active focused digit (10^focused_digit).
Sourcepub fn prev_digit(&mut self)
pub fn prev_digit(&mut self)
Moves cursor to previous (more significant / left) digit.
Sourcepub fn next_digit(&mut self)
pub fn next_digit(&mut self)
Moves cursor to next (less significant / right) digit.
pub fn format_text(&self, out: &mut String<16>)
pub fn render<D, C>( &self, ctx: &mut RenderCtx<'_, D, C>, rect: Rect, style: WidgetStyle, state: VisualState, ) -> Result<(), D::Error>
Trait Implementations§
Source§impl Clone for SpinboxWidget
impl Clone for SpinboxWidget
Source§fn clone(&self) -> SpinboxWidget
fn clone(&self) -> SpinboxWidget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SpinboxWidget
Source§impl Debug for SpinboxWidget
impl Debug for SpinboxWidget
impl Eq for SpinboxWidget
Source§impl PartialEq for SpinboxWidget
impl PartialEq for SpinboxWidget
impl StructuralPartialEq for SpinboxWidget
Source§impl Widget for SpinboxWidget
impl Widget for SpinboxWidget
fn render_widget_bounds(&self, _bounds: Rect, _style: &Style)
fn get_property(&self, key: PropertyKey) -> Option<PropertyValue<'_>>
fn set_property<'a>( &mut self, key: PropertyKey, val: PropertyValue<'a>, ) -> Result<(), PropertyError>
fn handle_widget_event( &mut self, _event: &UiEvent, _ctx: &mut EventContext, ) -> EventPolicy
Auto Trait Implementations§
impl Freeze for SpinboxWidget
impl RefUnwindSafe for SpinboxWidget
impl Send for SpinboxWidget
impl Sync for SpinboxWidget
impl Unpin for SpinboxWidget
impl UnsafeUnpin for SpinboxWidget
impl UnwindSafe for SpinboxWidget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.