X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6acfcb5f6ab75692859f922b784c877fd40ac4e..9d2cef1c694eb0c34ae4b9c9bd7ab04e3255301d:/src/gtk1/combobox.cpp diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index bd085bae0d..de35777f0b 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -186,7 +186,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, } - SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_WINDOW ) ); + SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); SetForegroundColour( parent->GetForegroundColour() ); Show( TRUE ); @@ -615,7 +615,26 @@ void wxComboBox::OnChar( wxKeyEvent &event ) event.SetEventObject( this ); GetEventHandler()->ProcessEvent( event ); } - //else: do nothing, this will open the listbox + else + { + // This will invoke the dialog default action, such + // as the clicking the default button. + + wxWindow *top_frame = m_parent; + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) + top_frame = top_frame->GetParent(); + + 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); + return; + } + } + } } }