Enum pushrod::core::callbacks::CallbackEvent
source · pub enum CallbackEvent {
Show 16 variants
MouseEntered {
widget_id: i32,
},
MouseExited {
widget_id: i32,
},
MouseScrolled {
widget_id: i32,
point: Point,
},
MouseMoved {
widget_id: i32,
point: Point,
},
KeyPressed {
widget_id: i32,
key: Key,
state: ButtonState,
},
WindowResized {
size: Size,
},
WindowFocused {
flag: bool,
},
MouseButtonDown {
widget_id: i32,
button: Button,
},
MouseButtonUpInside {
widget_id: i32,
button: Button,
},
MouseButtonUpOutside {
widget_id: i32,
button: Button,
},
WidgetClicked {
widget_id: i32,
button: Button,
},
WidgetSelected {
widget_id: i32,
button: Button,
selected: bool,
},
WidgetMoved {
widget_id: i32,
point: Point,
},
WidgetResized {
widget_id: i32,
size: Size,
},
TimerTriggered {
widget_id: i32,
},
UnselectRadioButtons {
widget_id: i32,
group_id: i32,
},
}Expand description
These are the different types of events that can be triggered. Any other callback events should be extended in this enum definition.
Variants§
MouseEntered
Indicates a mouse entered the bounds of a Widget. Contains the ID of the Widget that was
affected.
MouseExited
Indicates a mouse exited the bounds of a Widget. Contains the ID of the Widget that was
affected.
MouseScrolled
Indicates that the scroll wheel was moved inside a Widget. Contains the ID of the
Widget that had the mouse scroll action, and the point in the direction of the scroll,
along with the amount of points the mouse scroll moved.
MouseMoved
Indicates that a mouse moved within the bounds of a Widget. Contains the ID of the
Widget that was affected.
KeyPressed
Indicates that a keyboard key was pressed/released inside the bounds of a Widget. Contains
the ID of the Widget that received the keypress, along with the Key value, and any
associated Button modifier states.
WindowResized
Indicates that the main application window was resized. Contains the Size of the new
bounds.
WindowFocused
Indicates whether or not focus was gained or lost for the main application. Contains a
boolean flag indicating focus: true is focused, false if lost.
MouseButtonDown
Indicates that a mouse button was pressed within the bounds of a Widget. Contains the
ID of the Widget, along with the Button that was clicked.
MouseButtonUpInside
Indicates that a mouse button was released within the bounds of a Widget. Contains
the ID of the Widget, along with the Button that was released.
MouseButtonUpOutside
Indicates that a mouse button was released outside of the bounds of a Widget. Contains
the ID of the Widget, along with the Button that was released.
WidgetClicked
Indicates that a mouse button triggered a click action within a Widget. Contains the
ID of the Widget, along with the Button that was used to indicate the click action.
WidgetSelected
Indicates that a Widget’s selected state has been toggled. Contains the ID of the
Widget that was toggled, along with the mouse Button that was clicked, and the
final selected state of the widget.
WidgetMoved
Indicates that a Widget’s position has been moved either through physical interaction,
or through a LayoutManager repositioning. Contains the ID of the Widget that moved,
along with its new position as a Point.
WidgetResized
Indicates that a Widget’s Size has changed. Contains the ID of the Widget, along with
the new Size of the Widget.
TimerTriggered
Indicates that a timer timeout has been triggered. Contains the ID of the Widget that was
affected.
UnselectRadioButtons
Indicates that a group of RadioButtonWidget objects has been deselected. Contains the
ID of the Widget that was unselected, along with the group ID.
Trait Implementations§
source§impl Clone for CallbackEvent
impl Clone for CallbackEvent
source§fn clone(&self) -> CallbackEvent
fn clone(&self) -> CallbackEvent
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CallbackEvent
impl RefUnwindSafe for CallbackEvent
impl Send for CallbackEvent
impl Sync for CallbackEvent
impl Unpin for CallbackEvent
impl UnwindSafe for CallbackEvent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more