projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Error and warning corrections
[wxWidgets.git]
/
src
/
generic
/
treectlg.cpp
diff --git
a/src/generic/treectlg.cpp
b/src/generic/treectlg.cpp
index cebbbae8727500dea69c7db93ad85bed91b4fe3b..800e58ad60f36bbc2f928a4de5a7d4c03efcdb43 100644
(file)
--- a/
src/generic/treectlg.cpp
+++ b/
src/generic/treectlg.cpp
@@
-49,7
+49,7
@@
// array types
// -----------------------------------------------------------------------------
// array types
// -----------------------------------------------------------------------------
-class WXDLL
EXPORT
wxGenericTreeItem;
+class WXDLL
IMPEXP_FWD_CORE
wxGenericTreeItem;
WX_DEFINE_EXPORTED_ARRAY_PTR(wxGenericTreeItem *, wxArrayGenericTreeItems);
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
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:
// fall through
case WXK_DOWN:
@@
-2775,6
+2779,9
@@
void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
{
wxTreeItemIdValue cookie;
wxTreeItemId child = GetFirstChild( m_key_current, cookie );
{
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;
}
DoSelectItem( child, unselect_others, extended_select );
m_key_current=(wxGenericTreeItem*) child.m_pItem;
}