From dbda5a8e4f0d59ad95be8fc3ee7b21e9122cc474 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 4 Apr 2019 18:23:00 +0800 Subject: ... --- include/cru/common/event.hpp | 6 ++++++ include/cru/ui/window.hpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'include/cru') 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 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); -- cgit v1.2.3