[][src]Struct pushrod_widgets::properties::WidgetProperties

pub struct WidgetProperties { /* fields omitted */ }

This is a structure that stores properties for Widgets, which can be used to define the object's behavior.

Implementations

impl WidgetProperties[src]

This is the implementation of the WidgetProperties store. This is used by each and every Widget, which stores information about the property. Once each property is set, the Widget can respond to the set action, and repaint itself, or anything similar.

pub fn set(&mut self, property_key: u32, property_value: String) -> &mut Self[src]

Sets a value for a property based on its numerical key. Returns a mutable reference to self so that commands can be chained together.

pub fn delete(&mut self, property_key: u32)[src]

Deletes a property value for the given numerical key.

pub fn get(&mut self, property_key: u32) -> String[src]

Retrieves the value for a property.

pub fn key_set(&mut self, property_key: u32) -> bool[src]

Returns a flag indicating whether or not a property for a numerical key has been set.

pub fn invalidate(&mut self)[src]

Sets the invalidated state for the Widget.

pub fn set_color(&mut self, property_key: u32, color: Color) -> &mut Self[src]

Stores the color for the specified key. Format is "r g b a", as numerical values, base 10. Sets the invalidate flag afterward. Returns a mutable reference to self so that commands can be chained together.

pub fn set_bounds(&mut self, w: u32, h: u32) -> &mut Self[src]

Sets the size of the Widget. Returns a mutable reference to self so that commands can be chained together.

pub fn set_origin(&mut self, x: u32, y: u32) -> &mut Self[src]

Sets the origin for the Widget. Does not set the invalidate flag, as the repositioning of the Widget does not require a repaint. Returns a mutable reference to self so that commands can be chained together.

pub fn set_bool(&mut self, property_key: u32) -> &mut Self[src]

Sets a boolean for a given property key. Returns a mutable reference to self so that commands can be chained together.

pub fn set_value(&mut self, property_key: u32, value: i32) -> &mut Self[src]

Sets a numeric value to a given property key. Returns a mutable reference to self so that commands can be chained together.

pub fn get_color(&self, property_key: u32, default_color: Color) -> Color[src]

Retrieves a color based on the given property key. If the color cannot be found, the default_color specified will be returned.

pub fn get_bounds(&self) -> (u32, u32)[src]

Retrieves the stored bounds as a tuple. If the bounds cannot be found, invisible bounds are returned (0x0).

pub fn get_origin(&self) -> (u32, u32)[src]

Retrieves the origin of the Widget. If the origin cannot be found, an origin of 0x0 is returned.

pub fn get_bool(&self, property_key: u32) -> bool[src]

Retrieves the boolean value for a specified property. If the property has not been set with set_bool, the return will be false. Otherwise, if the specified key exists, and the value is set to 1, the return value will be true.

pub fn get_value(&self, property_key: u32) -> i32[src]

Retrieves a numeric value assigned to a property as an i32 value.

Trait Implementations

impl Clone for WidgetProperties[src]

impl Debug for WidgetProperties[src]

impl Default for WidgetProperties[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.