Make virtual lists send DESELECTED events consistently on both implementations
In the case when a listctrl is clicked outside of any item, the item is visually deselected, and it is logical that a DESELECTED is sent. For non-virtual lists this would happen, but for virtual lists it would either happen or not happen depending on implementation (MSW/generic) and mode (single/multi). From now on the DESELECTED event is always sent.
This commit is contained in:
@@ -2447,7 +2447,8 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
||||
else
|
||||
m_dragCount = 0;
|
||||
|
||||
// The only mouse event that can be generated without any valid item is
|
||||
// The only mouse events that can be generated without any valid item are
|
||||
// wxEVT_LIST_ITEM_DESELECTED for virtual lists, and
|
||||
// wxEVT_LIST_ITEM_RIGHT_CLICK as it can be useful to have a global
|
||||
// popup menu for the list control itself which should be shown even when
|
||||
// the user clicks outside of any item.
|
||||
@@ -2467,6 +2468,10 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event )
|
||||
{
|
||||
// reset the selection and bail out
|
||||
HighlightAll(false);
|
||||
// generate a DESELECTED event for
|
||||
// virtual multi-selection lists
|
||||
if ( IsVirtual() && !IsSingleSel() )
|
||||
SendNotify( m_lineLastClicked, wxEVT_LIST_ITEM_DESELECTED );
|
||||
}
|
||||
|
||||
return;
|
||||
|
Reference in New Issue
Block a user