Fix lexical sort in component tree widget on Windows

Apparently explicitly requesting a column to be sorted breaks component
filtering on Windows. Without SetSortOrder() call the list is sorted and
filtering still works as expected.

Fixes: lp:1739412
* https://bugs.launchpad.net/kicad/+bug/1739412
This commit is contained in:
Maciej Suminski 2017-12-20 14:48:13 +01:00
parent 320fa7120d
commit 7f9876ec27
2 changed files with 0 additions and 12 deletions

View File

@ -189,10 +189,6 @@ void CMP_TREE_MODEL_ADAPTER_BASE::AttachTo( wxDataViewCtrl* aDataViewCtrl )
ColWidth( m_tree, 0, part_head ) ); ColWidth( m_tree, 0, part_head ) );
m_col_desc = aDataViewCtrl->AppendTextColumn( desc_head, 1, wxDATAVIEW_CELL_INERT, m_col_desc = aDataViewCtrl->AppendTextColumn( desc_head, 1, wxDATAVIEW_CELL_INERT,
ColWidth( m_tree, 1, desc_head ) ); ColWidth( m_tree, 1, desc_head ) );
// Enabling sort order breaks node selection on Windows, so unfortunately the list
// stays sorted in inverted lexical order. On Linux it does not change anything.
m_col_part->SetSortOrder( 0 );
} }

View File

@ -253,19 +253,11 @@ void COMPONENT_TREE::onQueryCharHook( wxKeyEvent& aKeyStroke )
switch( aKeyStroke.GetKeyCode() ) switch( aKeyStroke.GetKeyCode() )
{ {
#ifndef __WINDOWS__
case WXK_UP: case WXK_UP:
#else
case WXK_DOWN:
#endif
selectIfValid( GetPrevItem( *m_tree_ctrl, sel ) ); selectIfValid( GetPrevItem( *m_tree_ctrl, sel ) );
break; break;
#ifndef __WINDOWS__
case WXK_DOWN: case WXK_DOWN:
#else
case WXK_UP:
#endif
selectIfValid( GetNextItem( *m_tree_ctrl, sel ) ); selectIfValid( GetNextItem( *m_tree_ctrl, sel ) );
break; break;