]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxEVT_CONTEXT_MENU generation (it works differently under w2k/XP than under...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 8 Feb 2004 15:38:54 +0000 (15:38 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 8 Feb 2004 15:38:54 +0000 (15:38 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25643 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 91116b67ac5a916a4c33c6aa49ff45f1125b9252..eb062f01029bd1dcaa3c4fcc8d95f62dfcee0de0 100644 (file)
@@ -2866,8 +2866,20 @@ long wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam
                 wxPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
 
                 wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
-                evtCtx.SetEventObject(this);
-                processed = GetEventHandler()->ProcessEvent(evtCtx);
+
+                // we could have got an event from our child, reflect it back
+                // to it if this is the case
+                wxWindow *win = NULL;
+                if ( wParam != m_hWnd )
+                {
+                    win = FindItemByHWND((WXHWND)wParam);
+                }
+
+                if ( !win )
+                    win = this;
+
+                evtCtx.SetEventObject(win);
+                processed = win->GetEventHandler()->ProcessEvent(evtCtx);
             }
             break;
 #endif