]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed mouse handling for captured windows
authorJulian Smart <julian@anthemion.co.uk>
Sun, 12 May 2002 16:08:47 +0000 (16:08 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 12 May 2002 16:08:47 +0000 (16:08 +0000)
Didn't need most of the cshelp fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/cshelp.cpp
src/msw/window.cpp

index 2cc7626a4aab31a5c276ef52ee2cc414da2abb0a..43ebbef496ae20f7df9c44ce255f0904e39ed6bf 100644 (file)
@@ -87,6 +87,9 @@ wxContextHelp::~wxContextHelp()
         EndContextHelp();
 }
 
+// Not currently needed, but on some systems capture may not work as
+// expected so we'll leave it here for now.
+#if 0
 static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool push)
 {
     if (push)
@@ -103,6 +106,7 @@ static void wxPushOrPopEventHandlers(wxContextHelp* help, wxWindow* win, bool pu
         node = node->Next();
     }
 }
+#endif
 
 // Begin 'context help mode'
 bool wxContextHelp::BeginContextHelp(wxWindow* win)
@@ -122,8 +126,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
 
     m_status = FALSE;
 
-//    win->PushEventHandler(new wxContextHelpEvtHandler(this));
-    wxPushOrPopEventHandlers(this, win, TRUE);
+    win->PushEventHandler(new wxContextHelpEvtHandler(this));
+    //wxPushOrPopEventHandlers(this, win, TRUE);
 
     win->CaptureMouse();
 
@@ -131,8 +135,8 @@ bool wxContextHelp::BeginContextHelp(wxWindow* win)
 
     win->ReleaseMouse();
 
-//    win->PopEventHandler(TRUE);
-    wxPushOrPopEventHandlers(this, win, FALSE);
+    win->PopEventHandler(TRUE);
+    //wxPushOrPopEventHandlers(this, win, FALSE);
 
     win->SetCursor(oldCursor);
 
index 8ce7a97e2f6fea6e19daa16852015373292f89a6..b280a33098d47c35150332330f61e11ada4a571c 100644 (file)
@@ -2421,9 +2421,15 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
                         y = GET_Y_LPARAM(lParam);
 
                     // redirect the event to a static control if necessary
-                    wxWindow *win = FindWindowForMouseEvent(this, &x, &y);
-
-                    processed = win->HandleMouseEvent(message, x, y, wParam);
+                    if (this == GetCapture())
+                    {
+                        processed = HandleMouseEvent(message, x, y, wParam);
+                    }
+                    else
+                    {
+                        wxWindow *win = FindWindowForMouseEvent(this, &x, &y);
+                        processed = win->HandleMouseEvent(message, x, y, wParam);
+                    }
                 }
             }
             break;