Struct ComboBox

Source
pub struct ComboBox<'ui, Label, Preview = &'static str> {
    pub label: Label,
    pub preview_value: Option<Preview>,
    pub flags: ComboBoxFlags,
    pub ui: &'ui Ui,
}
Expand description

Builder for a combo box widget

Fields§

§label: Label§preview_value: Option<Preview>§flags: ComboBoxFlags§ui: &'ui Ui

Implementations§

Source§

impl<'ui, Label> ComboBox<'ui, Label>
where Label: AsRef<str>,

Source

pub fn new(ui: &'ui Ui, label: Label) -> ComboBox<'ui, Label>

👎Deprecated since 0.9.0: Use ui.combo_box_config(...) instead

Constructs a new combo box builder.

Source§

impl<'ui, T, Preview> ComboBox<'ui, T, Preview>
where T: AsRef<str>, Preview: AsRef<str>,

Source

pub fn preview_value<Preview2>( self, preview_value: Preview2, ) -> ComboBox<'ui, T, Preview2>
where Preview2: AsRef<str>,

Source

pub fn flags(self, flags: ComboBoxFlags) -> ComboBox<'ui, T, Preview>

Replaces all current settings with the given flags.

Source

pub fn popup_align_left( self, popup_align_left: bool, ) -> ComboBox<'ui, T, Preview>

Enables/disables aligning the combo box popup toward the left.

Disabled by default.

Source

pub fn height(self, height: ComboBoxHeight) -> ComboBox<'ui, T, Preview>

Sets the combo box height.

Default: ComboBoxHeight::Regular

Source

pub fn preview_mode( self, preview_mode: ComboBoxPreviewMode, ) -> ComboBox<'ui, T, Preview>

Sets the combo box preview mode.

Default: ComboBoxPreviewMode::Full

Source

pub fn begin(self) -> Option<ComboBoxToken<'ui>>

Creates a combo box and starts appending to it.

Returns Some(ComboBoxToken) if the combo box is open. After content has been rendered, the token must be ended by calling .end().

Returns None if the combo box is not open and no content should be rendered.

Source

pub fn build<R, F>(self, f: F) -> Option<R>
where F: FnOnce() -> R,

Creates a combo box and runs a closure to construct the popup contents. Returns the result of the closure, if it is called.

Note: the closure is not called if the combo box is not open.

Trait Implementations§

Source§

impl<'ui, Label, Preview> Clone for ComboBox<'ui, Label, Preview>
where Label: Clone, Preview: Clone,

Source§

fn clone(&self) -> ComboBox<'ui, Label, Preview>

Returns a duplicate 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<'ui, Label, Preview> Debug for ComboBox<'ui, Label, Preview>
where Label: Debug, Preview: Debug,

Source§

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

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

impl<'ui, Label, Preview> Copy for ComboBox<'ui, Label, Preview>
where Label: Copy, Preview: Copy,

Auto Trait Implementations§

§

impl<'ui, Label, Preview> Freeze for ComboBox<'ui, Label, Preview>
where Label: Freeze, Preview: Freeze,

§

impl<'ui, Label, Preview = &'static str> !RefUnwindSafe for ComboBox<'ui, Label, Preview>

§

impl<'ui, Label, Preview = &'static str> !Send for ComboBox<'ui, Label, Preview>

§

impl<'ui, Label, Preview = &'static str> !Sync for ComboBox<'ui, Label, Preview>

§

impl<'ui, Label, Preview> Unpin for ComboBox<'ui, Label, Preview>
where Label: Unpin, Preview: Unpin,

§

impl<'ui, Label, Preview = &'static str> !UnwindSafe for ComboBox<'ui, Label, Preview>

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, dest: *mut u8)

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V