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 Label: Freeze, Data: Freeze, Format: Freeze,

§

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

§

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

§

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

§

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

§

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

source§

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>,

source§

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>,

source§

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.