m_needParent = TRUE;
m_acceptsFocus = TRUE;
- if (!PreCreation( parent, pos, size ) ||
+ wxSize newSize = size,
+ bestSize = DoGetBestSize();
+
+ if (newSize.x == -1)
+ newSize.x = bestSize.x;
+ if (newSize.y == -1)
+ newSize.y = bestSize.y;
+ 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") );
- return FALSE;
+ return FALSE;
}
m_widget = gtk_combo_new();
// make it more useable
gtk_combo_set_use_arrows_always(GTK_COMBO(m_widget), TRUE);
- SetSizeOrDefault( size );
-
GtkWidget *list = GTK_COMBO(m_widget)->list;
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() );
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 );
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 );
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 );
wxSize wxComboBox::DoGetBestSize() const
{
+ // totally bogus - should measure the strings in the combo!
return wxSize(100, 26);
}