diff options
author | crupest <crupest@outlook.com> | 2019-04-04 18:23:00 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-04-04 18:23:00 +0800 |
commit | dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474 (patch) | |
tree | c8426a7aa086bf69b54b91328af0c160f933fa49 /include | |
parent | 4d650160a388b0192e04c454ba1a3de21b0d4cc3 (diff) | |
download | cru-dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474.tar.gz cru-dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474.tar.bz2 cru-dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474.zip |
...
Diffstat (limited to 'include')
-rw-r--r-- | include/cru/common/event.hpp | 6 | ||||
-rw-r--r-- | include/cru/ui/window.hpp | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/cru/common/event.hpp b/include/cru/common/event.hpp index 52d75a7b..763f8378 100644 --- a/include/cru/common/event.hpp +++ b/include/cru/common/event.hpp @@ -57,6 +57,12 @@ class Event { return EventHandlerRevoker(EventHandlerRevokerImpl(event_resolver_, token)); } + EventHandlerRevoker AddHandler(EventHandler&& handler) { + const auto token = current_token_++; + handlers_.emplace(token, std::move(handler)); + return EventHandlerRevoker(EventHandlerRevokerImpl(event_resolver_, token)); + } + template <typename... Args> EventHandlerRevoker AddHandler(Args&& args...) { const auto token = current_token_++; diff --git a/include/cru/ui/window.hpp b/include/cru/ui/window.hpp index f0c790be..94deb4c5 100644 --- a/include/cru/ui/window.hpp +++ b/include/cru/ui/window.hpp @@ -64,8 +64,8 @@ class Window final : public ContentControl { void OnNativeFocus(bool focus); + void OnNativeMouseEnterLeave(bool enter); void OnNativeMouseMove(const Point& point); - void OnNativeMouseLeave(); void OnNativeMouseDown(platform::MouseButton button, const Point& point); void OnNativeMouseUp(platform::MouseButton button, const Point& point); |