From: David Elliott Date: Tue, 29 Jul 2003 02:20:51 +0000 (+0000) Subject: Keep track of the captured mouse window so the base GUI code thinks the window X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b9505233a5e5ee77c15e0d1dd2f8f6422af1e74c Keep track of the captured mouse window so the base GUI code thinks the window is captured. Doesn't capture it, but at least satisfies the assertions. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22362 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/cocoa/window.h b/include/wx/cocoa/window.h index 94cf3e1a85..4097dfa077 100644 --- a/include/wx/cocoa/window.h +++ b/include/wx/cocoa/window.h @@ -22,6 +22,7 @@ class WXDLLEXPORT wxWindowCocoa: public wxWindowBase, protected wxCocoaNSView DECLARE_DYNAMIC_CLASS(wxWindowCocoa) DECLARE_NO_COPY_CLASS(wxWindowCocoa) DECLARE_EVENT_TABLE() + friend wxWindow *wxWindowBase::GetCapture(); // ------------------------------------------------------------------------ // initialization // ------------------------------------------------------------------------ @@ -73,6 +74,7 @@ protected: WX_NSView m_cocoaNSView; WX_NSView m_dummyNSView; bool m_isInPaint; + static wxWindow *sm_capturedWindow; // ------------------------------------------------------------------------ // Implementation // ------------------------------------------------------------------------ diff --git a/src/cocoa/window.mm b/src/cocoa/window.mm index 3155c35f68..33e54d67d3 100644 --- a/src/cocoa/window.mm +++ b/src/cocoa/window.mm @@ -27,6 +27,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowBase) BEGIN_EVENT_TABLE(wxWindowCocoa, wxWindowBase) END_EVENT_TABLE() +wxWindow *wxWindowCocoa::sm_capturedWindow = NULL; + // Constructor void wxWindowCocoa::Init() { @@ -386,11 +388,13 @@ void wxWindow::SetFocus() void wxWindow::DoCaptureMouse() { // TODO + sm_capturedWindow = this; } void wxWindow::DoReleaseMouse() { // TODO + sm_capturedWindow = NULL; } void wxWindow::DoScreenToClient(int *x, int *y) const @@ -522,7 +526,7 @@ wxWindow *wxWindowBase::FindFocus() /* static */ wxWindow *wxWindowBase::GetCapture() { // TODO - return NULL; + return wxWindowCocoa::sm_capturedWindow; } wxWindow *wxGetActiveWindow()