aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/window.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/window.hpp')
-rw-r--r--include/cru/ui/window.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/cru/ui/window.hpp b/include/cru/ui/window.hpp
index 197198d2..ee6d2176 100644
--- a/include/cru/ui/window.hpp
+++ b/include/cru/ui/window.hpp
@@ -60,6 +60,14 @@ class Window final : public ContentControl, public SelfResolvable<Window> {
// Get the control that has focus.
Control* GetFocusControl();
+ //*************** region: focus ***************
+
+ // Pass nullptr to release capture.
+ bool CaptureMouseFor(Control* control);
+
+ // Return null if not captured.
+ Control* GetMouseCaptureControl();
+
protected:
void OnChildChanged(Control* old_child, Control* new_child) override;
@@ -86,6 +94,7 @@ class Window final : public ContentControl, public SelfResolvable<Window> {
//*************** region: event dispatcher helper ***************
+ // dispatch enter is useful when mouse is captured.
void DispatchMouseHoverControlChangeEvent(Control* old_control,
Control* new_control,
const Point& point);
@@ -100,6 +109,8 @@ class Window final : public ContentControl, public SelfResolvable<Window> {
Control* focus_control_; // "focus_control_" can't be nullptr
+ Control* mouse_captured_control_;
+
bool need_layout_ = false;
};
} // namespace cru::ui