Struct imgui::AngleSlider

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

Builder for an angle slider widget.

Implementations§

source§

impl<Label> AngleSlider<Label>where Label: AsRef<str>,

source

pub fn new(label: Label) -> Self

Constructs a new angle slider builder, where its minimum defaults to -360.0 and maximum defaults to 360.0

source§

impl<Label, Format> AngleSlider<Label, Format>where Label: AsRef<str>, Format: AsRef<str>,

source

pub fn range_degrees(self, min_degrees: f32, max_degrees: f32) -> Self

Sets the range in degrees (inclusive)

imgui::AngleSlider::new("Example")
    .range_degrees(-20.0, 20.0)
    // Remember to call .build(&ui)
    ;

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

source

pub fn min_degrees(self, min_degrees: f32) -> Self

Sets the minimum value (in degrees)

source

pub fn max_degrees(self, max_degrees: f32) -> Self

Sets the maximum value (in degrees)

source

pub fn display_format<Format2: AsRef<str>>( self, display_format: Format2 ) -> AngleSlider<Label, 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_rad: &mut f32) -> bool

Builds an angle slider that is bound to the given value (in radians).

Returns true if the slider value was changed.

Trait Implementations§

source§

impl<Label: Clone, Format: Clone> Clone for AngleSlider<Label, Format>

source§

fn clone(&self) -> AngleSlider<Label, 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, Format: Debug> Debug for AngleSlider<Label, Format>

source§

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

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

impl<Label: Copy, Format: Copy> Copy for AngleSlider<Label, Format>

Auto Trait Implementations§

§

impl<Label, Format> RefUnwindSafe for AngleSlider<Label, Format>where Format: RefUnwindSafe, Label: RefUnwindSafe,

§

impl<Label, Format> Send for AngleSlider<Label, Format>where Format: Send, Label: Send,

§

impl<Label, Format> Sync for AngleSlider<Label, Format>where Format: Sync, Label: Sync,

§

impl<Label, Format> Unpin for AngleSlider<Label, Format>where Format: Unpin, Label: Unpin,

§

impl<Label, Format> UnwindSafe for AngleSlider<Label, Format>where Format: UnwindSafe, Label: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.