[][src]Trait pushrod::render::widget::Widget

pub trait Widget {
    fn as_any(&mut self) -> &mut dyn Any;
fn get_config(&mut self) -> &mut WidgetConfig;
fn get_system_properties(&mut self) -> &mut HashMap<i32, String>;
fn get_callbacks(&mut self) -> &mut CallbackRegistry; fn draw(
        &mut self,
        _c: &mut Canvas<Window>,
        _t: &mut TextureCache
    ) -> Option<&Texture> { ... }
fn mouse_entered(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn mouse_exited(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn mouse_moved(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _points: Points
    ) { ... }
fn mouse_scrolled(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _points: Points
    ) { ... }
fn button_clicked(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _button: u8,
        _clicks: u8,
        _state: bool
    ) { ... }
fn tick(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn other_event(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _event: Event
    ) { ... }
fn tick_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn mouse_entered_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn mouse_exited_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer]
    ) { ... }
fn mouse_moved_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _points: Points
    ) { ... }
fn mouse_scrolled_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _points: Points
    ) { ... }
fn button_clicked_callback(
        &mut self,
        _widgets: &[WidgetContainer],
        _layouts: &[LayoutContainer],
        _button: u8,
        _clicks: u8,
        _state: bool
    ) { ... }
fn on_config_changed(&mut self, _k: u8, _v: Config) { ... }
fn set_point(&mut self, config: u8, x: i32, y: i32) { ... }
fn set_color(&mut self, config: u8, color: Color) { ... }
fn set_numeric(&mut self, config: u8, value: i32) { ... }
fn set_text(&mut self, config: u8, text: String) { ... }
fn set_toggle(&mut self, config: u8, flag: bool) { ... }
fn set_compass(&mut self, config: u8, value: CompassPosition) { ... }
fn get_point(&mut self, k: u8) -> Points { ... }
fn get_size(&mut self, k: u8) -> Size { ... }
fn get_color(&mut self, k: u8) -> Color { ... }
fn get_numeric(&mut self, k: u8) -> i32 { ... }
fn get_text(&mut self, k: u8) -> String { ... }
fn get_toggle(&mut self, k: u8) -> bool { ... }
fn get_compass(&mut self, k: u8) -> CompassPosition { ... }
fn set_origin(&mut self, _origin: Points) { ... }
fn set_size(&mut self, _size: Vec<u32>) { ... }
fn get_drawing_area(&mut self) -> Rect { ... }
fn is_invalidated(&mut self) -> bool { ... }
fn set_invalidated(&mut self, flag: bool) { ... } }

This trait is shared by all Widget objects that have a presence on the screen. Functions that must be implemented are documented in the trait.

Implementation Notes

If no custom get_config function is defined, and no custom get_system_properties function is defined, you can omit the definition of both, and use the default_widget_properties!() macro to auto-generate this code in your impl of this trait. Keep in mind, however, that these automatically generated implementation details could change in future releases of this library, so it is best to use the default implementation if possible.

Required methods

fn as_any(&mut self) -> &mut dyn Any

Retrieves this Widget as an Any object so that it can be downcast using downcast_ref to a struct that implements the Widget trait.

fn get_config(&mut self) -> &mut WidgetConfig

Retrieves the WidgetConfig object for this Widget.

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

Retrieves a HashMap containing system properties used by the Pushrod event engine.

fn get_callbacks(&mut self) -> &mut CallbackRegistry

Retrieves a Callback registry for this Widget.

Loading content...

Provided methods

fn draw(
    &mut self,
    _c: &mut Canvas<Window>,
    _t: &mut TextureCache
) -> Option<&Texture>

Draws the widget. If you wish to modify the canvas object, you must declare it as mut in your implementation (ie fn draw(&mut self, mut canvas: Canvas<Window>)). The _canvas is the currently active drawing canvas at the time this function is called. This called during the draw loop of the Engine. This returns a reference to the stored Texture object within the Widget. It is then copied to the canvas, and displayed in the display loop. In this function, you can just return a reference to the Texture if no invalidation state was set, otherwise, the draw can be re-performed, and the Texture returned. If the drawing function returns no texture, return a None, and it will not be rendered during the display loop, but it will still be called. A TextureCache is provided in case your Widget needs to cache an image or a font store.

