- wxString value = GetValue();
-
- if ( m_cb->GetCount() == 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, m_cb->GetId() );
- event.SetInt( 0 );
- event.SetString( value );
- event.SetEventObject( m_cb );
- m_cb->GetEventHandler()->ProcessEvent( event );
- }
- else
- {
- // add the item to the list if it's not there yet
- if ( m_cb->FindString(value) == wxNOT_FOUND )
- {
- m_cb->Append(value);
- m_cb->SetStringSelection(value);
-
- // and generate the selected event for it
- wxCommandEvent event( wxEVT_COMMAND_COMBOBOX_SELECTED, m_cb->GetId() );
- event.SetInt( m_cb->GetCount() - 1 );
- event.SetString( value );
- event.SetEventObject( m_cb );
- m_cb->GetEventHandler()->ProcessEvent( event );
- }
+ wxNavigationKeyEvent NavEvent;
+ NavEvent.SetEventObject(this);
+ NavEvent.SetDirection(true);
+ NavEvent.SetWindowChange(false);
+
+ // Get the parent of the combo and have it process the navigation?
+ if (m_cb->GetParent()->GetEventHandler()->ProcessEvent(NavEvent))
+ return;
+ }