Fix selection of items inserted in virtual generic wxDataViewCtrl.

Call wxSelectionStore::OnItemsInserted() explicitly instead of just using our
UpdateCount() to update the count of items managed by the selection. This
needs to be done to ensure that the newly added items have the correction
selection, i.e. are always unselected, as previously this wasn't the case: if
wxSelectionStore was in the "selected by default" state as it happened e.g.
after selecting all the items in the control, the new items also ended up
being selected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2015-01-11 22:49:21 +00:00
parent 87a44937ff
commit 9f5af0a494

View File

@ -2304,7 +2304,9 @@ bool wxDataViewMainWindow::ItemAdded(const wxDataViewItem & parent, const wxData
{
wxDataViewVirtualListModel *list_model =
(wxDataViewVirtualListModel*) GetModel();
UpdateCount(list_model->GetCount());
m_count = list_model->GetCount();
m_selection.OnItemsInserted(GetRowByItem(item), 1);
}
else
{