]> git.saurik.com Git - wxWidgets.git/commitdiff
don't let IsDialogMessage() have VK_ESCAPE, this fixes closing the tree in place...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Apr 2002 22:29:16 +0000 (22:29 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 12 Apr 2002 22:29:16 +0000 (22:29 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15120 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 8bb6886ec302be22f5c2413eba8f559a89faa45f..77589902e52de74badfdc01b09e54c06d7afcf75 100644 (file)
@@ -2036,10 +2036,18 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
         }
 #endif // 1/0
 
-        if ( ::IsDialogMessage(GetHwnd(), msg) )
+        // we handle VK_ESCAPE ourselves in wxDialog::OnCharHook() and we
+        // shouldn't let IsDialogMessage() get it as it _always_ eats the
+        // message even when there is no cancel button and when the message is
+        // needed by the control itself: in particular, it prevents the tree in
+        // place edit control from being closed with Escape in a dialog
+        if ( msg->message != WM_KEYDOWN || msg->wParam != VK_ESCAPE )
         {
-            // IsDialogMessage() did something...
-            return TRUE;
+            if ( ::IsDialogMessage(GetHwnd(), msg) )
+            {
+                // IsDialogMessage() did something...
+                return TRUE;
+            }
         }
     }
 #endif // __WXUNIVERSAL__