[][src]Struct pushrod::widget::box_widget::BoxWidget

pub struct BoxWidget { /* fields omitted */ }

A BoxWidget is a CanvasWidget with a bounding box. Takes two additional options:

  • CONFIG_BORDER_WIDTH specifies the width of the border to be drawn in pixels.
  • CONFIG_BORDER_COLOR specifies the color of the border to be drawn.

Methods

impl BoxWidget[src]

pub fn new() -> Self[src]

Constructor.

Trait Implementations

impl Drawable for BoxWidget[src]

fn draw_with_offset(
    &mut self,
    c: Context,
    g: &mut GlGraphics,
    clip: &DrawState,
    point_offset: Point
)
[src]

Draws an object at an offset on the screen. This is a convenience method that is used by other Widgets that contain multiple widgets. Draw with offset always uses 0x0 as the starting drawing coordinates, as this is what will be drawn within the bounds of the Widget. (See CheckboxWidget and ImageButtonWidget for good examples of this use.) Read more

impl InjectableSystemEvents for BoxWidget[src]

impl InjectableCustomEvents for BoxWidget[src]

fn inject_custom_event(&mut self, _widget_id: i32) -> Option<CallbackEvent>[src]

Injects an event into the run loop. This can be a timer event, a refresh event, or whatever the Widget wants to inject. These should be custom events, not system events. This method only gets called if injects_events returns true. Read more

impl Widget for BoxWidget[src]

fn invalidate(&mut self)[src]

Indicates that a Widget object needs to be repainted.

fn clear_invalidate(&mut self)[src]

Clears the invalidation flag. Set this when the draw function completes. Otherwise, this Widget object may be continuously repainted. Read more

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

Indicates whether or not a Widget needs to be repainted.

fn get_config(&mut self, config: u8) -> Option<&Config>[src]

Master config getter - use convenience methods.

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

Sets a color for a configuration key.

fn set_numeric(&mut self, config: u8, value: u64)[src]

Sets a numeric value for a configuration key.

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

Sets a text value for a configuration key.

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

Sets a toggle value for a configuration key.

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

If this Widget provides custom injected events that are generated outside of the handle_event loop, indicate true. Only override if necessary. (See TimerWidget for reference.) Read more

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

Describes whether or not the Widget returns a Drawable trait. This function is called each time a frame is refreshed, so if there is no Drawable available, this function could serve as a way to indicate a frame tick. Only override this to set it to false if your Widget does not draw anything on the screen. Read more

Auto Trait Implementations

impl !Send for BoxWidget

impl Unpin for BoxWidget

impl !Sync for BoxWidget

impl !UnwindSafe for BoxWidget

impl !RefUnwindSafe for BoxWidget

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.