From: Robert Roebling <robert@roebling.de>
Date: Tue, 26 Feb 2008 20:09:23 +0000 (+0000)
Subject: restore wxComboBox's behaviour of reacting to <ENTER>
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5e9b723f6d6e22518370565b59f7d9476987e4fa?ds=sidebyside

restore wxComboBox's behaviour of reacting to <ENTER>

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52129 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp
index d64524fbe0..439408958b 100644
--- a/src/gtk/combobox.cpp
+++ b/src/gtk/combobox.cpp
@@ -393,6 +393,17 @@ void wxComboBox::OnChar( wxKeyEvent &event )
                     return;
                 }
             }
+
+            // On enter key press, we must give a signal to default control, 
+            // Otherwise, nothing happens when pressing Enter from inside a 
+            // combo box in a dialog. 
+            wxWindow *top_frame = wxGetTopLevelParent(this);
+            if( top_frame && GTK_IS_WINDOW(top_frame->m_widget) )
+            {
+                GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
+                if ( window->default_widget )
+                    gtk_widget_activate( window->default_widget );
+            }
             break;
     }