From 7a564d98db0b7c7be5b3bfac955cb88998a472ac Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 29 Mar 2022 12:24:06 +0800 Subject: ... --- include/cru/ui/host/WindowHost.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/cru/ui/host/WindowHost.h') diff --git a/include/cru/ui/host/WindowHost.h b/include/cru/ui/host/WindowHost.h index d88482c4..0d2e0341 100644 --- a/include/cru/ui/host/WindowHost.h +++ b/include/cru/ui/host/WindowHost.h @@ -21,6 +21,14 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable { friend controls::Control; CRU_DEFINE_CLASS_LOG_TAG(u"WindowHost") + private: + static int event_handling_depth_; + + public: + static bool IsInEventHandling() { return event_handling_depth_ > 0; } + static void EnterEventHandling(); + static void LeaveEventHandling(); + public: explicit WindowHost(controls::Control* root_control); @@ -139,6 +147,8 @@ class CRU_UI_API WindowHost : public Object, public SelfResolvable { const Point& point, bool no_leave, bool no_enter); + void OnControlDetach(controls::Control* control); + private: controls::Control* root_control_ = nullptr; render::RenderObject* root_render_object_ = nullptr; -- cgit v1.2.3