lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [5756] Apply various post-release patches


From: Greg Chicares
Subject: [lmi-commits] [5756] Apply various post-release patches
Date: Tue, 23 Jul 2013 22:41:31 +0000

Revision: 5756
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5756
Author:   chicares
Date:     2013-07-23 22:41:30 +0000 (Tue, 23 Jul 2013)
Log Message:
-----------
Apply various post-release patches

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/wx-2.9.5.patch

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2013-07-21 23:52:12 UTC (rev 5755)
+++ lmi/trunk/ChangeLog 2013-07-23 22:41:30 UTC (rev 5756)
@@ -32494,3 +32494,13 @@
 Recurse through children--e.g., group boxes. See:
   http://lists.nongnu.org/archive/html/lmi/2013-07/msg00038.html
 
+20130723T2241Z <address@hidden> [542]
+
+  wx-2.9.5.patch
+Apply various post-release patches:
+  http://trac.wxwidgets.org/changeset/74582
+  http://trac.wxwidgets.org/changeset/74583
+  http://trac.wxwidgets.org/changeset/74585
+  http://trac.wxwidgets.org/changeset/74586
+  http://trac.wxwidgets.org/changeset/74588
+

Modified: lmi/trunk/wx-2.9.5.patch
===================================================================
--- lmi/trunk/wx-2.9.5.patch    2013-07-21 23:52:12 UTC (rev 5755)
+++ lmi/trunk/wx-2.9.5.patch    2013-07-23 22:41:30 UTC (rev 5756)
@@ -1,3 +1,57 @@
+diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/include/wx/containr.h 
modified/wxWidgets-2.9.5/include/wx/containr.h
+--- original/wxWidgets-2.9.5/include/wx/containr.h     2013-07-16 
15:47:14.000000000 +0000
++++ modified/wxWidgets-2.9.5/include/wx/containr.h     2013-07-23 
16:49:32.671549600 +0000
+@@ -62,18 +62,26 @@
+ 
+     // This can be called by the window to indicate that it never wants to 
have
+     // the focus for itself.
+-    void DisableSelfFocus() { m_acceptsFocusSelf = false; }
++    void DisableSelfFocus()
++        { m_acceptsFocusSelf = false; UpdateParentCanFocus(); }
++
++    // This can be called to undo the effect of a previous DisableSelfFocus()
++    // (otherwise calling it is not necessary as the window does accept focus
++    // by default).
++    void EnableSelfFocus()
++        { m_acceptsFocusSelf = true; UpdateParentCanFocus(); }
+ 
+     // should be called from SetFocus(), returns false if we did nothing with
+     // the focus and the default processing should take place
+     bool DoSetFocus();
+ 
+     // returns whether we should accept focus ourselves or not
+-    bool AcceptsFocus() const { return m_acceptsFocusSelf; }
++    bool AcceptsFocus() const;
+ 
+     // Returns whether we or one of our children accepts focus.
+     bool AcceptsFocusRecursively() const
+-        { return m_acceptsFocusSelf || m_acceptsFocusChildren; }
++        { return AcceptsFocus() ||
++            (m_acceptsFocusChildren && HasAnyChildrenAcceptingFocus()); }
+ 
+     // We accept focus from keyboard if we accept it at all.
+     bool AcceptsFocusFromKeyboard() const { return AcceptsFocusRecursively(); 
}
+@@ -90,6 +98,10 @@
+     // return true if we have any children accepting focus
+     bool HasAnyFocusableChildren() const;
+ 
++    // return true if we have any children that do accept focus right now
++    bool HasAnyChildrenAcceptingFocus() const;
++
++
+     // the parent window we manage the children for
+     wxWindow *m_winParent;
+ 
+@@ -97,6 +109,9 @@
+     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
 diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/include/wx/cpp.h 
modified/wxWidgets-2.9.5/include/wx/cpp.h
 --- original/wxWidgets-2.9.5/include/wx/cpp.h  2013-07-16 15:47:14.000000000 
+0000
 +++ modified/wxWidgets-2.9.5/include/wx/cpp.h  2013-07-20 00:40:10.000000000 
