X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1043456035b60331b7faed24e69f81e94bd2cf85..4e15d1caa03346c126015019c1fdf093033ef40b:/src/gtk/combobox.cpp diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 35a5e0fec8..ae69a86b37 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -33,8 +33,6 @@ extern "C" { static void gtkcombobox_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo ) { - if (!combo->m_hasVMT) return; - wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() ); event.SetString( combo->GetValue() ); event.SetEventObject( combo ); @@ -87,6 +85,12 @@ BEGIN_EVENT_TABLE(wxComboBox, wxChoice) EVT_UPDATE_UI(wxID_SELECTALL, wxComboBox::OnUpdateSelectAll) END_EVENT_TABLE() +wxComboBox::~wxComboBox() +{ + if (m_entry) + GTKDisconnect(m_entry); +} + void wxComboBox::Init() { m_entry = NULL; @@ -183,8 +187,6 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, G_CALLBACK (gtkcombobox_popupshown_callback), this); } - SetInitialSize(size); // need this too because this is a wxControlWithItems - return true; } @@ -402,4 +404,17 @@ void wxComboBox::Dismiss() { gtk_combo_box_popdown( GTK_COMBO_BOX(m_widget) ); } + +wxSize wxComboBox::DoGetSizeFromTextSize(int xlen, int ylen) const +{ + wxSize tsize( wxChoice::DoGetSizeFromTextSize(xlen, ylen) ); + + // Add the margins we have previously set, but only the horizontal border + // as vertical one has been taken account in the prevoius call. + // Also get other GTK+ margins. + tsize.IncBy( GTKGetEntryMargins(GetEntry()).x, 0); + + return tsize; +} + #endif // wxUSE_COMBOBOX