X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/afd7bf26f1cf319020fc789f3afcdcb98c9b549b..655c20fcd5a554a986b93651d8b0bec2afde8573:/src/common/containr.cpp diff --git a/src/common/containr.cpp b/src/common/containr.cpp index 42aa660a50..3333232ec5 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -71,11 +71,9 @@ bool wxControlContainer::AcceptsFocus() const node = node->GetNext(); #ifdef __WXMAC__ - wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ; - if ( sb == NULL || !m_winParent->MacIsWindowScrollbar( sb ) ) - hasRealChildren = true ; - if ( sb && m_winParent->MacIsWindowScrollbar( sb ) ) + if ( m_winParent->MacIsWindowScrollbar( child ) ) continue; + hasRealChildren = true ; #endif if ( child->AcceptsFocus() ) { @@ -309,8 +307,15 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event ) } } - if ( bookctrl && bookctrl->GetEventHandler()->ProcessEvent(event) ) - return; + if ( bookctrl ) + { + // make sure that we don't bubble up the event again from the book + // control resulting in infinite recursion + wxNavigationKeyEvent eventCopy(event); + eventCopy.SetEventObject(m_winParent); + if ( bookctrl->GetEventHandler()->ProcessEvent(eventCopy) ) + return; + } } // there is not much to do if we don't have children and we're not @@ -641,8 +646,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) node = node->GetNext(); #ifdef __WXMAC__ - wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ; - if ( sb && child->GetParent()->MacIsWindowScrollbar( sb ) ) + if ( child->GetParent()->MacIsWindowScrollbar( child ) ) continue; #endif