So, why not just call draw each time, if the Engine already handles the calling of the draw for you when an object needs invalidation? This is to avoid excess CPU usage. You can call the draw method each time: all it will do is return the reference to the already drawn Texture if you do this. It's only at the time the contents needs to be redrawn will the logic for the draw take place (so long the invalidated state is obeyed)

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

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

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

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

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

When a mouse moves within the bounds of the Widget, this function is triggered. It contains the X and Y coordinates relative to the bounds of the Widget. The points start at 0x0. This function implementation is optional.

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

When a mouse scroll is triggered within the bounds of the Widget, this function is triggered. Movement along the X axis indicate horizontal movement, where the Y axis indicates vertical movement. Positive movement means to the right or down, respectively. Negative movement means to the left or up, respectively. This function implementation is optional.

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

When a mouse button is clicked within (or outside of) the bounds of the Widget, this function is called. If a mouse button is clicked, and the mouse leaves the bounds of the Widget, the mouse release event will still be triggered for the last Widget which received the mouse down state. This prevents Widgets from becoming confused. This behavior is tracked by the main loop, not by the Widget code. Therefore, when a mouse button is released outside of the bounds of this Widget, you must adjust your state accordingly, if you pay attention to the button_clicked function. This function implementation is optional.

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

When a timer tick goes by (ie. a frame is displayed on the screen), this function is called. This function implementation is optional.

fn other_event(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    _event: Event
)

When an Event is sent to the application that is not handled by the Engine::run loop, this method is called, sending the unhandled Event to the currently active Widget. This behavior is subject to change as the Engine::run loop is modified to handle more Events.

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

This calls the on_tick callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_tick callback.

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

This calls the on_mouse_entered callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_mouse_entered callback.

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

This calls the on_mouse_exited callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_mouse_exited callback.

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

This calls the on_mouse_moved callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_mouse_moved callback.

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

This calls the on_mouse_scrolled callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_mouse_scrolled callback.

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

This calls the on_button_clicked callback. This is implemented by the default_widget_callbacks! macro, so you do not need to implement it. However, you need to call this function if you wish to honor an on_button_clicked callback.

fn on_config_changed(&mut self, _k: u8, _v: Config)

This callback is called when a setter is used to configure a value. It is not called when a call to get_config() using the setter is called, so it is best to use the top-level setters and getters for the configuration values - at least, until the get_config() call can be made private.

fn set_point(&mut self, config: u8, x: i32, y: i32)

Sets a point for a configuration key.

fn set_color(&mut self, config: u8, color: Color)

Sets a color for a configuration key.

fn set_numeric(&mut self, config: u8, value: i32)

Sets a numeric value for a configuration key.

fn set_text(&mut self, config: u8, text: String)

Sets a text value for a configuration key.

fn set_toggle(&mut self, config: u8, flag: bool)

Sets a toggle for a configuration key.

fn set_compass(&mut self, config: u8, value: CompassPosition)

Sets a compass position for a configuration key.

fn get_point(&mut self, k: u8) -> Points

Retrieves a Points for a configuration key. Returns Points::default if not set.

fn get_size(&mut self, k: u8) -> Size

Retrieves a Size for a configuration key. Returns a Size::default if not set.

fn get_color(&mut self, k: u8) -> Color

Retrieves a Color for a configuration key. Returns white if not set.

fn get_numeric(&mut self, k: u8) -> i32

Retrieves a numeric value for a configuration key. Returns 0 if not set.

fn get_text(&mut self, k: u8) -> String

Retrieves text for a configuration key. Returns a blank string if not set.

fn get_toggle(&mut self, k: u8) -> bool

Retrieves a boolean toggle for a configuration key. Returns false if not set.

fn get_compass(&mut self, k: u8) -> CompassPosition

Retrieves a CompassPosition toggle for a configuration key. Returns CompassPosition::W if not set.

fn set_origin(&mut self, _origin: Points)

Sets the origin of the Widget, adjusting the X and Y coordinates. Automatically sets the invalidate flag to true when adjusted, but only if the new origin is not the same as the previous origin.

fn set_size(&mut self, _size: Vec<u32>)

Sets the size of the Widget, adjusting the width and height. Automatically sets the invalidate flag to true when adjusted, but only if the new size is not the same as the previous size.

fn get_drawing_area(&mut self) -> Rect

