diff options
author | crupest <crupest@outlook.com> | 2018-09-12 23:09:13 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2018-09-12 23:09:13 +0800 |
commit | 5f75c4f4f6736ff8efa87beab715fd9a044f666c (patch) | |
tree | a67dd8d9f6af0ff7b93776c1e3bcc2816a2250dd /CruUI/ui/window.h | |
parent | e2dab3893a8be43de0e50587c85df9e11abf87fe (diff) | |
download | cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.tar.gz cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.tar.bz2 cru-5f75c4f4f6736ff8efa87beab715fd9a044f666c.zip |
...
Never use PostMessage with hwnd as null!!!!!!!!!!!!!!!!!!!!!!!!
Diffstat (limited to 'CruUI/ui/window.h')
-rw-r--r-- | CruUI/ui/window.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/CruUI/ui/window.h b/CruUI/ui/window.h index 9ffa4dc6..551e2048 100644 --- a/CruUI/ui/window.h +++ b/CruUI/ui/window.h @@ -172,6 +172,7 @@ namespace cru { //Return false if the message is not handled. bool HandleWindowMessage(HWND hwnd, int msg, WPARAM w_param, LPARAM l_param, LRESULT& result); + Point GetMousePosition(); //*************** region: position and size *************** @@ -207,6 +208,11 @@ namespace cru { Control* GetFocusControl(); + //*************** region: mouse capture *************** + + Control* CaptureMouseFor(Control* control); + Control* ReleaseCurrentMouseCapture(); + private: //*************** region: native operations *************** @@ -230,8 +236,6 @@ namespace cru { void OnMouseDownInternal(MouseButton button, POINT point); void OnMouseUpInternal(MouseButton button, POINT point); - - //*************** region: event dispatcher helper *************** template<typename EventArgs> @@ -258,6 +262,8 @@ namespace cru { } } + void DispatchMouseHoverControlChangeEvent(Control* old_control, Control * new_control, const Point& point); + private: std::unique_ptr<WindowLayoutManager> layout_manager_; @@ -270,6 +276,8 @@ namespace cru { bool window_focus_ = false; Control* focus_control_ = this; // "focus_control_" can't be nullptr + + Control* mouse_capture_control_ = nullptr; }; } } |