pub struct ListBox {
pub name: String,
pub options: Vec<(String, String)>,
pub selected: Vec<usize>,
pub multi_select: bool,
}Expand description
List box field
Fields§
§name: StringField name
options: Vec<(String, String)>Options (export value, display text)
selected: Vec<usize>Selected indices
multi_select: boolWhether multiple selection is allowed
Implementations§
Source§impl ListBox
impl ListBox
Sourcepub fn add_option(
self,
export_value: impl Into<String>,
display: impl Into<String>,
) -> Self
pub fn add_option( self, export_value: impl Into<String>, display: impl Into<String>, ) -> Self
Add an option
Sourcepub fn multi_select(self) -> Self
pub fn multi_select(self) -> Self
Enable multi-select
Sourcepub fn with_selected(self, indices: Vec<usize>) -> Self
pub fn with_selected(self, indices: Vec<usize>) -> Self
Set selected indices
Sourcepub fn to_dict(&self) -> Dictionary
pub fn to_dict(&self) -> Dictionary
Convert to field dictionary
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ListBox
impl RefUnwindSafe for ListBox
impl Send for ListBox
impl Sync for ListBox
impl Unpin for ListBox
impl UnwindSafe for ListBox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more