git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38239
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- bool forward = event.GetDirection();
+ const bool forward = event.GetDirection();
// the node of the children list from which we should start looking for the
// next acceptable child
// the node of the children list from which we should start looking for the
// next acceptable child
// start from first or last depending on where we're going
node = forward ? children.GetFirst() : children.GetLast();
// start from first or last depending on where we're going
node = forward ? children.GetFirst() : children.GetLast();
-
- // we want to cycle over all nodes
- start_node = wxWindowList::compatibility_iterator();
{
// try to find the child which has the focus currently
{
// try to find the child which has the focus currently
// ok, we found the focus - now is it our child?
start_node = children.Find( winFocus );
}
// ok, we found the focus - now is it our child?
start_node = children.Find( winFocus );
}
- else
- {
- start_node = wxWindowList::compatibility_iterator();
- }
if ( !start_node && m_winLastFocused )
{
if ( !start_node && m_winLastFocused )
{
}
// we want to cycle over all elements passing by NULL
}
// we want to cycle over all elements passing by NULL
- while ( node != start_node )
+ // don't go into infinite loop
+ if ( start_node && node == start_node )
+ break;
+
// Have we come to the last or first item on the panel?
if ( !node )
{
if ( !goingDown )
{
// Have we come to the last or first item on the panel?
if ( !node )
{
if ( !goingDown )
{
- // Check if our (may be grand) parent is another panel: if this
+ // Check if our (maybe grand) parent is another panel: if this
// is the case, they will know what to do with this navigation
// key and so give them the chance to process it instead of
// looping inside this panel (normally, the focus will go to
// is the case, they will know what to do with this navigation
// key and so give them the chance to process it instead of
// looping inside this panel (normally, the focus will go to