Struct imgui::VerticalSlider

source ·
pub struct VerticalSlider<Label, Data, Format = &'static str> { /* private fields */ }
Expand description

Builder for a vertical slider widget.

Implementations§

source§

impl<Label, Data> VerticalSlider<Label, Data>
where Label: AsRef<str>, Data: DataTypeKind,

source

pub fn new( label: Label, size: impl Into<Vector2<f32>>, min: Data, max: Data ) -> Self

Constructs a new vertical slider builder with the given size and range.

imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
    .range(4, 8)
    // Remember to call .build(&ui)
    ;

It is safe, though up to C++ Dear ImGui, on how to handle when min > max.

source§

impl<Label, Data, Format> VerticalSlider<Label, Data, Format>
where Label: AsRef<str>, Data: DataTypeKind, Format: AsRef<str>,

source

pub fn range(self, min: Data, max: Data) -> Self

Sets the range for the vertical slider.

imgui::VerticalSlider::new("Example", [20.0, 20.0], i8::MIN, i8::MAX)
    .range(4, 8)
    // Remember to call .build(&ui)
    ;

It is safe, though up to C++ Dear ImGui, on how to handle when min > max.

source

pub fn display_format<Format2: AsRef<str>>( self, display_format: Format2 ) -> VerticalSlider<Label, Data, Format2>

Sets the display format using a C-style printf string

source

pub fn flags(self, flags: SliderFlags) -> Self

Replaces all current settings with the given flags

source

pub fn build(self, ui: &Ui, value: &mut Data) -> bool

Builds a vertical slider that is bound to the given value.

Returns true if the slider value was changed.

Trait Implementations§

source§

impl<Label: Clone, Data: Clone, Format: Clone> Clone for VerticalSlider<Label, Data, Format>

source§

fn clone(&self) -> VerticalSlider<Label, Data, Format>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Label: Debug, Data: Debug, Format: Debug> Debug for VerticalSlider<Label, Data, Format>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Label, Data, Format> Freeze for VerticalSlider<Label, Data, Format>
where Label: Freeze, Data: Freeze, Format: Freeze,

§

impl<Label, Data, Format> RefUnwindSafe for VerticalSlider<Label, Data, Format>
where Label: RefUnwindSafe, Data: RefUnwindSafe, Format: RefUnwindSafe,

§

impl<Label, Data, Format> Send for VerticalSlider<Label, Data, Format>
where Label: Send, Data: Send, Format: Send,

§

impl<Label, Data, Format> Sync for VerticalSlider<Label, Data, Format>
where Label: Sync, Data: Sync, Format: Sync,

§

impl<Label, Data, Format> Unpin for VerticalSlider<Label, Data, Format>
where Label: Unpin, Data: Unpin, Format: Unpin,

§

impl<Label, Data, Format> UnwindSafe for VerticalSlider<Label, Data, Format>
where Label: UnwindSafe, Data: UnwindSafe, Format: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.