Also avoid updating wxHeaderCtrl column when resizing in wxGrid

This is another attempt to get rid of the flicker when using the native
header control with wxGrid under MSW and avoid calling UpdateColumn(),
which is currently implemented in a very inefficient way in wxHeaderCtrl
under MSW, during interactive resizing.

See #18794.
This commit is contained in:
Vadim Zeitlin
2020-06-21 23:46:59 +02:00
parent bf266ca348
commit f8a0438385
2 changed files with 34 additions and 1 deletions

View File

@@ -9765,7 +9765,16 @@ void wxGrid::DoSetColSize( int col, int width )
return;
if ( m_useNativeHeader )
GetGridColHeader()->UpdateColumn(col);
{
// We have to update the native control if we're called from the
// program (directly or indirectly, e.g. via AutoSizeColumn()), but we
// want to avoid doing it when the column is being resized
// interactively, as this is unnecessary and results in very visible
// flicker, so take care to call the special method of our header
// control checking for whether it's being resized interactively
// instead of the usual UpdateColumn().
static_cast<wxGridHeaderCtrl*>(m_colLabelWin)->UpdateIfNotResizing(col);
}
//else: will be refreshed when the header is redrawn
for ( int colPos = GetColPos(col); colPos < m_numCols; colPos++ )