+0000
@@ -15,3 +69,159 @@
  /*
     wxCALL_FOR_EACH(what, ...) calls the macro from its first argument, 
what(pos, x),
     for every remaining argument 'x', with 'pos' being its 1-based index in
+diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/include/wx/msw/radiobox.h 
modified/wxWidgets-2.9.5/include/wx/msw/radiobox.h
+--- original/wxWidgets-2.9.5/include/wx/msw/radiobox.h 2013-07-16 
15:47:14.000000000 +0000
++++ modified/wxWidgets-2.9.5/include/wx/msw/radiobox.h 2013-07-23 
14:13:07.545848100 +0000
+@@ -97,6 +97,7 @@
+     // override some base class methods
+     virtual bool Show(bool show = true);
+     virtual bool Enable(bool enable = true);
++    virtual bool CanBeFocused() const;
+     virtual void SetFocus();
+     virtual bool SetFont(const wxFont& font);
+     virtual bool ContainsHWND(WXHWND hWnd) const;
+@@ -113,10 +114,6 @@
+ 
+     virtual bool Reparent(wxWindowBase *newParent);
+ 
+-    // we inherit a version always returning false from wxStaticBox, override
+-    // it to behave normally
+-    virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); }
+-
+     // returns true if the platform should explicitly apply a theme border
+     virtual bool CanApplyThemeBorder() const { return false; }
+ 
+diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/include/wx/window.h 
modified/wxWidgets-2.9.5/include/wx/window.h
+--- original/wxWidgets-2.9.5/include/wx/window.h       2013-07-16 
15:47:14.000000000 +0000
++++ modified/wxWidgets-2.9.5/include/wx/window.h       2013-07-23 
14:13:54.202993900 +0000
+@@ -724,8 +724,13 @@
+     virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); }
+ 
+ 
+-        // this is mostly a helper for the various functions using it below
+-    bool CanBeFocused() const { return IsShown() && IsEnabled(); }
++        // Can this window be focused right now, in its current state? This
++        // shouldn't be called at all if AcceptsFocus() returns false.
++        //
++        // It is a convenient helper for the various functions using it below
++        // but also a hook allowing to override the default logic for some 
rare
++        // cases (currently just wxRadioBox in wxMSW) when it's inappropriate.
++    virtual bool CanBeFocused() const { return IsShown() && IsEnabled(); }
+ 
+         // can this window itself have focus?
+     bool IsFocusable() const { return AcceptsFocus() && CanBeFocused(); }
+diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/src/common/containr.cpp 
modified/wxWidgets-2.9.5/src/common/containr.cpp
+--- original/wxWidgets-2.9.5/src/common/containr.cpp   2013-07-16 
15:47:14.000000000 +0000
++++ modified/wxWidgets-2.9.5/src/common/containr.cpp   2013-07-23 
16:49:41.312395800 +0000
+@@ -47,6 +47,14 @@
+ // 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();
+@@ -54,10 +62,7 @@
+     {
+         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;
+@@ -76,6 +81,30 @@
+         if ( !m_winParent->IsClientAreaChild(child) )
+             continue;
+ 
++        // Here we check whether the child can accept the focus at all, as we
++        // want to try focusing it later even if it can't accept it right now.
++        if ( child->AcceptsFocusRecursively() )
++            return true;
++    }
++
++    return false;
++}
++
++bool wxControlContainerBase::HasAnyChildrenAcceptingFocus() const
++{
++    const wxWindowList& children = m_winParent->GetChildren();
++    for ( wxWindowList::const_iterator i = children.begin(),
++                                     end = children.end();
++          i != end;
++          ++i )
++    {
++        const wxWindow * const child = *i;
++
++        if ( !m_winParent->IsClientAreaChild(child) )
++            continue;
++
++        // Here we check if the child accepts focus right now as we need to
++        // know if we can give the focus to it or not.
+         if ( child->CanAcceptFocus() )
+             return true;
+     }
+@@ -124,6 +153,11 @@
+     return ret;
+ }
+ 
++bool wxControlContainerBase::AcceptsFocus() const
++{
++    return m_acceptsFocusSelf && m_winParent->CanBeFocused();
++}
++
+ bool wxControlContainerBase::SetFocusToChild()
+ {
+     return wxSetFocusToChild(m_winParent, &m_winLastFocused);
+diff -x 'xml*' --recursive '--unified=3' 
original/wxWidgets-2.9.5/src/msw/radiobox.cpp 
modified/wxWidgets-2.9.5/src/msw/radiobox.cpp
+--- original/wxWidgets-2.9.5/src/msw/radiobox.cpp      2013-07-16 
15:47:14.000000000 +0000
++++ modified/wxWidgets-2.9.5/src/msw/radiobox.cpp      2013-07-23 
14:14:18.609712500 +0000
+@@ -256,6 +256,12 @@
+     const wxSize actualSize = GetSize();
+     PositionAllButtons(pos.x, pos.y, actualSize.x, actualSize.y);
+ 
++    // The base wxStaticBox class never accepts focus, but we do because 
giving
++    // focus to a wxRadioBox actually gives it to one of its buttons, which 
are
++    // not visible at wx level and hence are not taken into account by the
++    // logic in wxControlContainer code.
++    m_container.EnableSelfFocus();
++
+     return true;
+ }
+ 
+@@ -438,6 +444,25 @@
+     }
+ }
+ 
++bool wxRadioBox::CanBeFocused() const
++{
++    // If the control itself is hidden or disabled, no need to check anything
++    // else.
++    if ( !wxStaticBox::CanBeFocused() )
++        return false;
++
++    // Otherwise, check if we have any buttons that can be focused.
++    for ( size_t item = 0; item < m_radioButtons->GetCount(); item++ )
++    {
++        if ( IsItemEnabled(item) && IsItemShown(item) )
++            return true;
++    }
++
++    // We didn't find any items that can accept focus, so neither can we as a
++    // whole accept it.
++    return false;
++}
++
+ // Enable a specific button
+ bool wxRadioBox::Enable(unsigned int item, bool enable)
+ {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]