wxWindow *m_winLastFocused;
private:
+ // Update the window status to reflect whether it is getting focus or not.
+ void UpdateParentCanFocus();
+
// Indicates whether the associated window can ever have focus itself.
//
// Usually this is the case, e.g. a wxPanel can be used either as a
// wxControlContainerBase
// ----------------------------------------------------------------------------
+void wxControlContainerBase::UpdateParentCanFocus()
+{
+ // In the ports where it does something non trivial, the parent window
+ // should only be focusable if it doesn't have any focusable children
+ // (e.g. native focus handling in wxGTK totally breaks down otherwise).
+ m_winParent->SetCanFocus(m_acceptsFocusSelf && !m_acceptsFocusChildren);
+}
+
bool wxControlContainerBase::UpdateCanFocusChildren()
{
const bool acceptsFocusChildren = HasAnyFocusableChildren();
{
m_acceptsFocusChildren = acceptsFocusChildren;
- // In the ports where it does something non trivial, the parent window
- // should only be focusable if it doesn't have any focusable children
- // (e.g. native focus handling in wxGTK totally breaks down otherwise).
- m_winParent->SetCanFocus(m_acceptsFocusSelf && !m_acceptsFocusChildren);
+ UpdateParentCanFocus();
}
return m_acceptsFocusChildren;