Factor out wxDataViewRendererBase::NotifyEditingStarted()
Reuse the same code from the generic and native GTK and OS X implementations of wxDataViewCtrl instead of triplicating it. This fixes a small discrepancy between the wxOSX version, which didn't see the model pointer correctly in the generated event, and all the others, but mainly paves way for future improvements.
This commit is contained in:
@@ -703,15 +703,22 @@ bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect la
|
||||
m_editorCtrl->SetFocus();
|
||||
#endif
|
||||
|
||||
// Now we should send Editing Started event
|
||||
NotifyEditingStarted(item);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewRendererBase::NotifyEditingStarted(const wxDataViewItem& item)
|
||||
{
|
||||
wxDataViewColumn* const column = GetOwner();
|
||||
wxDataViewCtrl* const dv_ctrl = column->GetOwner();
|
||||
|
||||
wxDataViewEvent event( wxEVT_DATAVIEW_ITEM_EDITING_STARTED, dv_ctrl->GetId() );
|
||||
event.SetDataViewColumn( GetOwner() );
|
||||
event.SetDataViewColumn( column );
|
||||
event.SetModel( dv_ctrl->GetModel() );
|
||||
event.SetItem( item );
|
||||
event.SetEventObject( dv_ctrl );
|
||||
dv_ctrl->GetEventHandler()->ProcessEvent( event );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewRendererBase::DestroyEditControl()
|
||||
|
||||
Reference in New Issue
Block a user