If, in a single-selection listctrl, a focused item is selected, and the
focus is moved programmatically (SetItemState) without selecting the new item, the old focused item wasn't deselected, making the listctrl end up with TWO selected items when the focused item gets selected by the user. So I made SetItemState deselect the old focused item when the focus is moved in a single-selection listctrl. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7776 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
63c8fa9565
commit
4aefa363ef
@ -2499,6 +2499,7 @@ void wxListMainWindow::SetItemState( long item, long state, long stateMask )
|
|||||||
UnfocusLine( m_current );
|
UnfocusLine( m_current );
|
||||||
m_current = line;
|
m_current = line;
|
||||||
FocusLine( m_current );
|
FocusLine( m_current );
|
||||||
|
if ((m_mode & wxLC_SINGLE_SEL) && oldCurrent) oldCurrent->Hilight( FALSE );
|
||||||
RefreshLine( m_current );
|
RefreshLine( m_current );
|
||||||
if (oldCurrent) RefreshLine( oldCurrent );
|
if (oldCurrent) RefreshLine( oldCurrent );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user