revert r51647 change as it broke the code overriding AcceptsFocusFromKeyboard() to prevent the user from tabbing into a window; simply override it at wxControlContainer too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52032 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -70,6 +70,11 @@ public:
|
|||||||
// wxListCtrl) and so should get focus for ourselves
|
// wxListCtrl) and so should get focus for ourselves
|
||||||
bool AcceptsFocusRecursively() const { return true; }
|
bool AcceptsFocusRecursively() const { return true; }
|
||||||
|
|
||||||
|
// this is used to determine whether we can accept focus when Tab or
|
||||||
|
// another navigation key is pressed -- we alsways can, for the same reason
|
||||||
|
// as mentioned above for AcceptsFocusRecursively()
|
||||||
|
bool AcceptsFocusFromKeyboard() const { return true; }
|
||||||
|
|
||||||
// Call this when the number of children of the window changes.
|
// Call this when the number of children of the window changes.
|
||||||
// If we have any children, this panel (used just as container for
|
// If we have any children, this panel (used just as container for
|
||||||
// them) shouldn't get focus for itself.
|
// them) shouldn't get focus for itself.
|
||||||
@@ -103,6 +108,7 @@ private:
|
|||||||
public: \
|
public: \
|
||||||
virtual bool AcceptsFocus() const; \
|
virtual bool AcceptsFocus() const; \
|
||||||
virtual bool AcceptsFocusRecursively() const; \
|
virtual bool AcceptsFocusRecursively() const; \
|
||||||
|
virtual bool AcceptsFocusFromKeyboard() const; \
|
||||||
virtual void AddChild(wxWindowBase *child); \
|
virtual void AddChild(wxWindowBase *child); \
|
||||||
virtual void RemoveChild(wxWindowBase *child); \
|
virtual void RemoveChild(wxWindowBase *child); \
|
||||||
virtual void SetFocus(); \
|
virtual void SetFocus(); \
|
||||||
@@ -143,9 +149,13 @@ protected: \
|
|||||||
bool classname::AcceptsFocus() const \
|
bool classname::AcceptsFocus() const \
|
||||||
{ \
|
{ \
|
||||||
return m_container.AcceptsFocus(); \
|
return m_container.AcceptsFocus(); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
bool classname::AcceptsFocusFromKeyboard() const \
|
||||||
|
{ \
|
||||||
|
return m_container.AcceptsFocusFromKeyboard(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef wxHAS_NATIVE_TAB_TRAVERSAL
|
#ifdef wxHAS_NATIVE_TAB_TRAVERSAL
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
|
|||||||
}
|
}
|
||||||
#endif // __WXMSW__
|
#endif // __WXMSW__
|
||||||
|
|
||||||
if ( child->CanAcceptFocus() )
|
if ( child->CanAcceptFocusFromKeyboard() )
|
||||||
{
|
{
|
||||||
// if we're setting the focus to a child panel we should prevent it
|
// if we're setting the focus to a child panel we should prevent it
|
||||||
// from giving it to the child which had the focus the last time
|
// from giving it to the child which had the focus the last time
|
||||||
|
|||||||
Reference in New Issue
Block a user