X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b02da6b18713d069cc9f4077f9b43df7a11bc7fb..b4d1ebf058c64f5b9e0ddf3264ce8a801eae4f79:/src/gtk/combobox.cpp diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index 3210098c67..3f8b535c07 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -18,8 +18,8 @@ #include "wx/settings.h" #include "wx/intl.h" -#include "gdk/gdk.h" -#include "gtk/gtk.h" +#include +#include //----------------------------------------------------------------------------- // idle system @@ -101,7 +101,15 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, m_needParent = TRUE; m_acceptsFocus = TRUE; - if (!PreCreation( parent, pos, size ) || + wxSize newSize( size ); + if (newSize.x == -1) + newSize.x = 80; + if (newSize.y == -1) + newSize.y = 26; + if (newSize.y > 30) + newSize.y = 30; + + if (!PreCreation( parent, pos, newSize ) || !CreateBase( parent, id, pos, size, style, validator, name )) { wxFAIL_MSG( wxT("wxComboBox creation failed") ); @@ -113,13 +121,6 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, // make it more useable gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE); - wxSize newSize = size; - if (newSize.x == -1) - newSize.x = 100; - if (newSize.y == -1) - newSize.y = 26; - SetSize( newSize.x, newSize.y ); - GtkWidget *list = GTK_COMBO(m_widget)->list; for (int i = 0; i < n; i++) @@ -660,4 +661,9 @@ bool wxComboBox::IsOwnGtkWindow( GdkWindow *window ) (window == GTK_COMBO(m_widget)->button->window ) ); } +wxSize wxComboBox::DoGetBestSize() const +{ + return wxSize(100, 26); +} + #endif