more event wip

This commit is contained in:
K Simmons
2022-08-22 16:16:39 -07:00
parent 53add253b6
commit a650c146f1
4 changed files with 175 additions and 97 deletions
@@ -51,6 +51,15 @@ impl MouseEventHandler {
self
}
pub fn on_up(
mut self,
button: MouseButton,
handler: impl Fn(MouseButtonEvent, &mut EventContext) + 'static,
) -> Self {
self.handlers = self.handlers.on_up(button, handler);
self
}
pub fn on_click(
mut self,
button: MouseButton,
@@ -69,6 +78,15 @@ impl MouseEventHandler {
self
}
pub fn on_up_out(
mut self,
button: MouseButton,
handler: impl Fn(MouseButtonEvent, &mut EventContext) + 'static,
) -> Self {
self.handlers = self.handlers.on_up(button, handler);
self
}
pub fn on_drag(
mut self,
button: MouseButton,
@@ -78,6 +96,15 @@ impl MouseEventHandler {
self
}
pub fn on_drag_over(
mut self,
button: MouseButton,
handler: impl Fn(bool, MouseMovedEvent, &mut EventContext) + 'static,
) -> Self {
self.handlers = self.handlers.on_drag_over(button, handler);
self
}
pub fn on_hover(
mut self,
handler: impl Fn(bool, MouseMovedEvent, &mut EventContext) + 'static,