]> git.saurik.com Git - wxWidgets.git/commitdiff
don't send fictious menu events when another WM_COMMAND occurs while a popup menu...
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 3 Nov 2001 00:34:44 +0000 (00:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 3 Nov 2001 00:34:44 +0000 (00:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index a73e4bad73c7f0fb4b599a647c0c462928fe23ac..fa407353a86094345c0d453e57a4aafb67cc5542 100644 (file)
@@ -3522,7 +3522,7 @@ bool wxWindowMSW::HandleGetMinMaxInfo(void *mmInfo)
 bool wxWindowMSW::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
 {
 #if wxUSE_MENUS_NATIVE
-    if ( wxCurrentPopupMenu )
+    if ( !cmd && wxCurrentPopupMenu )
     {
         wxMenu *popupMenu = wxCurrentPopupMenu;
         wxCurrentPopupMenu = NULL;
@@ -3531,14 +3531,14 @@ bool wxWindowMSW::HandleCommand(WXWORD id, WXWORD cmd, WXHWND control)
     }
 #endif // wxUSE_MENUS_NATIVE
 
-    wxWindow *win = (wxWindow*) NULL;
+    wxWindow *win = NULL;
     if ( cmd == 0 || cmd == 1 ) // menu or accel - use id
     {
         // must cast to a signed type before comparing with other ids!
         win = FindItem((signed short)id);
     }
 
-    if (!win && control)
+    if ( !win && control )
     {
         // find it from HWND - this works even with the broken programs using
         // the same ids for different controls