Unselect all wxDataViewCtrl items when clicking outside of the item area.
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
This commit is contained in:
@@ -4010,20 +4010,24 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!col)
|
// 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();
|
event.Skip();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxDataViewRenderer *cell = col->GetRenderer();
|
wxDataViewRenderer *cell = col->GetRenderer();
|
||||||
if ((current >= GetRowCount()) || (x > GetEndOfLastCol()))
|
|
||||||
{
|
|
||||||
// Unselect all if below the last row ?
|
|
||||||
event.Skip();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wxDataViewColumn* const
|
wxDataViewColumn* const
|
||||||
expander = GetExpanderColumnOrFirstOne(GetOwner());
|
expander = GetExpanderColumnOrFirstOne(GetOwner());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user