+void wxTextCtrl::OnChar(wxKeyEvent& event)
+{
+ switch( event.KeyCode() )
+ {
+ case WXK_RETURN:
+ {
+ if ( !(m_windowStyle & wxTE_MULTILINE) )
+ {
+ wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
+ event.SetEventObject( this );
+ if ( GetEventHandler()->ProcessEvent(event) )
+ return;
+ }
+ //else: multiline controls need Enter for themselves
+
+ break;
+ }
+ case WXK_TAB:
+ // always produce navigation event - even if we process TAB
+ // ourselves the fact that we got here means that the user code
+ // decided to skip processing of this TAB - probably to let it
+ // do its default job.
+ //
+ // NB: Notice that Ctrl-Tab is handled elsewhere and Alt-Tab is
+ // handled by Windows
+ {
+ wxNavigationKeyEvent eventNav;
+ eventNav.SetDirection(!event.ShiftDown());
+ eventNav.SetWindowChange(FALSE);
+ eventNav.SetEventObject(this);
+
+ if ( GetEventHandler()->ProcessEvent(eventNav) )
+ return;
+ }
+ break;
+
+ default:
+ event.Skip();
+ return;
+ }
+
+ // don't just call event.Skip() because this will cause TABs and ENTERs
+ // be passed upwards and we don't always want this - instead process it
+ // right here
+
+ // FIXME
+ event.Skip();
+}