[][src]Enum pushrod_widgets::event::PushrodEvent

pub enum PushrodEvent {
    MouseMoved {
        widget_id: u32,
        x: u32,
        y: u32,
    },
    MouseScrolled {
        widget_id: u32,
        hor: i32,
        ver: i32,
    },
    MouseButton {
        widget_id: u32,
        button: u32,
        state: bool,
    },
    DrawFrame {
        timestamp: u128,
    },
    WidgetClicked {
        widget_id: u32,
        button: u32,
        clicks: u8,
    },
    WidgetSelected {
        widget_id: u32,
        state: bool,
    },
    WidgetToggled {
        widget_id: u32,
        state: bool,
    },
    WidgetRadioSelected {
        widget_id: u32,
        group_id: u32,
    },
    WidgetRadioUnselected {
        widget_id: u32,
        group_id: u32,
    },
    WidgetMouseEntered {
        widget_id: u32,
    },
    WidgetMouseExited {
        widget_id: u32,
    },
    WidgetFocusGained {
        widget_id: u32,
    },
    WidgetFocusLost {
        widget_id: u32,
    },
    WidgetTabSelected {
        widget_id: u32,
        tab_id: u8,
    },
    WidgetValueChanged {
        widget_id: u32,
        old_value: u32,
        new_value: u32,
    },
    WidgetMoved {
        widget_id: u32,
        new_x: u32,
        new_y: u32,
    },
    WidgetVisibilityChanged {
        widget_id: u32,
        alpha: u32,
        hidden: bool,
    },
}

These are the events that are generated by the Pushrod Event translation system for SDL2. These events are passed into the handle_event function, which contains the currently translated events.

Variants

MouseMoved

Mouse movement detected, coordinates are relative to the X/Y position within the widget, not to the Window in which it belongs.

Fields of MouseMoved

widget_id: u32

The Widget ID.

x: u32

X coordinate of the mouse pointer.

y: u32

Y coordinate of the mouse pointer.

MouseScrolled

Mouse wheel scrolled.

Fields of MouseScrolled

widget_id: u32

The Widget ID.

hor: i32

Horizontal scrolling direction, and amount. Positive numbers indicate movement to the right. Negative indicates to the left.

ver: i32

Vertical scrolling direction, and amount. Positive numbers indicate downward movement. Negative numbers indicate upward movement.

MouseButton

Mouse button click/release.

Fields of MouseButton

widget_id: u32

The Widget ID.

button: u32

The button ID that was clicked.

state: bool

Pressed/released state: true indicates mouse button press, false is released.

DrawFrame

Event (draw tick) that is issued between drawing frames. This can be used as a timer.

Fields of DrawFrame

timestamp: u128
WidgetClicked

Widget was clicked.

Fields of WidgetClicked

widget_id: u32

The Widget ID.

button: u32

The button ID that was clicked.

clicks: u8

Number of clicks registered.

WidgetSelected

Widget was selected.

Fields of WidgetSelected

widget_id: u32

The Widget ID.

state: bool

Selection state: true indicates selected, false indicates unselected.

WidgetToggled

Widget state was toggled.

Fields of WidgetToggled

widget_id: u32

The Widget ID.

state: bool

Toggle state: true indicates toggled, false indicates untoggled.

WidgetRadioSelected

Widget radio button state was selected.

Fields of WidgetRadioSelected

widget_id: u32

The Widget ID.

group_id: u32

The group ID.

WidgetRadioUnselected

Widget radio button state was unselected.

Fields of WidgetRadioUnselected

widget_id: u32

The Widget ID.

group_id: u32

The group ID.

WidgetMouseEntered

Mouse entered the scope of a widget.

Fields of WidgetMouseEntered

widget_id: u32

The Widget ID.

WidgetMouseExited

Mouse exited the scope of a widget.

Fields of WidgetMouseExited

widget_id: u32

The Widget ID.

WidgetFocusGained

Widget gained focus through a [TAB] key, or other means.

Fields of WidgetFocusGained

widget_id: u32

The Widget ID.

WidgetFocusLost

Widget lost focus.

Fields of WidgetFocusLost

widget_id: u32

The Widget ID.

WidgetTabSelected

Tab was selected inside a Tab Widget object.

Fields of WidgetTabSelected

widget_id: u32

The Widget ID.

tab_id: u8

The ID of the tab that was selected.

WidgetValueChanged

Indicates that a value contained within a Widget was altered.

Fields of WidgetValueChanged

widget_id: u32

The Widget ID.

old_value: u32

The value before the change.

new_value: u32

The new value.

WidgetMoved

Indicates a Widget's position was altered within the bounds of the Window.

Fields of WidgetMoved

widget_id: u32

The Widget ID.

new_x: u32

The Widget's new X coordinates in relation to the Window.

new_y: u32

The Widget's new Y coordinates in relation to the Window.

WidgetVisibilityChanged

Indicates that the visibility of a Widget on the screen has physically changed. This is an indication of the visibility based on its alpha value. An alpha value of 100 indicates that the object is completely visible, whereas an alpha of 0 indicates that it is hidden.

Fields of WidgetVisibilityChanged

widget_id: u32

The Widget ID.

alpha: u32

The Widget's visible alpha value: 0 to 100.

hidden: bool

Indicates whether or not the Widget has disappeared from the Window. This can be set to true or false, even if the alpha value is greater than 0. If the value is set true, it means the object is not visible. false otherwise. If the alpha is 0, and hidden is false, it will still indicate a visibility of 0, which will mean the object cannot be interacted with.

Trait Implementations

impl Clone for PushrodEvent[src]

impl Debug for PushrodEvent[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.