Fix duplicate wxEVT_DATAVIEW_ITEM_EDITING_STARTED under GTK

When using a custom renderer, wxEVT_DATAVIEW_ITEM_EDITING_STARTED was sent
twice: once from the generic base class StartEditing() and another time from
the GTK-specific "editing_started" signal handler. And we must send it from
the latter, because otherwise no event would be generated at all for the
standard renderers (i.e. text cells) for which we don't call StartEditing()
ourselves, so don't call it from the former and instead generate the event by
explicitly calling NotifyEditingStarted() after calling StartEditing() in the
generic version (as for wxOSX version, it doesn't use StartEditing() at all
and so doesn't need to be changed).
This commit is contained in:
Vadim Zeitlin
2015-11-26 01:20:37 +01:00
parent 235e8ebd1a
commit 29024e39ca
2 changed files with 2 additions and 2 deletions

View File

@@ -2251,6 +2251,8 @@ wxDataViewMainWindow::StartEditing(const wxDataViewItem& item,
const wxRect itemRect = GetItemRect(item, col);
if ( renderer->StartEditing(item, itemRect) )
{
renderer->NotifyEditingStarted(item);
// Save the renderer to be able to finish/cancel editing it later and
// save the control to be able to detect if we're still editing it.
m_editorRenderer = renderer;