From: Vadim Zeitlin Date: Wed, 9 Mar 2011 09:44:03 +0000 (+0000) Subject: Send wxEVT_COMMAND_DATAVIEW_CACHE_HINT to proper window. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/99f44d9704f7a45fb4ee627336798eae4c941a1e Send wxEVT_COMMAND_DATAVIEW_CACHE_HINT to proper window. The event was sent to wxDataViewCtrl parent instead of the control itself for some reason, fix this. Closes #13020. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67158 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index d6ff164a85..84520f5cce 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1606,10 +1606,11 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxMin( (int)( GetLineAt( wxMax(0,update.y+update.height) ) - item_start + 1), (int)(GetRowCount( ) - item_start)); unsigned int item_last = item_start + item_count; - // Get the parent of DataViewCtrl - wxWindow *parent = GetParent()->GetParent(); + + // Send the event to wxDataViewCtrl itself. + wxWindow * const parent = GetParent(); wxDataViewEvent cache_event(wxEVT_COMMAND_DATAVIEW_CACHE_HINT, parent->GetId()); - cache_event.SetEventObject(GetParent()); + cache_event.SetEventObject(parent); cache_event.SetCache(item_start, item_last - 1); parent->ProcessWindowEvent(cache_event);