Struct egui::widgets::DragValue[][src]

#[must_use = "You should put this widget in an ui with `ui.add(widget);`"]pub struct DragValue<'a> { /* fields omitted */ }

A numeric value that you can change by dragging the number. More compact than a Slider.

ui.add(egui::DragValue::f32(&mut my_f32).speed(0.1));

Implementations

impl<'a> DragValue<'a>[src]

pub fn f32(value: &'a mut f32) -> Self[src]

pub fn f64(value: &'a mut f64) -> Self[src]

pub fn i8(value: &'a mut i8) -> Self[src]

pub fn u8(value: &'a mut u8) -> Self[src]

pub fn i16(value: &'a mut i16) -> Self[src]

pub fn u16(value: &'a mut u16) -> Self[src]

pub fn i32(value: &'a mut i32) -> Self[src]

pub fn u32(value: &'a mut u32) -> Self[src]

pub fn i64(value: &'a mut i64) -> Self[src]

pub fn u64(value: &'a mut u64) -> Self[src]

pub fn isize(value: &'a mut isize) -> Self[src]

pub fn usize(value: &'a mut usize) -> Self[src]

pub fn from_get_set(get_set_value: impl 'a + FnMut(Option<f64>) -> f64) -> Self[src]

pub fn speed(self, speed: impl Into<f64>) -> Self[src]

How much the value changes when dragged one point (logical pixel).

pub fn clamp_range(self, clamp_range: RangeInclusive<f32>) -> Self[src]

Clamp incoming and outgoing values to this range.

pub fn clamp_range_f64(self, clamp_range: RangeInclusive<f64>) -> Self[src]

pub fn range(self, clamp_range: RangeInclusive<f32>) -> Self[src]

👎 Deprecated:

Renamed clamp_range

pub fn prefix(self, prefix: impl ToString) -> Self[src]

Show a prefix before the number, e.g. “x: “

pub fn suffix(self, suffix: impl ToString) -> Self[src]

Add a suffix to the number, this can be e.g. a unit (“°” or “ m“)

pub fn min_decimals(self, min_decimals: usize) -> Self[src]

Set a minimum number of decimals to display. Normally you don’t need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use “smart aim” to help the user select nice, round values.

pub fn max_decimals(self, max_decimals: usize) -> Self[src]

Set a maximum number of decimals to display. Values will also be rounded to this number of decimals. Normally you don’t need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use “smart aim” to help the user select nice, round values.

pub fn max_decimals_opt(self, max_decimals: Option<usize>) -> Self[src]

pub fn fixed_decimals(self, num_decimals: usize) -> Self[src]

Set an exact number of decimals to display. Values will also be rounded to this number of decimals. Normally you don’t need to pick a precision, as the slider will intelligently pick a precision for you. Regardless of precision the slider will use “smart aim” to help the user select nice, round values.

Trait Implementations

impl<'a> Widget for DragValue<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for DragValue<'a>

impl<'a> !Send for DragValue<'a>

impl<'a> !Sync for DragValue<'a>

impl<'a> Unpin for DragValue<'a>

impl<'a> !UnwindSafe for DragValue<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.