Returns a Rect object containing the drawing bounds of this Widget.

fn is_invalidated(&mut self) -> bool

Returns whether or not a Widget is invalidated state.

fn set_invalidated(&mut self, flag: bool)

Sets invalidation state for the current Widget.

Loading content...

Implementors

impl Widget for BaseWidget[src]

Implementation for drawing a BaseWidget, with the Widget trait objects applied. This code can be used as a base implementation, or an example of how to create a Widget in Pushrod. The base set of Widgets show off a multitude of different uses for handling events, display contents, and so on. Look through the code in the pushrod::widgets module to get more of an idea of what is possible.

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.

impl Widget for CheckboxWidget[src]

This is the Widget implementation of the CheckboxWidget.

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

Draws the CheckboxWidget 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 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.

impl Widget for GridWidget[src]

This is the Widget implementation of the GridWidget.

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

Draws the GridWidget contents.

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.

impl Widget for ImageButtonWidget[src]

This is the Widget implementation of the ImageButtonWidget.

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

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

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

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

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

When a mouse button is clicked within (or outside of) the bounds of the Widget, this function is called. If a mouse button is clicked, and the mouse leaves the bounds of the Widget, the mouse release event will still be triggered for the last Widget which received the mouse down state. This prevents Widgets from becoming confused. This behavior is tracked by the main loop, not by the Widget code. Therefore, when a mouse button is released outside of the bounds of this Widget, you must adjust your state accordingly, if you pay attention to the button_clicked function. This function implementation is optional.

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.

impl Widget for ImageWidget[src]

This is the Widget implementation of the ImageWidget. Image is rendered onto a 3D texture, then copied to the canvas after rendering.

fn on_config_changed(&mut self, _k: u8, _v: Config)[src]

Responds to a screen redraw only if the CONFIG_IMAGE_POSITION key was changed.

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.

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.

impl Widget for ProgressWidget[src]

This is the Widget implementation of the ProgressWidget. It contains a BaseWidget within its bounds to draw the base background, then draws the progress fill over the top.

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.

impl Widget for PushButtonWidget[src]

This is the Widget implementation of the PushButtonWidget.

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

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

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

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

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

When a mouse button is clicked within (or outside of) the bounds of the Widget, this function is called. If a mouse button is clicked, and the mouse leaves the bounds of the Widget, the mouse release event will still be triggered for the last Widget which received the mouse down state. This prevents Widgets from becoming confused. This behavior is tracked by the main loop, not by the Widget code. Therefore, when a mouse button is released outside of the bounds of this Widget, you must adjust your state accordingly, if you pay attention to the button_clicked function. This function implementation is optional.

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.

impl Widget for SliderWidget[src]

This is the Widget implementation of the SliderWidget.

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

Draws the SliderWidget 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 mouse_scrolled(
    &mut self,
    _widgets: &[WidgetContainer],
    _layouts: &[LayoutContainer],
    points: Points
)
[src]

Handles the scrolling functionality.

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.

impl Widget for TabBarWidget[src]

This is the Widget implementation of the TabBarWidget.

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

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

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

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

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

Overrides the mouse_moved function, used to determine the position of the tab bar that is currently under the mouse coordinates.

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

Overrides the button_clicked function, used to determine when a mouse clicks inside the bounds of a tab, triggering the on_tab_selected callback where appropriate.

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.

impl Widget for TextWidget[src]

This is the Widget implementation of the TextWidget. Text is rendered onto a 3D texture, then copied to the canvas after rendering. It uses blended mode texture mapping, which may be slow (as described by the SDL2 documentation), so this might change later to use 8 bit color mapping.

fn on_config_changed(&mut self, _k: u8, _v: Config)[src]

Monitors for changes in the text, color changes, or font sizes.

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.

impl Widget for TileWidget[src]

This is the Widget implementation of the TileWidget.

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

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

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

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

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.

impl Widget for TimerWidget[src]

This is the Widget implementation of the TimerWidget.

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

The TimerWidget responds to the tick callback, which is used to determine the timer display ticks. This function is only called when the timer tick occurs, so if there is a function inside the drawing loop that drops frames, this timer may not get called reliably.

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.

impl Widget for ToggleButtonWidget[src]

This is the Widget implementation of the ToggleButtonWidget.

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

Draws the ToggleButtonWidget 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 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.

Loading content...