after analisys the behaviour of treectrl in GTK and Qt, right arrow should not move down. Expand the current item will be fine

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-23 17:41:15 +00:00
parent f83756c2e5
commit 9d7a7ec556
2 changed files with 3 additions and 5 deletions

View File

@@ -3243,14 +3243,12 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
break; break;
case WXK_RIGHT: case WXK_RIGHT:
// this works the same as the down arrow except that we // right arrow just expand the item will be fine
// also expand the item if it wasn't expanded yet
if (m_current != GetRootItem().m_pItem || !HasFlag(wxTR_HIDE_ROOT)) if (m_current != GetRootItem().m_pItem || !HasFlag(wxTR_HIDE_ROOT))
Expand(m_current); Expand(m_current);
//else: don't try to expand hidden root item (which can be the //else: don't try to expand hidden root item (which can be the
// current one when the tree is empty) // current one when the tree is empty)
break;
wxFALLTHROUGH;
case WXK_DOWN: case WXK_DOWN:
{ {

View File

@@ -587,7 +587,7 @@ void TreeCtrlTestCase::KeyNavigation()
CPPUNIT_ASSERT(m_tree->IsExpanded(m_root)); CPPUNIT_ASSERT(m_tree->IsExpanded(m_root));
sim.Char(WXK_LEFT); sim.Char('-');
wxYield(); wxYield();
CPPUNIT_ASSERT(!m_tree->IsExpanded(m_root)); CPPUNIT_ASSERT(!m_tree->IsExpanded(m_root));