[−][src]Struct pushrod_render::render::widget_config::WidgetConfig
This is the store for the WidgetConfig, which each Widget object needs. This stores
information about the Widget. It currently contains the point of origin, size, a HashMap of
different Colors, a border width, and an invalidation flag.
Fields
origin: Vec<i32>This Vec contains two points of origin: the physical X and Y coordinates in the
Canvas.
size: Vec<u32>This Vec contains the width and height of the object.
colors: HashMap<u8, Color>This HashMap contains a key/value pair containing colors for the Widget.
border_width: u8This is the border width in pixels.
Methods
impl WidgetConfig[src]
This is the implementation of the WidgetConfig.
pub fn new(x: i32, y: i32, w: u32, h: u32) -> Self[src]
Constructor - takes the X, Y, W, and H coordinates of the Widget, physically in the
main Canvas.
pub fn to_x(&self, x: i32) -> i32[src]
Converts an X point to the physical X point on the Canvas plus the point of origin.
Returns i32 containing the modified X coordinate. This is a convenience method for the
Widget to draw based on a 0x0 point of origin.
pub fn to_y(&self, y: i32) -> i32[src]
Converts a Y point to the physical Y point on the Canvas plus the point of origin.
Returns i32 containing the modified Y coordinate. This is a convenience method for the
Widget to draw based on a 0x0 point of origin.
pub fn set_invalidate(&mut self, flag: bool)[src]
Sets the invalidation state of the Widget, telling the Engine that the Widget
contents has changed, and must be redrawn. Setting the flag to true indicates that
the Widget needs to be redrawn on the screen, false indicates that it its state has
not changed, and its image can be pulled from a buffer if necessary, skipping the draw
call.
pub fn invalidated(&self) -> bool[src]
Returns the invalidation state. Returns a bool containing the state.
Auto Trait Implementations
impl Send for WidgetConfig
impl Unpin for WidgetConfig
impl Sync for WidgetConfig
impl UnwindSafe for WidgetConfig
impl RefUnwindSafe for WidgetConfig
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
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,