X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d984207cc37ad70649b2392314fb9e42719506c3..b919f007af55c6bcba975ead6177c80a317e1a4a:/src/gtk1/combobox.cpp diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index 3f8b535c07..0571f48fe4 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -101,19 +101,21 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, m_needParent = TRUE; m_acceptsFocus = TRUE; - wxSize newSize( size ); + wxSize newSize = size, + bestSize = DoGetBestSize(); + if (newSize.x == -1) - newSize.x = 80; + newSize.x = bestSize.x; if (newSize.y == -1) - newSize.y = 26; - if (newSize.y > 30) - newSize.y = 30; - + newSize.y = bestSize.y; + if (newSize.y > 22) + newSize.y = 22; + if (!PreCreation( parent, pos, newSize ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxComboBox creation failed") ); - return FALSE; + return FALSE; } m_widget = gtk_combo_new(); @@ -126,7 +128,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, for (int i = 0; i < n; i++) { /* don't send first event, which GTK sends aways when - inserting the first item */ + inserting the first item */ m_alreadySent = TRUE; GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() ); @@ -461,7 +463,7 @@ void wxComboBox::Copy() wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; -#if (GTK_MINOR_VERSION > 0) +#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0) gtk_editable_copy_clipboard( GTK_EDITABLE(entry) ); #else gtk_editable_copy_clipboard( GTK_EDITABLE(entry), 0 ); @@ -473,7 +475,7 @@ void wxComboBox::Cut() wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; -#if (GTK_MINOR_VERSION > 0) +#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0) gtk_editable_cut_clipboard( GTK_EDITABLE(entry) ); #else gtk_editable_cut_clipboard( GTK_EDITABLE(entry), 0 ); @@ -485,7 +487,7 @@ void wxComboBox::Paste() wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; -#if (GTK_MINOR_VERSION > 0) +#if defined(__WXGTK13__) || (GTK_MINOR_VERSION > 0) gtk_editable_paste_clipboard( GTK_EDITABLE(entry) ); #else gtk_editable_paste_clipboard( GTK_EDITABLE(entry), 0 ); @@ -663,7 +665,8 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window ) wxSize wxComboBox::DoGetBestSize() const { - return wxSize(100, 26); + // totally bogus - should measure the strings in the combo! + return wxSize(100, 22); } #endif