Fixed browsing order with arrow keys in component chooser on Windows

As Windows displays the component list in inverted order, the direction
of scrolling had to be reversed as well.
This commit is contained in:
Maciej Suminski 2017-12-20 12:23:05 +01:00
parent 6344e238b3
commit 5fac73fc21
1 changed files with 14 additions and 2 deletions

View File

@ -240,9 +240,21 @@ void COMPONENT_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
switch( aKeyStroke.GetKeyCode() ) switch( aKeyStroke.GetKeyCode() )
{ {
case WXK_UP: selectIfValid( GetPrevItem( *m_tree_ctrl, sel ) ); break; #ifndef __WINDOWS__
case WXK_UP:
#else
case WXK_DOWN:
#endif
selectIfValid( GetPrevItem( *m_tree_ctrl, sel ) );
break;
case WXK_DOWN: selectIfValid( GetNextItem( *m_tree_ctrl, sel ) ); break; #ifndef __WINDOWS__
case WXK_DOWN:
#else
case WXK_UP:
#endif
selectIfValid( GetNextItem( *m_tree_ctrl, sel ) );
break;
default: default:
aKeyStroke.Skip(); // Any other key: pass on to search box directly. aKeyStroke.Skip(); // Any other key: pass on to search box directly.