Send wxEVT_DATAVIEW_ITEM_EDITING_DONE after cancelling too

Previously this event was not sent at all if editing the item was
cancelled, e.g. by pressing Esc.

Do send it now from the generic implementation and update the sample to
show this event.

See #17835.
This commit is contained in:
Vadim Zeitlin
2018-02-04 22:40:51 +01:00
parent 7e3d28e79f
commit 1e3e5b7253
4 changed files with 46 additions and 15 deletions

View File

@@ -1227,7 +1227,11 @@ void MyFrame::OnEditingStarted( wxDataViewEvent &event )
void MyFrame::OnEditingDone( wxDataViewEvent &event )
{
wxString title = m_music_model->GetTitle( event.GetItem() );
wxLogMessage( "wxEVT_DATAVIEW_ITEM_EDITING_DONE, Item: %s", title );
wxLogMessage("wxEVT_DATAVIEW_ITEM_EDITING_DONE, Item: %s, new value %s",
title,
event.IsEditCancelled()
? wxString("unavailable because editing was cancelled")
: event.GetValue().GetString());
}
void MyFrame::OnExpanded( wxDataViewEvent &event )