]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectrl.cpp
I've put live into Vadim's wxNavigationKeyEvent idea
[wxWidgets.git] / src / generic / treectrl.cpp
index 480eb4c13f13535ee5ece6f25f0f8a81505c4980..04d3717ec3cf45e27c80eb53b366553f456b07bc 100644 (file)
@@ -1112,6 +1112,11 @@ void wxTreeCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
 
 void wxTreeCtrl::OnChar( wxKeyEvent &event )
 {
+  wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
+  te.m_code = event.KeyCode();
+  te.SetEventObject( this );
+  GetEventHandler()->ProcessEvent( te );
+
   if (m_current == 0)
   {
      event.Skip();
@@ -1144,7 +1149,7 @@ void wxTreeCtrl::OnChar( wxKeyEvent &event )
     case ' ':
     case WXK_RETURN:
       {
-        wxTreeEvent event( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
+        wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
         event.m_item = m_current;
         event.m_code = 0;
         event.SetEventObject( this );
@@ -1236,7 +1241,7 @@ void wxTreeCtrl::OnMouse( wxMouseEvent &event )
 
   if ( event.LeftDClick() )
   {
-    wxTreeEvent event( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
+    wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
     event.m_item = item;
     event.m_code = 0;
     event.SetEventObject( this );