diff --git a/include/wx/generic/treectlg.h b/include/wx/generic/treectlg.h index 4e3ad3bff9..c5010ecd03 100644 --- a/include/wx/generic/treectlg.h +++ b/include/wx/generic/treectlg.h @@ -211,6 +211,7 @@ public: void OnPaint( wxPaintEvent &event ); void OnSetFocus( wxFocusEvent &event ); void OnKillFocus( wxFocusEvent &event ); + void OnKeyDown( wxKeyEvent &event ); void OnChar( wxKeyEvent &event ); void OnMouse( wxMouseEvent &event ); void OnGetToolTip( wxTreeEvent &event ); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index c744c68ec1..cb13a8af3d 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -902,6 +902,7 @@ BEGIN_EVENT_TABLE(wxGenericTreeCtrl, wxTreeCtrlBase) EVT_PAINT (wxGenericTreeCtrl::OnPaint) EVT_SIZE (wxGenericTreeCtrl::OnSize) EVT_MOUSE_EVENTS (wxGenericTreeCtrl::OnMouse) + EVT_KEY_DOWN (wxGenericTreeCtrl::OnKeyDown) EVT_CHAR (wxGenericTreeCtrl::OnChar) EVT_SET_FOCUS (wxGenericTreeCtrl::OnSetFocus) EVT_KILL_FOCUS (wxGenericTreeCtrl::OnKillFocus) @@ -3021,16 +3022,19 @@ void wxGenericTreeCtrl::OnKillFocus( wxFocusEvent &event ) event.Skip(); } -void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) +void wxGenericTreeCtrl::OnKeyDown( wxKeyEvent &event ) { + // send a tree event wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, this); te.m_evtKey = event; if ( GetEventHandler()->ProcessEvent( te ) ) - { - // intercepted by the user code return; - } + event.Skip(); +} + +void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) +{ if ( (m_current == 0) || (m_key_current == 0) ) { event.Skip();