X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/02e817a239578c4878150d0b70542e57eb9614ef..72ee73c1968745451f136f3d88d954aee86c4b38:/src/generic/treectlg.cpp diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index cebbbae872..800e58ad60 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -49,7 +49,7 @@ // array types // ----------------------------------------------------------------------------- -class WXDLLEXPORT wxGenericTreeItem; +class WXDLLIMPEXP_FWD_CORE wxGenericTreeItem; WX_DEFINE_EXPORTED_ARRAY_PTR(wxGenericTreeItem *, wxArrayGenericTreeItems); @@ -2766,7 +2766,11 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) case WXK_RIGHT: // this works the same as the down arrow except that we // also expand the item if it wasn't expanded yet - Expand(m_current); + if (m_current != GetRootItem().m_pItem || !HasFlag(wxTR_HIDE_ROOT)) + Expand(m_current); + //else: don't try to expand hidden root item (which can be the + // current one when the tree is empty) + // fall through case WXK_DOWN: @@ -2775,6 +2779,9 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) { wxTreeItemIdValue cookie; wxTreeItemId child = GetFirstChild( m_key_current, cookie ); + if ( !child ) + break; + DoSelectItem( child, unselect_others, extended_select ); m_key_current=(wxGenericTreeItem*) child.m_pItem; }