- // add the item to the list if it's not there yet
- if ( FindString(value) == wxNOT_FOUND )
- {
- Append(value);
- SetStringSelection(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
+ wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId());
+ event.SetString(value);
+ event.SetInt(selection);
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );