[−][src]Struct pushrod::core::widget_store::WidgetStore
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]
&mut self,
name: &str,
widget: Box<dyn Widget>,
parent_id: i32
) -> i32
Adds a Widget object to the parent specified by ID.
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 handle_event(
&mut self,
widget_id: i32,
event: CallbackEvent
) -> Option<CallbackEvent>[src]
&mut self,
widget_id: i32,
event: CallbackEvent
) -> Option<CallbackEvent>
Handles a specific event generated by the OS or the GUI interaction.
pub fn inject_event(&mut self, event: CallbackEvent)[src]
Injects an event to all widgets, allowing them to exhibit custom event handling behavior if required. This is usually used in cases where special triggering needs to take place, like an indication of a timeout or transient error.
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 add_widget_to_layout_manager(
&mut self,
name: &str,
widget: Box<dyn Widget>,
manager_id: i32,
position: Point
) -> i32[src]
&mut self,
name: &str,
widget: Box<dyn Widget>,
manager_id: i32,
position: Point
) -> i32
pub fn resize_layout_managers(&mut self, _w: u32, _h: u32)[src]
[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]
&mut self,
widget_id: i32,
c: Context,
g: &mut GlGraphics,
original_fbo: GLuint
)
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
impl !Send for WidgetStore
impl Unpin for WidgetStore
impl !Sync for WidgetStore
impl !UnwindSafe for WidgetStore
impl !RefUnwindSafe for WidgetStore
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value as a parameter of self.