Skip to main content

TheListLayoutTrait

Trait TheListLayoutTrait 

Source
pub trait TheListLayoutTrait: TheLayout {
Show 13 methods // Required methods fn add_item(&mut self, item: TheListItem, ctx: &mut TheContext); fn new_item_selected(&mut self, item: TheId); fn clear(&mut self); fn remove(&mut self, id: TheId); fn deselect_all(&mut self); fn selected(&self) -> Option<TheId>; fn set_item_size(&mut self, item_size: i32); fn set_item_icon(&mut self, id: Uuid, image: TheRGBABuffer); fn select_first_item(&mut self, ctx: &mut TheContext); fn select_item( &mut self, uuid: Uuid, ctx: &mut TheContext, send_event: bool, ) -> bool; fn select_item_at( &mut self, index: i32, ctx: &mut TheContext, send_event: bool, ) -> bool; fn set_item_text(&mut self, id: Uuid, text: String); fn scroll_by(&mut self, delta: Vec2<i32>);
}
Expand description

TheListLayout specific functions.

Required Methods§

Source

fn add_item(&mut self, item: TheListItem, ctx: &mut TheContext)

Adds an item.

Source

fn new_item_selected(&mut self, item: TheId)

A new item was selected, manage the selection states.

Source

fn clear(&mut self)

Remove all items.

Source

fn remove(&mut self, id: TheId)

Remove the given list item from the list.

Source

fn deselect_all(&mut self)

Deselect all items.

Source

fn selected(&self) -> Option<TheId>

Returns the id of the selected item (if any).

Source

fn set_item_size(&mut self, item_size: i32)

Set the height of the items

Source

fn set_item_icon(&mut self, id: Uuid, image: TheRGBABuffer)

Sets the icon for an item.

Source

fn select_first_item(&mut self, ctx: &mut TheContext)

Selects the first item (and sends events)

Source

fn select_item( &mut self, uuid: Uuid, ctx: &mut TheContext, send_event: bool, ) -> bool

Selects the item of the given uuid.

Source

fn select_item_at( &mut self, index: i32, ctx: &mut TheContext, send_event: bool, ) -> bool

Selects the item at the given index.

Source

fn set_item_text(&mut self, id: Uuid, text: String)

Sets the text for an item

Source

fn scroll_by(&mut self, delta: Vec2<i32>)

Scroll by the given amount.

Implementors§