added wxWindow::HandleAsNavigationKey() helper for handling (not only) TAB key in custom controls

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51741 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2008-02-12 20:13:22 +00:00
parent 99404ab05f
commit f029f1d15b
7 changed files with 55 additions and 44 deletions

View File

@@ -3395,16 +3395,8 @@ void wxDataViewMainWindow::DestroyTree()
void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
{
if (event.GetKeyCode() == WXK_TAB)
{
wxNavigationKeyEvent nevent;
nevent.SetWindowChange( event.ControlDown() );
nevent.SetDirection( !event.ShiftDown() );
nevent.SetEventObject( GetParent()->GetParent() );
nevent.SetCurrentFocus( m_parent );
if (GetParent()->GetParent()->GetEventHandler()->ProcessEvent( nevent ))
return;
}
if ( HandleAsNavigationKey(event) )
return;
// no item -> nothing to do
if (!HasCurrentRow())