[][src]Struct glerminal::menu_systems::CheckboxGroup

pub struct CheckboxGroup { /* fields omitted */ }

Represents a group of checkboxes that can be managed like they were radio buttons.

This allows you to make a CheckboxGroup of ie. 3 checkboxes and only one of them will be selected at a time, unless force one selected is toggled on, in which case the index given with it will be selected at first, and the group will disallow having none selected.

Updating this CheckboxGroup with the given Checkboxes will ensure that the functionality explained above will be enforced.

Methods

impl CheckboxGroup
[src]

pub fn new() -> CheckboxGroup
[src]

Creates a new CheckboxGroup with no selection.

pub fn with_force_one_checked(
    self,
    force_one_checked: Option<u32>
) -> CheckboxGroup
[src]

Some forces something to be always checked, None (default) allows everything to be unchecked. Put an index that should be checked as default, if given index doesn't exist 0 is used. Selected index will result to None only if no checkboxes are given.

pub fn update(&mut self, checkboxes: &mut [&mut Checkbox])
[src]

Update this CheckboxGroup with the given Checkboxes, this will ensure that only one of the given Checkboxes will remain checked.

pub fn get_selection_idx(&self) -> Option<u32>
[src]

Return the index that is currently selected, if any.

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

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

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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