Don't let the built-in scrollbars confuse things when setting focus to
a wxScrolledWindow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -68,18 +68,19 @@ bool wxControlContainer::AcceptsFocus() const
|
|||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
|
node = node->GetNext();
|
||||||
if ( child->AcceptsFocus() )
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ;
|
wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ;
|
||||||
if ( sb == NULL || !m_winParent->MacIsWindowScrollbar( sb ) )
|
if ( sb == NULL || !m_winParent->MacIsWindowScrollbar( sb ) )
|
||||||
hasRealChildren = true ;
|
hasRealChildren = true ;
|
||||||
|
if ( sb && m_winParent->MacIsWindowScrollbar( sb ) )
|
||||||
|
continue;
|
||||||
#endif
|
#endif
|
||||||
node = node->GetNext();
|
if ( child->AcceptsFocus() )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
@@ -637,7 +638,14 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
|
|||||||
while ( node )
|
while ( node )
|
||||||
{
|
{
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
|
node = node->GetNext();
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
wxScrollBar *sb = wxDynamicCast( child , wxScrollBar ) ;
|
||||||
|
if ( sb && child->GetParent()->MacIsWindowScrollbar( sb ) )
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() )
|
if ( child->AcceptsFocusFromKeyboard() && !child->IsTopLevel() )
|
||||||
{
|
{
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@@ -660,8 +668,6 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused)
|
|||||||
child->SetFocusFromKbd();
|
child->SetFocusFromKbd();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
node = node->GetNext();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user