[][src]Struct pushrod::core::widget_store::WidgetStore

pub struct WidgetStore {
    pub widgets: Vec<WidgetContainer>,
    pub layout_managers: Vec<LayoutManagerContainer>,
}

This is the WidgetStore, which contains a list of Widget objects for a GUI window.

Fields

widgets: Vec<WidgetContainer>layout_managers: Vec<LayoutManagerContainer>

Methods

impl WidgetStore[src]

pub fn new() -> Self[src]

Constructor, creates a new WidgetStore, assigning a top-level CanvasWidget as the very top-level widget. All Widget objects added will be a parent to this Widget, which is stored at ID 0. If this Widget object ever becomes invalidated, the entire window is force refreshed.

pub fn invalidate_all_widgets(&mut self)[src]

Invalidates all Widgets in the GUI stack, forcing a redraw.

pub fn needs_repaint(&mut self) -> bool[src]

Indicates whether or not a widget in the store has been invalidated.

pub fn add_widget(&mut self, name: &str, widget: Box<dyn Widget>) -> i32[src]

Adds a Widget to the stack by name.

pub fn add_widget_to_parent(
    &mut self,
    name: &str,
    widget: Box<dyn Widget>,
    parent_id: i32
) -> i32
[src]

Adds a Widget object to the parent specified by ID.

pub fn add_widget_to_layout_manager(
    &mut self,
    name: &str,
    widget: Box<dyn Widget>,
    manager_id: i32,
    position: Point
) -> i32
[src]

pub fn get_parent_of(&mut self, widget_id: i32) -> i32[src]

Gets the parent of the child Widget by ID. If the child has no assigned parent, the top-level CanvasWidget is returned (ID 0).

pub fn get_children_of(&self, parent_id: i32) -> Vec<i32>[src]

Returns a list of the children that are owned by a parent ID. Does not return a list of siblings, only the first-level children.

pub fn get_widget_id_for_point(&mut self, point: Point) -> i32[src]

Gets a Widget by ID for a point in the screen. If the GUI object is hidden or disabled, the ID is not returned. If no widget is found under the point specified, an ID of -1 is returned.

pub fn get_name_for_widget_id(&mut self, widget_id: i32) -> &str[src]

Returns the name of the Widget by specified ID.

pub fn get_widget_id_for_name(&mut self, name: &str) -> i32[src]

Retrieves a widget ID for the name specified. Returns top-level CanvasWidget ID if not found.

pub fn get_widget_for_name(&mut self, name: &str) -> &RefCell<Box<dyn Widget>>[src]

Retrieves a reference to a Widget by its name. Returns the top-level CanvasWidget object if not found.

pub fn get_widget_for_id(&mut self, id: i32) -> &RefCell<Box<dyn Widget>>[src]

Retrieves a Widget by its ID.

pub fn add_layout_manager(&mut self, manager: Box<dyn LayoutManager>) -> i32[src]

pub fn do_layout_for_manager(&mut self, manager_id: i32)[src]

pub fn adjust_layout_manager(
    &mut self,
    manager_id: i32,
    coordinates: LayoutManagerPadding
)
[src]

pub fn resize_layout_managers(&mut self, _w: u32, _h: u32)[src]

pub fn set_hidden(&mut self, widget_id: i32, state: bool)[src]

Sets the hidden toggle for a parent, and all of its children.

pub fn draw(
    &mut self,
    widget_id: i32,
    c: Context,
    g: &mut GlGraphics,
    original_fbo: GLuint
)
[src]

Draws a Widget by ID, and any children contained in that Widget. Submitting a draw request from ID 0 will redraw the entire screen.

Auto Trait Implementations

Blanket Implementations

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.

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

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

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

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.