[][src]Struct pushrod::widget::radio_button_widget::RadioButtonWidget

pub struct RadioButtonWidget { /* fields omitted */ }

Draws a radio button with only one object that can be selected at any one time within a group. Generates a WidgetSelected event when an object has been selected within the group. Also generates an internal UnselectRadioButtons event, which should not be handled - this is only used by RadioButtonWidget objects.

Methods

impl RadioButtonWidget[src]

pub fn new(
    font_name: String,
    text: String,
    font_size: u32,
    justify: TextJustify,
    selected: bool
) -> Self
[src]

Constructor. Requires the name of the font, the text to display, the image name to display, the size of the font, the font justification when rendered, and a selected pre-set state. Images are loaded from the assets/ directory.

Trait Implementations

impl Widget for RadioButtonWidget[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_point(&mut self, config: u8, x: i32, y: i32)[src]

Sets a point value for a configuration key.

fn set_size(&mut self, config: u8, w: i32, h: i32)[src]

Sets a size value for a configuration key.

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 draw_disabled(&mut self, c: Context, g: &mut GlGraphics, clip: &DrawState)[src]

Internal method that is used to draw a box around the Widget when in disabled state. You can override this method, should you choose to, so that the disabled state appears differently in your application. It is safe to leave this alone. Read more

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. (See CheckboxWidget and ImageButtonWidget for good examples of this use.) Read more

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> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<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.