]> git.saurik.com Git - wxWidgets.git/commitdiff
It is possible for a scrolled window to get focus events from children other than
authorRobin Dunn <robin@alldunn.com>
Fri, 28 Dec 2007 18:01:13 +0000 (18:01 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 28 Dec 2007 18:01:13 +0000 (18:01 +0000)
the target window's children (the wxGrid label windows for example) so don't
trigger an assert about it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50936 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/scrlwing.cpp

index 9b694525337bbf79453f1b6832a09114a0b03bf8..0476ed31dc9ffb71acaabda2c9dba6234467ef13 100644 (file)
@@ -1342,7 +1342,8 @@ void wxScrollHelper::HandleOnChildFocus(wxChildFocusEvent& event)
     while ( win->GetParent() != m_targetWindow )
     {
         win = win->GetParent();
-        wxCHECK_RET( win, "incorrectly sent wxChildFocusEvent - not our child" );
+        if ( !win )
+            return; // event is not from a child of the target window
     }
 
     // if the child is not fully visible, try to scroll it into view: