[−][src]Trait pushrod::core::callbacks::PushrodCallbackEvents
This is the callback event class that is used to handle events that are produced when a widget is interacted with in the Pushrod Run Loop. This callback is triggered when an event happens either in the main GUI, or within a GUI object.
Provided methods
fn handle_event(&mut self, event: CallbackEvent, widget_store: &mut WidgetStore)
This is the main event handling function, and can be overridden if necessary. This function is called when an event is handled by the main run loop. As an event happens in real time, this function is called and the translated event is sent here. If this function is not overridden, it will call the helper methods below, which can be overridden by the main application as it sees fit for each event type. It is not necessary to implement each callback - only the ones you wish to implement.
fn mouse_entered(&mut self, _widget_id: i32, _widget_store: &mut WidgetStore)
Called when a mouse enters a widget.
fn mouse_exited(&mut self, _widget_id: i32, _widget_store: &mut WidgetStore)
Called when a mouse exits a widget.
fn mouse_scrolled(
&mut self,
_widget_id: i32,
_point: Point,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_point: Point,
_widget_store: &mut WidgetStore
)
Called when a mouse scroll wheel is used inside a widget.
fn mouse_moved(
&mut self,
_widget_id: i32,
_point: Point,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_point: Point,
_widget_store: &mut WidgetStore
)
Called when a mouse moves inside a widget.
fn key_pressed(
&mut self,
_widget_id: i32,
_key: Key,
_state: ButtonState,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_key: Key,
_state: ButtonState,
_widget_store: &mut WidgetStore
)
Called when a keyboard keypress is detected. The state of the key press is passed as well.
fn window_resized(&mut self, _size: Size, _widget_store: &mut WidgetStore)
Called when the main window is resized.
fn window_focused(&mut self, _flag: bool, _widget_store: &mut WidgetStore)
Called when the window gains or loses focus.
fn mouse_button_down(
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
Called when a mouse button is pressed.
fn mouse_button_up_inside(
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
Called when a mouse button is released within the same widget which it was pressed.
fn mouse_button_up_outside(
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
Called when a mouse button is released outside of the scope of the widget from which it was pressed.
fn widget_clicked(
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_button: Button,
_widget_store: &mut WidgetStore
)
Called when a full click is detected inside a widget. A "click event" consists of a mouse button down and release within the confines of the same widget.
fn widget_selected(
&mut self,
_widget_id: i32,
_button: Button,
_selected: bool,
_widget_store: &mut WidgetStore
)
&mut self,
_widget_id: i32,
_button: Button,
_selected: bool,
_widget_store: &mut WidgetStore
)
Called when a widget is selected. This is a generated event by a widget, and is not part of the main run loop. This widget is generated by event injection.
fn timer_triggered(&mut self, _widget_id: i32, _widget_store: &mut WidgetStore)
Called when a timer expires for a widget. The ID of the widget is the timer widget that generated the expiration timeout.