- if ( event.GetKeyCode() == WXK_RETURN )
- {
- wxString value = GetValue();
- int selection = GetSelection();
-
- // note that gtk automatically selects an item if its in the list
- // so you don't have to call FindString
- if ((selection >= 0) && (GetString(selection) == value))
- {
- // make Enter generate "selected" event if it equals an item
- wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, GetId() );
- event.SetInt( selection );
- event.SetString( value );
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
- }
- else
- {
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId());
- event.SetString(value);
- event.SetInt(selection);
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
- }
- return;
- }
-
- event.Skip();
-}
-
-void wxComboBox::DisableEvents()
-{
- GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
- GList *child = list->children;
- while (child)
- {
- gtk_signal_disconnect_by_func( GTK_OBJECT(child->data),
- GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
-
- child = child->next;
- }
-}
-
-void wxComboBox::EnableEvents()
-{
- GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
- GList *child = list->children;
- while (child)
- {
- gtk_signal_connect( GTK_OBJECT(child->data), "select",
- GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
-
- child = child->next;
- }