[][src]Struct pushrod::widgets::list_widget::ListWidget

pub struct ListWidget { /* fields omitted */ }

This is the storage object for the ListWidget. It stores the config, properties, callback registry.

Methods

impl ListWidget[src]

This is the implementation of the ListWidget, a control that displays a list of items that can be selected.

pub fn new(points: Points, size: Size) -> Self[src]

Creates a new ListWidget given the x, y, w, h coordinates.

pub fn add_item(&mut self, item: String) -> usize[src]

Adds a text item to the ListWidget.

pub fn on_selected<F>(&mut self, callback: F) where
    F: FnMut(&mut ListWidget, &[WidgetContainer], &[LayoutContainer], i32) + 'static, 
[src]

Assigns the callback closure that will be used when the Widget changes value, based on a selected item.

Trait Implementations

impl CanvasHelper for ListWidget[src]

impl Widget for ListWidget[src]

This is the Widget implementation of the ListWidget.

fn draw(
    &mut self,
    c: &mut Canvas<Window>,
    t: &mut TextureCache
) -> Option<&Texture>
[src]

Draws the ListWidget contents.

fn mouse_entered(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

When a mouse enters the bounds of the Widget, this function is triggered.

fn mouse_exited(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

When a mouse exits the bounds of the Widget, this function is triggered.

fn mouse_moved(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    points: Points
)
[src]

When a mouse is moved in the bounds of this Widget, this function is triggered.

fn button_clicked(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    button: u8,
    _clicks: u8,
    state: bool
)
[src]

Overrides the button_clicked callback to handle toggling.

fn as_any(&mut self) -> &mut dyn Any[src]

This function is a macro-created getter function that returns the Widget as an Any type. This allows the Widget trait to be downcast into a struct that implements the Widget trait.

fn get_config(&mut self) -> &mut WidgetConfig[src]

This function is a macro-created getter function that returns the Widget's configuration object as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn get_system_properties(&mut self) -> &mut HashMap<i32, String>[src]

This function is a macro-created getter function that returns the Widget's system properties as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn get_callbacks(&mut self) -> &mut CallbackRegistry[src]

This function is a macro-created getter function that returns the Widget's CallbackRegistry object as a borrowed mutable reference. This code is auto-generated using the default_widget_properties!() macro.

fn tick_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created tick callback override, created by the default_widget_callbacks!() macro.

fn mouse_entered_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created mouse entered callback override, created by the default_widget_callbacks!() macro.

fn mouse_exited_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer]
)
[src]

This function is a macro-created mouse exited callback override, created by the default_widget_callbacks!() macro.

fn mouse_moved_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _points: Points
)
[src]

This function is a macro-created mouse moved callback override, created by the default_widget_callbacks!() macro.

fn mouse_scrolled_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _points: Points
)
[src]

This function is a macro-created mouse scrolled callback override, created by the default_widget_callbacks!() macro.

fn button_clicked_callback(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _button: u8,
    _clicks: u8,
    _state: bool
)
[src]

This function is a macro-created mouse scrolled callback override, created by the default_widget_callbacks!() macro.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.