[−][src]Struct native_windows_gui::ComboBox
A combobox control
Methods
impl<D: Clone + Display> ComboBox<D>
[src]
pub fn len(&self) -> usize
[src]
Return the number of items in the inner collection
pub fn collection(&self) -> &Vec<D>
[src]
Return the inner collection of the combobox
pub fn collection_mut(&mut self) -> &mut Vec<D>
[src]
Return the inner collection of the combobox, mutable.
If the inner collection is changed, combobox.sync
must be called to show the changes in the combobox
pub fn sync(&self)
[src]
Reload the content of the combobox
pub fn push(&mut self, item: D)
[src]
Add an item at the end of the combobox. Updates both the inner collection and the ui.
pub fn remove(&mut self, index: usize) -> D
[src]
Remove an item from the inner collection and the combobox. Return the removed item.
Panics
if index is out of bounds.
pub fn insert(&mut self, index: usize, item: D)
[src]
Insert an item at the selected position in the lisbox and the inner collection.
If index is -1, the item is added at the end of the list.
pub fn find_string<'a>(&self, text: &'a str, full_match: bool) -> Option<usize>
[src]
Try to find an item with the text text
in the collection. If one is found, return its index else, returns None.
If full_match
is true, the text must match exactly otherwise it only needs to match the beginning.
The search is NOT case sensitive.
pub fn get_selected_index(&self) -> Option<usize>
[src]
Return the index of currently selected item.
Return None if there is no selected item
pub fn get_selected_text(&self) -> String
[src]
Return the currently selected element text. Returns ""
if no item is selected.
pub fn set_selected_index(&self, index: usize)
[src]
Set the selected index in a combobox.
If index
is usize::max_value
, remove the selected index from the combobox
pub fn get_string(&self, index: usize) -> Option<String>
[src]
Return the item text at the provided index. Returns None if the index is not valid.
pub fn set_placeholder<'a>(&self, placeholder: &'a str)
[src]
Set a new placeholder for the combobox. To remove the current placeholder, send ""
The maximum length of the placeholder is 255 characters
pub fn get_dropped_state(&self) -> bool
[src]
Return true if the combobox dropdown is visible
pub fn set_dropped_state(&self, dropped: bool)
[src]
Show or hide the control dropdown
pub fn clear(&mut self)
[src]
Remove every item in the inner collection and in the combobox
pub fn get_visibility(&self) -> bool
[src]
pub fn set_visibility(&self, visible: bool)
[src]
pub fn get_position(&self) -> (i32, i32)
[src]
pub fn set_position(&self, x: i32, y: i32)
[src]
pub fn get_size(&self) -> (u32, u32)
[src]
pub fn set_size(&self, w: u32, h: u32)
[src]
pub fn get_enabled(&self) -> bool
[src]
pub fn set_enabled(&self, e: bool)
[src]
Trait Implementations
Auto Trait Implementations
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,