X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4ee1741f75d443ac816cd90d5d0941d33fdd0698..236a9de39afa090fdee3cf91cb5364ceca69e3f8:/src/generic/panelg.cpp diff --git a/src/generic/panelg.cpp b/src/generic/panelg.cpp index 4c58bd15a1..2a91143d97 100644 --- a/src/generic/panelg.cpp +++ b/src/generic/panelg.cpp @@ -121,11 +121,11 @@ void wxPanel::OnSize(wxSizeEvent& WXUNUSED(event)) void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) { - // the event is propagated downwards if the event emitter was our parent - bool goingDown = event.GetEventObject() == GetParent(); + const wxWindowList& children = GetChildren(); - // we're not interested in "notebook page change" events here - if ( event.IsWindowChange() ) + // there is not much to do if we don't have children and we're not + // interested in "notebook page change" events here + if ( !children.GetCount() || event.IsWindowChange() ) { wxWindow *parent = GetParent(); if ( !parent || !parent->GetEventHandler()->ProcessEvent(event) ) @@ -143,7 +143,8 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) // next acceptable child wxWindowList::Node *node, *start_node; - const wxWindowList& children = GetChildren(); + // the event is propagated downwards if the event emitter was our parent + bool goingDown = event.GetEventObject() == GetParent(); // we should start from the first/last control and not from the one which // had focus the last time if we're propagating the event downwards because @@ -273,6 +274,7 @@ void wxPanel::OnNavigationKey( wxNavigationKeyEvent& event ) } //else: the child manages its focus itself + event.Skip( FALSE ); return; }