git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1755
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- while (IsExpanded(prev))
+ while ( IsExpanded(prev) && HasChildren(prev) )
- int c = (int)GetChildrenCount( prev, FALSE );
- long cockie = 0;
- prev = GetFirstChild( prev, cockie );
- for (int i = 0; i < c-1; i++)
- prev = GetNextSibling( prev );
+ wxTreeItemId child = GetLastChild(prev);
+ if ( child )
+ {
+ prev = child;
+ }
SelectItem( prev );
EnsureVisible( prev );
}
SelectItem( prev );
EnsureVisible( prev );
}
- if (IsExpanded(m_current))
+ if (IsExpanded(m_current) && HasChildren(m_current))
{
long cookie = 0;
wxTreeItemId child = GetFirstChild( m_current, cookie );
{
long cookie = 0;
wxTreeItemId child = GetFirstChild( m_current, cookie );