pub struct ComboBoxBuilder<'a, D: Display + Default> { /* private fields */ }Implementations§
Source§impl<'a, D: Display + Default> ComboBoxBuilder<'a, D>
impl<'a, D: Display + Default> ComboBoxBuilder<'a, D>
pub fn flags(self, flags: ComboBoxFlags) -> ComboBoxBuilder<'a, D>
pub fn ex_flags(self, flags: u32) -> ComboBoxBuilder<'a, D>
pub fn size(self, size: (i32, i32)) -> ComboBoxBuilder<'a, D>
pub fn position(self, pos: (i32, i32)) -> ComboBoxBuilder<'a, D>
pub fn font(self, font: Option<&'a Font>) -> ComboBoxBuilder<'a, D>
Sourcepub fn parent<C: Into<ControlHandle>>(self, p: C) -> ComboBoxBuilder<'a, D>
pub fn parent<C: Into<ControlHandle>>(self, p: C) -> ComboBoxBuilder<'a, D>
Examples found in repository?
examples/partials.rs (line 389)
357 fn build_partial<W: Into<ControlHandle>>(
358 data: &mut AnimalUi,
359 parent: Option<W>,
360 ) -> Result<(), NwgError> {
361 let parent = parent.unwrap().into();
362
363 nwg::Label::builder()
364 .text("Name:")
365 .h_align(nwg::HTextAlign::Right)
366 .parent(&parent)
367 .build(&mut data.label1)?;
368
369 nwg::Label::builder()
370 .text("Race:")
371 .h_align(nwg::HTextAlign::Right)
372 .parent(&parent)
373 .build(&mut data.label2)?;
374
375 nwg::Label::builder()
376 .text("Is fluffy:")
377 .h_align(nwg::HTextAlign::Right)
378 .parent(&parent)
379 .build(&mut data.label3)?;
380
381 nwg::TextInput::builder()
382 .text("Mittens")
383 .parent(&parent)
384 .build(&mut data.name_input)?;
385
386 nwg::ComboBox::builder()
387 .collection(vec!["Cat", "Dog", "Pidgeon", "Monkey"])
388 .selected_index(Some(0))
389 .parent(&parent)
390 .build(&mut data.race_input)?;
391
392 nwg::CheckBox::builder()
393 .text("")
394 .check_state(nwg::CheckBoxState::Checked)
395 .parent(&parent)
396 .build(&mut data.is_soft_input)?;
397
398 nwg::Button::builder()
399 .text("Save")
400 .parent(&parent)
401 .build(&mut data.save_btn)?;
402
403 nwg::GridLayout::builder()
404 .parent(&parent)
405 .max_size([1000, 150])
406 .min_size([100, 120])
407 .child(0, 0, &data.label1)
408 .child(0, 1, &data.label2)
409 .child(0, 2, &data.label3)
410 .child(1, 0, &data.name_input)
411 .child(1, 1, &data.race_input)
412 .child(1, 2, &data.is_soft_input)
413 .build(&data.layout)?;
414
415 nwg::GridLayout::builder()
416 .min_size([100, 200])
417 .max_column(Some(2))
418 .max_row(Some(6))
419 .child(1, 5, &data.save_btn)
420 .parent(&parent)
421 .build(&data.layout2)?;
422
423 Ok(())
424 }Sourcepub fn collection(self, collection: Vec<D>) -> ComboBoxBuilder<'a, D>
pub fn collection(self, collection: Vec<D>) -> ComboBoxBuilder<'a, D>
Examples found in repository?
examples/partials.rs (line 387)
357 fn build_partial<W: Into<ControlHandle>>(
358 data: &mut AnimalUi,
359 parent: Option<W>,
360 ) -> Result<(), NwgError> {
361 let parent = parent.unwrap().into();
362
363 nwg::Label::builder()
364 .text("Name:")
365 .h_align(nwg::HTextAlign::Right)
366 .parent(&parent)
367 .build(&mut data.label1)?;
368
369 nwg::Label::builder()
370 .text("Race:")
371 .h_align(nwg::HTextAlign::Right)
372 .parent(&parent)
373 .build(&mut data.label2)?;
374
375 nwg::Label::builder()
376 .text("Is fluffy:")
377 .h_align(nwg::HTextAlign::Right)
378 .parent(&parent)
379 .build(&mut data.label3)?;
380
381 nwg::TextInput::builder()
382 .text("Mittens")
383 .parent(&parent)
384 .build(&mut data.name_input)?;
385
386 nwg::ComboBox::builder()
387 .collection(vec!["Cat", "Dog", "Pidgeon", "Monkey"])
388 .selected_index(Some(0))
389 .parent(&parent)
390 .build(&mut data.race_input)?;
391
392 nwg::CheckBox::builder()
393 .text("")
394 .check_state(nwg::CheckBoxState::Checked)
395 .parent(&parent)
396 .build(&mut data.is_soft_input)?;
397
398 nwg::Button::builder()
399 .text("Save")
400 .parent(&parent)
401 .build(&mut data.save_btn)?;
402
403 nwg::GridLayout::builder()
404 .parent(&parent)
405 .max_size([1000, 150])
406 .min_size([100, 120])
407 .child(0, 0, &data.label1)
408 .child(0, 1, &data.label2)
409 .child(0, 2, &data.label3)
410 .child(1, 0, &data.name_input)
411 .child(1, 1, &data.race_input)
412 .child(1, 2, &data.is_soft_input)
413 .build(&data.layout)?;
414
415 nwg::GridLayout::builder()
416 .min_size([100, 200])
417 .max_column(Some(2))
418 .max_row(Some(6))
419 .child(1, 5, &data.save_btn)
420 .parent(&parent)
421 .build(&data.layout2)?;
422
423 Ok(())
424 }Sourcepub fn selected_index(self, index: Option<usize>) -> ComboBoxBuilder<'a, D>
pub fn selected_index(self, index: Option<usize>) -> ComboBoxBuilder<'a, D>
Examples found in repository?
examples/partials.rs (line 388)
357 fn build_partial<W: Into<ControlHandle>>(
358 data: &mut AnimalUi,
359 parent: Option<W>,
360 ) -> Result<(), NwgError> {
361 let parent = parent.unwrap().into();
362
363 nwg::Label::builder()
364 .text("Name:")
365 .h_align(nwg::HTextAlign::Right)
366 .parent(&parent)
367 .build(&mut data.label1)?;
368
369 nwg::Label::builder()
370 .text("Race:")
371 .h_align(nwg::HTextAlign::Right)
372 .parent(&parent)
373 .build(&mut data.label2)?;
374
375 nwg::Label::builder()
376 .text("Is fluffy:")
377 .h_align(nwg::HTextAlign::Right)
378 .parent(&parent)
379 .build(&mut data.label3)?;
380
381 nwg::TextInput::builder()
382 .text("Mittens")
383 .parent(&parent)
384 .build(&mut data.name_input)?;
385
386 nwg::ComboBox::builder()
387 .collection(vec!["Cat", "Dog", "Pidgeon", "Monkey"])
388 .selected_index(Some(0))
389 .parent(&parent)
390 .build(&mut data.race_input)?;
391
392 nwg::CheckBox::builder()
393 .text("")
394 .check_state(nwg::CheckBoxState::Checked)
395 .parent(&parent)
396 .build(&mut data.is_soft_input)?;
397
398 nwg::Button::builder()
399 .text("Save")
400 .parent(&parent)
401 .build(&mut data.save_btn)?;
402
403 nwg::GridLayout::builder()
404 .parent(&parent)
405 .max_size([1000, 150])
406 .min_size([100, 120])
407 .child(0, 0, &data.label1)
408 .child(0, 1, &data.label2)
409 .child(0, 2, &data.label3)
410 .child(1, 0, &data.name_input)
411 .child(1, 1, &data.race_input)
412 .child(1, 2, &data.is_soft_input)
413 .build(&data.layout)?;
414
415 nwg::GridLayout::builder()
416 .min_size([100, 200])
417 .max_column(Some(2))
418 .max_row(Some(6))
419 .child(1, 5, &data.save_btn)
420 .parent(&parent)
421 .build(&data.layout2)?;
422
423 Ok(())
424 }pub fn enabled(self, e: bool) -> ComboBoxBuilder<'a, D>
pub fn focus(self, focus: bool) -> ComboBoxBuilder<'a, D>
pub fn v_align(self, _align: VTextAlign) -> ComboBoxBuilder<'a, D>
Sourcepub fn build(self, out: &mut ComboBox<D>) -> Result<(), NwgError>
pub fn build(self, out: &mut ComboBox<D>) -> Result<(), NwgError>
Examples found in repository?
examples/partials.rs (line 390)
357 fn build_partial<W: Into<ControlHandle>>(
358 data: &mut AnimalUi,
359 parent: Option<W>,
360 ) -> Result<(), NwgError> {
361 let parent = parent.unwrap().into();
362
363 nwg::Label::builder()
364 .text("Name:")
365 .h_align(nwg::HTextAlign::Right)
366 .parent(&parent)
367 .build(&mut data.label1)?;
368
369 nwg::Label::builder()
370 .text("Race:")
371 .h_align(nwg::HTextAlign::Right)
372 .parent(&parent)
373 .build(&mut data.label2)?;
374
375 nwg::Label::builder()
376 .text("Is fluffy:")
377 .h_align(nwg::HTextAlign::Right)
378 .parent(&parent)
379 .build(&mut data.label3)?;
380
381 nwg::TextInput::builder()
382 .text("Mittens")
383 .parent(&parent)
384 .build(&mut data.name_input)?;
385
386 nwg::ComboBox::builder()
387 .collection(vec!["Cat", "Dog", "Pidgeon", "Monkey"])
388 .selected_index(Some(0))
389 .parent(&parent)
390 .build(&mut data.race_input)?;
391
392 nwg::CheckBox::builder()
393 .text("")
394 .check_state(nwg::CheckBoxState::Checked)
395 .parent(&parent)
396 .build(&mut data.is_soft_input)?;
397
398 nwg::Button::builder()
399 .text("Save")
400 .parent(&parent)
401 .build(&mut data.save_btn)?;
402
403 nwg::GridLayout::builder()
404 .parent(&parent)
405 .max_size([1000, 150])
406 .min_size([100, 120])
407 .child(0, 0, &data.label1)
408 .child(0, 1, &data.label2)
409 .child(0, 2, &data.label3)
410 .child(1, 0, &data.name_input)
411 .child(1, 1, &data.race_input)
412 .child(1, 2, &data.is_soft_input)
413 .build(&data.layout)?;
414
415 nwg::GridLayout::builder()
416 .min_size([100, 200])
417 .max_column(Some(2))
418 .max_row(Some(6))
419 .child(1, 5, &data.save_btn)
420 .parent(&parent)
421 .build(&data.layout2)?;
422
423 Ok(())
424 }Auto Trait Implementations§
impl<'a, D> !Send for ComboBoxBuilder<'a, D>
impl<'a, D> !Sync for ComboBoxBuilder<'a, D>
impl<'a, D> Freeze for ComboBoxBuilder<'a, D>
impl<'a, D> RefUnwindSafe for ComboBoxBuilder<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Unpin for ComboBoxBuilder<'a, D>where
D: Unpin,
impl<'a, D> UnsafeUnpin for ComboBoxBuilder<'a, D>
impl<'a, D> UnwindSafe for ComboBoxBuilder<'a, D>where
D: UnwindSafe,
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