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
This commit is contained in:
@@ -1606,10 +1606,11 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
wxMin( (int)( GetLineAt( wxMax(0,update.y+update.height) ) - item_start + 1),
|
wxMin( (int)( GetLineAt( wxMax(0,update.y+update.height) ) - item_start + 1),
|
||||||
(int)(GetRowCount( ) - item_start));
|
(int)(GetRowCount( ) - item_start));
|
||||||
unsigned int item_last = item_start + item_count;
|
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());
|
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);
|
cache_event.SetCache(item_start, item_last - 1);
|
||||||
parent->ProcessWindowEvent(cache_event);
|
parent->ProcessWindowEvent(cache_event);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user