aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-05-12 08:57:45 +0800
committercrupest <crupest@outlook.com>2021-05-12 08:57:45 +0800
commit1497b881c6d13c5e037dcd57988029df0b0e50eb (patch)
tree5f89c071cdb7c891d5afb35c49e3a337418bf026 /include/cru/ui
parent02baef645090f0514fa14b43aecf954fd55257dc (diff)
downloadcru-1497b881c6d13c5e037dcd57988029df0b0e50eb.tar.gz
cru-1497b881c6d13c5e037dcd57988029df0b0e50eb.tar.bz2
cru-1497b881c6d13c5e037dcd57988029df0b0e50eb.zip
...
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/events/UiEvent.hpp10
-rw-r--r--include/cru/ui/host/WindowHost.hpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/include/cru/ui/events/UiEvent.hpp b/include/cru/ui/events/UiEvent.hpp
index 22ad0150..33bc0a60 100644
--- a/include/cru/ui/events/UiEvent.hpp
+++ b/include/cru/ui/events/UiEvent.hpp
@@ -122,18 +122,24 @@ class MouseButtonEventArgs : public MouseEventArgs {
class MouseWheelEventArgs : public MouseEventArgs {
public:
MouseWheelEventArgs(Object* sender, Object* original_sender,
- const Point& point, const float delta)
- : MouseEventArgs(sender, original_sender, point), delta_(delta) {}
+ const Point& point, const float delta,
+ platform::gui::KeyModifier key_modifier)
+ : MouseEventArgs(sender, original_sender, point),
+ delta_(delta),
+ key_modifier_(key_modifier) {}
MouseWheelEventArgs(const MouseWheelEventArgs& other) = default;
MouseWheelEventArgs(MouseWheelEventArgs&& other) = default;
MouseWheelEventArgs& operator=(const MouseWheelEventArgs& other) = default;
MouseWheelEventArgs& operator=(MouseWheelEventArgs&& other) = default;
~MouseWheelEventArgs() override = default;
+ // Positive means down; Negative means up.
float GetDelta() const { return delta_; }
+ platform::gui::KeyModifier GetKeyModifier() const { return key_modifier_; }
private:
float delta_;
+ platform::gui::KeyModifier key_modifier_;
};
class PaintEventArgs : public UiEventArgs {
diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp
index cd9093bc..258b0c4c 100644
--- a/include/cru/ui/host/WindowHost.hpp
+++ b/include/cru/ui/host/WindowHost.hpp
@@ -139,6 +139,8 @@ class WindowHost : public Object {
const platform::gui::NativeMouseButtonEventArgs& args);
void OnNativeMouseUp(platform::gui::INativeWindow* window,
const platform::gui::NativeMouseButtonEventArgs& args);
+ void OnNativeMouseWheel(platform::gui::INativeWindow* window,
+ const platform::gui::NativeMouseWheelEventArgs& args);
void OnNativeKeyDown(platform::gui::INativeWindow* window,
const platform::gui::NativeKeyEventArgs& args);