From 9d7a7ec5560a4f770cb4288abdaf28ce768ed15f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 23 Sep 2014 17:41:15 +0000 Subject: [PATCH] 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 --- src/generic/treectlg.cpp | 6 ++---- tests/controls/treectrltest.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 4e8f7685f8..d0cd188fa1 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -3243,14 +3243,12 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event ) break; case WXK_RIGHT: - // this works the same as the down arrow except that we - // also expand the item if it wasn't expanded yet + // right arrow just expand the item will be fine 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) - - wxFALLTHROUGH; + break; case WXK_DOWN: { diff --git a/tests/controls/treectrltest.cpp b/tests/controls/treectrltest.cpp index 6752af7d2f..d383016045 100644 --- a/tests/controls/treectrltest.cpp +++ b/tests/controls/treectrltest.cpp @@ -587,7 +587,7 @@ void TreeCtrlTestCase::KeyNavigation() CPPUNIT_ASSERT(m_tree->IsExpanded(m_root)); - sim.Char(WXK_LEFT); + sim.Char('-'); wxYield(); CPPUNIT_ASSERT(!m_tree->IsExpanded(m_root));