Struct arcdps_imgui::Slider

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

Builder for a slider widget.

Implementations§

source§

impl<T: AsRef<str>, K: DataTypeKind> Slider<T, K>

source

pub fn new(label: T, min: K, max: K) -> Self

Constructs a new slider builder with the given range.

source§

impl<Label, Data, Format> Slider<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 inclusively, such that both values given are valid values which the slider can be dragged to.

arcdps_imgui::Slider::new(im_str!("Example"), 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 ) -> Slider<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 slider that is bound to the given value.

Returns true if the slider value was changed.

source

pub fn build_array(self, ui: &Ui<'_>, values: &mut [Data]) -> bool

Builds a horizontal array of multiple sliders attached to the given slice.

Returns true if any slider value was changed.

Trait Implementations§

source§

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

source§

fn clone(&self) -> Slider<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 Slider<Label, Data, Format>

source§

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

Formats the value using the given formatter. Read more
source§

impl<Label: Copy, Data: Copy, Format: Copy> Copy for Slider<Label, Data, Format>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<Label, Data, Format> UnwindSafe for Slider<Label, Data, Format>
where Data: UnwindSafe, Format: UnwindSafe, Label: 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.