This is consistent with Windows behaviour and as the generic wxDataViewCtrl is
mostly used under Windows, it makes sense to follow Windows convention in it.
Closes #15082.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73602
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+ // Check if we clicked outside the item area.
+ if ((current >= GetRowCount()) || !col)
+ // Follow Windows convention here: clicking either left or right (but
+ // not middle) button clears the existing selection.
+ if (m_owner && (event.LeftDown() || event.RightDown()))
+ {
+ if (!GetSelections().empty())
+ {
+ m_owner->UnselectAll();
+ SendSelectionChangedEvent(wxDataViewItem());
+ }
+ }
event.Skip();
return;
}
wxDataViewRenderer *cell = col->GetRenderer();
event.Skip();
return;
}
wxDataViewRenderer *cell = col->GetRenderer();
- if ((current >= GetRowCount()) || (x > GetEndOfLastCol()))
- {
- // Unselect all if below the last row ?
- event.Skip();
- return;
- }
-
wxDataViewColumn* const
expander = GetExpanderColumnOrFirstOne(GetOwner());
wxDataViewColumn* const
expander = GetExpanderColumnOrFirstOne(GetOwner());