Update modified items in generic wxDataViewCtrl immediately

Recent optimizations avoiding resort on item change (see
https://github.com/wxWidgets/wxWidgets/pull/642) have also optimized
away refreshing the modified item, which was done implicitly, as a side
effect of resorting, before, so the changes were not reflected on
display immediately any longer.

Fix this by simply refreshing the item explicitly and also add a way to
test for the correct behaviour in the sample.
This commit is contained in:
Vadim Zeitlin
2018-01-16 13:08:52 +01:00
parent 4f456c8a19
commit 77c7c80696
2 changed files with 21 additions and 0 deletions

View File

@@ -2959,6 +2959,9 @@ bool wxDataViewMainWindow::DoItemChanged(const wxDataViewItem & item, int view_c
GetOwner()->InvalidateColBestWidth(view_column);
}
// Update the displayed value(s).
RefreshRow(GetRowByItem(item));
// Send event
wxDataViewEvent le(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, m_owner, column, item);
m_owner->ProcessWindowEvent(le);