]> git.saurik.com Git - wxWidgets.git/commitdiff
Send wxEVT_COMMAND_DATAVIEW_CACHE_HINT to proper window.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Mar 2011 09:44:03 +0000 (09:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 9 Mar 2011 09:44:03 +0000 (09:44 +0000)
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

src/generic/datavgen.cpp

index d6ff164a8520bf382e207ea42b29cb46b0aef484..84520f5cce8e9fb7d6e3d66e96ac04d0ebf2d09c 100644 (file)
@@ -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);