Trait nannou::ui::widget::list_select::Mode[][src]

pub trait Mode {
    type Selection;
    pub fn click_selection<F, D, S>(
        &self,
        Click,
        i: usize,
        num_items: usize,
        &State,
        is_selected: F,
        &mut VecDeque<Event<Self::Selection, D, S>>
    )
    where
        F: Fn(usize) -> bool
;
pub fn key_selection<F, D, S>(
        &self,
        KeyPress,
        i: usize,
        num_items: usize,
        &State,
        is_selected: F,
        &mut VecDeque<Event<Self::Selection, D, S>>
    )
    where
        F: Fn(usize) -> bool,
        D: Direction
; }

Allows the ListSelect to be generic over Single and Multiple selection modes.

Also allows for defining other custom selection modes.

Associated Types

type Selection[src]

The data associated with the Modes Event::Selection.

Loading content...

Required methods

pub fn click_selection<F, D, S>(
    &self,
    Click,
    i: usize,
    num_items: usize,
    &State,
    is_selected: F,
    &mut VecDeque<Event<Self::Selection, D, S>>
) where
    F: Fn(usize) -> bool
[src]

Update the PendingEvents in accordance with the given Click event.

pub fn key_selection<F, D, S>(
    &self,
    KeyPress,
    i: usize,
    num_items: usize,
    &State,
    is_selected: F,
    &mut VecDeque<Event<Self::Selection, D, S>>
) where
    F: Fn(usize) -> bool,
    D: Direction
[src]

Update the PendingEvents in accordance with the given KeyPress event.

Loading content...

Implementors

impl Mode for Multiple[src]

type Selection = Selection<RandomState>

impl Mode for Single[src]

type Selection = usize

Loading content...