X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/49d2b75d53710014e9e423fcca94ee90083a20a5..b3cec67186d678d2c3985923bdb8c787455cf369:/src/generic/datavgen.cpp?ds=sidebyside diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 9980dc7ab3..9b6c2759cb 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -1676,6 +1676,12 @@ 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(); + wxDataViewEvent cache_event(wxEVT_COMMAND_DATAVIEW_CACHE_HINT, parent->GetId()); + cache_event.SetEventObject(GetParent()); + cache_event.SetCache(item_start, item_last - 1); + parent->ProcessWindowEvent(cache_event); // compute which columns needs to be redrawn unsigned int cols = GetOwner()->GetColumnCount(); @@ -2075,7 +2081,7 @@ bool wxDataViewMainWindow::ItemDeleted(const wxDataViewItem& parent, wxDataViewVirtualListModel *list_model = (wxDataViewVirtualListModel*) GetOwner()->GetModel(); m_count = list_model->GetCount(); - + if( m_currentRow > GetRowCount() ) m_currentRow = m_count - 1; @@ -2492,7 +2498,7 @@ void wxDataViewMainWindow::RefreshRowsAfter( unsigned int firstRow ) void wxDataViewMainWindow::OnArrowChar(unsigned int newCurrent, const wxKeyEvent& event) { wxCHECK_RET( newCurrent < GetRowCount(), - _T("invalid item index in OnArrowChar()") ); + wxT("invalid item index in OnArrowChar()") ); // if there is no selection, we cannot move it anywhere if (!HasCurrentRow()) @@ -3186,7 +3192,7 @@ wxRect wxDataViewMainWindow::GetItemRect( const wxDataViewItem & item, { wxDataViewTreeNode* node = GetTreeNodeByRow(row); indent = GetOwner()->GetIndent() * node->GetIndentLevel(); - indent = indent + m_lineHeight; // use m_lineHeight as the width of the expander + indent = indent + m_lineHeight; // use m_lineHeight as the width of the expander if(!node->HasChildren()) delete node; @@ -3209,7 +3215,7 @@ int wxDataViewMainWindow::RecalculateCount() { wxDataViewVirtualListModel *list_model = (wxDataViewVirtualListModel*) GetOwner()->GetModel(); - + return list_model->GetCount(); } else @@ -3392,7 +3398,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) // don't use m_linesPerPage directly as it might not be computed yet const int pageSize = GetCountPerPage(); - wxCHECK_RET( pageSize, _T("should have non zero page size") ); + wxCHECK_RET( pageSize, wxT("should have non zero page size") ); switch ( event.GetKeyCode() ) { @@ -3839,7 +3845,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) else // !ctrl, !shift { // test in the enclosing if should make it impossible - wxFAIL_MSG( _T("how did we get here?") ); + wxFAIL_MSG( wxT("how did we get here?") ); } }