X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef5c70f96f5e06e1c8f8119f51b99dd019583d2b..7708a267207473783f88cae047b78adaecf83675:/src/gtk/combobox.cpp?ds=sidebyside diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 32123f67cc..1a4e40ce0f 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -190,6 +190,9 @@ gtkcombobox_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) if (!combo->m_hasVMT) return; + if (combo->GetSelection() == -1) + return; + wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, combo->GetId() ); event.SetInt( combo->GetSelection() ); event.SetString( combo->GetStringSelection() ); @@ -197,6 +200,7 @@ gtkcombobox_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) combo->GetEventHandler()->ProcessEvent( event ); } } + #endif //----------------------------------------------------------------------------- @@ -247,7 +251,6 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, { m_ignoreNextUpdate = false; m_needParent = true; - m_acceptsFocus = true; m_prevSelection = 0; if (!PreCreation( parent, pos, size ) || @@ -345,6 +348,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, g_signal_connect_after (m_widget, "changed", G_CALLBACK (gtkcombobox_changed_callback), this); + } else #endif @@ -368,15 +372,9 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, this); g_signal_connect_after (entry, "changed", G_CALLBACK (gtkcombo_text_changed_callback), this); - - // This is required for tool bar support - // Doesn't currently work -// wxSize setsize = GetSize(); -// gtk_widget_set_size_request( m_widget, setsize.x, setsize.y ); } - SetBestSize(size); // need this too because this is a wxControlWithItems - + SetInitialSize(size); // need this too because this is a wxControlWithItems return true; }