From a6e67b552cebaa5e57e7e8001bf3dc2721e794ec Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sat, 11 May 2002 23:34:36 +0000
Subject: [PATCH] don't treat Enter always as Tab, just for the text controls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 src/msw/window.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index b99b966f66..8ce7a97e2f 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -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;
-- 
2.47.2