]> git.saurik.com Git - wxWidgets.git/commitdiff
Keep track of the captured mouse window so the base GUI code thinks the window
authorDavid Elliott <dfe@tgwbd.org>
Tue, 29 Jul 2003 02:20:51 +0000 (02:20 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Tue, 29 Jul 2003 02:20:51 +0000 (02:20 +0000)
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

include/wx/cocoa/window.h
src/cocoa/window.mm

index 94cf3e1a85763b83cdf0964a8ac54061b77eb3e0..4097dfa0772252d20ff53a1387ea7a36b2c8a97e 100644 (file)
@@ -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
 // ------------------------------------------------------------------------
index 3155c35f687f9f0c0470f58a2b5f5f53bb9ed590..33e54d67d32803bd83597ddfda8c58f539aa9d02 100644 (file)
@@ -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()