+ if (!win->IsEnabled())
+ return false;
+
+ wxKeyEvent keyEvent(wxEVT_KEY_DOWN);
+ wxTranslateKeyEvent(keyEvent, win, window, event);
+
+ // wxLogDebug( "OnKey from %s", win->GetName().c_str() );
+
+ // We didn't process wxEVT_KEY_DOWN, so send wxEVT_CHAR
+ if (win->HandleWindowEvent( keyEvent ))
+ return true;
+
+ keyEvent.SetEventType(wxEVT_CHAR);
+ // Do the translation again, retaining the ASCII
+ // code.
+ if (wxTranslateKeyEvent(keyEvent, win, window, event, true) &&
+ win->HandleWindowEvent( keyEvent ))
+ return true;
+
+ if ( (keyEvent.m_keyCode == WXK_TAB) &&
+ win->GetParent() && (win->GetParent()->HasFlag( wxTAB_TRAVERSAL)) )
+ {
+ wxNavigationKeyEvent new_event;
+ new_event.SetEventObject( win->GetParent() );
+ /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
+ new_event.SetDirection( (keyEvent.m_keyCode == WXK_TAB) );
+ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
+ new_event.SetWindowChange( keyEvent.ControlDown() );
+ new_event.SetCurrentFocus( win );
+ return win->GetParent()->HandleWindowEvent( new_event );
+ }
+
+ return false;
+ }
+ case KeyRelease:
+ {
+ if (!win->IsEnabled())
+ return false;
+
+ wxKeyEvent keyEvent(wxEVT_KEY_UP);
+ wxTranslateKeyEvent(keyEvent, win, window, event);
+
+ return win->HandleWindowEvent( keyEvent );
+ }
+ case ConfigureNotify:
+ {
+#if wxUSE_NANOX
+ if (event->update.utype == GR_UPDATE_SIZE)
+#endif
+ {
+ wxTopLevelWindow *tlw = wxDynamicCast(win, wxTopLevelWindow);
+ if ( tlw )
+ {
+ tlw->SetConfigureGeometry( XConfigureEventGetX(event), XConfigureEventGetY(event),
+ XConfigureEventGetWidth(event), XConfigureEventGetHeight(event) );
+ }
+
+ if ( tlw && tlw->IsShown() )
+ {
+ tlw->SetNeedResizeInIdle();
+ }
+ else
+ {
+ wxSizeEvent sizeEvent( wxSize(XConfigureEventGetWidth(event), XConfigureEventGetHeight(event)), win->GetId() );
+ sizeEvent.SetEventObject( win );
+
+ return win->HandleWindowEvent( sizeEvent );
+ }
+ }
+ return false;