[][src]Struct imgui::ComboBox

#[must_use]
pub struct ComboBox<'a> { /* fields omitted */ }

Builder for a combo box widget

Methods

impl<'a> ComboBox<'a>[src]

pub fn new(label: &'a ImStr) -> ComboBox<'a>[src]

Constructs a new combo box builder.

pub fn preview_value(self, preview_value: &'a ImStr) -> Self[src]

Sets the preview value displayed in the preview box (if visible).

pub fn flags(self, flags: ComboBoxFlags) -> Self[src]

Replaces all current settings with the given flags.

pub fn popup_align_left(self, popup_align_left: bool) -> Self[src]

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

Disabled by default.

pub fn height(self, height: ComboBoxHeight) -> Self[src]

Sets the combo box height.

Default: ComboBoxHeight::Regular

pub fn preview_mode(self, preview_mode: ComboBoxPreviewMode) -> Self[src]

Sets the combo box preview mode.

Default: ComboBoxPreviewMode::Full

#[must_use] pub fn begin(self, ui: &Ui) -> Option<ComboBoxToken>[src]

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.

pub fn build<F: FnOnce()>(self, ui: &Ui, f: F)[src]

Creates a combo box and runs a closure to construct the popup contents.

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

impl<'a> ComboBox<'a>[src]

pub fn build_simple<T, L>(
    self,
    ui: &Ui,
    current_item: &mut usize,
    items: &[T],
    label_fn: &L
) -> bool where
    L: Fn(&'b T) -> Cow<'b, ImStr>, 
[src]

Builds a simple combo box for choosing from a slice of values

pub fn build_simple_string<S: ?Sized>(
    self,
    ui: &Ui,
    current_item: &mut usize,
    items: &[&S]
) -> bool where
    S: AsRef<ImStr>, 
[src]

Builds a simple combo box for choosing from a slice of strings

Trait Implementations

impl<'a> Clone for ComboBox<'a>[src]

impl<'a> Copy for ComboBox<'a>[src]

impl<'a> Debug for ComboBox<'a>[src]

Auto Trait Implementations

impl<'a> Unpin for ComboBox<'a>

impl<'a> Sync for ComboBox<'a>

impl<'a> Send for ComboBox<'a>

impl<'a> UnwindSafe for ComboBox<'a>

impl<'a> RefUnwindSafe for ComboBox<'a>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]