+void wxComboBox::OnChar( wxKeyEvent &event )
+{
+ if ( event.KeyCode() == WXK_RETURN )
+ {
+ wxString value = GetValue();
+
+ if ( Number() == 0 )
+ {
+ // make Enter generate "selected" event if there is only one item
+ // in the combobox - without it, it's impossible to select it at
+ // all!
+ wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, GetId() );
+ event.SetInt( 0 );
+ event.SetString( value );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+ }
+ else
+ {
+ // add the item to the list if it's not there yet
+ if ( FindString(value) == wxNOT_FOUND )
+ {
+ Append(value);
+
+ // and generate the selected event for it
+ wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, GetId() );
+ event.SetInt( Number() - 1 );
+ event.SetString( value );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+ }
+ //else: do nothing, this will open the listbox
+ }
+ }
+
+ event.Skip();
+}
+
+void wxComboBox::OnSize( wxSizeEvent &event )
+{
+ event.Skip();
+
+ return;
+
+ int w = 21;
+ gtk_widget_set_usize( GTK_COMBO(m_widget)->entry, m_width-w-1, m_height );
+
+ gtk_widget_set_uposition( GTK_COMBO(m_widget)->button, m_x+m_width-w, m_y );
+ gtk_widget_set_usize( GTK_COMBO(m_widget)->button, w, m_height );
+}
+
+void wxComboBox::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+
+// gtk_widget_set_style( GTK_COMBO(m_widget)->button, m_widgetStyle );
+ gtk_widget_set_style( GTK_COMBO(m_widget)->entry, m_widgetStyle );
+ gtk_widget_set_style( GTK_COMBO(m_widget)->list, m_widgetStyle );
+
+ GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
+ GList *child = list->children;
+ while (child)
+ {
+ gtk_widget_set_style( GTK_WIDGET(child->data), m_widgetStyle );
+
+ GtkBin *bin = GTK_BIN(child->data);
+ gtk_widget_set_style( bin->child, m_widgetStyle );
+
+ child = child->next;
+ }
+}
+
+GtkWidget* wxComboBox::GetConnectWidget()
+{
+ return GTK_COMBO(m_widget)->entry;
+}
+
+bool wxComboBox::IsOwnGtkWindow( GdkWindow *window )
+{
+ return ( (window == GTK_ENTRY( GTK_COMBO(m_widget)->entry )->text_area) ||
+ (window == GTK_COMBO(m_widget)->button->window ) );
+}
+
+#endif