]> git.saurik.com Git - wxWidgets.git/commitdiff
don't treat Enter always as Tab, just for the text controls
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 May 2002 23:34:36 +0000 (23:34 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 11 May 2002 23:34:36 +0000 (23:34 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index b99b966f66475765a73c88daeb5798fcbd0bf56e..8ce7a97e2f6fea6e19daa16852015373292f89a6 100644 (file)
@@ -1995,9 +1995,23 @@ bool wxWindowMSW::MSWProcessMessage(WXMSG* pMsg)
 
                                 return TRUE;
                             }
-                            //else: no default button
+                            else // no default button
+                            {
 #endif // wxUSE_BUTTON
-                            // treat Enter as TAB: pass to the next control
+                                // this is a quick and dirty test for a text
+                                // control
+                                if ( !(lDlgCode & DLGC_HASSETSEL) )
+                                {
+                                    // don't process Enter, the control might
+                                    // need it for itself and don't let
+                                    // ::IsDialogMessage() have it as it can
+                                    // eat the Enter events sometimes
+                                    return FALSE;
+                                }
+                                //else: treat Enter as TAB: pass to the next
+                                //      control as this is the best thing to do
+                                //      if the text doesn't handle Enter itself
+                            }
                         }
                     }
                     break;