Improved highlight drawing on wxMac/Core Graphics by not using wxClientDC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
8a7e4b38b8
commit
5d38a5f3c1
@ -7102,8 +7102,10 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS)
|
||||||
wxClientDC dc( m_gridWin );
|
wxClientDC dc( m_gridWin );
|
||||||
PrepareDC( dc );
|
PrepareDC( dc );
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( m_currentCellCoords != wxGridNoCellCoords )
|
if ( m_currentCellCoords != wxGridNoCellCoords )
|
||||||
{
|
{
|
||||||
@ -7126,15 +7128,21 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords )
|
|||||||
// Otherwise refresh redraws the highlight!
|
// Otherwise refresh redraws the highlight!
|
||||||
m_currentCellCoords = coords;
|
m_currentCellCoords = coords;
|
||||||
|
|
||||||
|
#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS
|
||||||
|
m_gridWin->Refresh(true /*, & r */);
|
||||||
|
#else
|
||||||
DrawGridCellArea( dc, cells );
|
DrawGridCellArea( dc, cells );
|
||||||
DrawAllGridLines( dc, r );
|
DrawAllGridLines( dc, r );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_currentCellCoords = coords;
|
m_currentCellCoords = coords;
|
||||||
|
|
||||||
wxGridCellAttr *attr = GetCellAttr( coords );
|
wxGridCellAttr *attr = GetCellAttr( coords );
|
||||||
|
#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS)
|
||||||
DrawCellHighlight( dc, attr );
|
DrawCellHighlight( dc, attr );
|
||||||
|
#endif
|
||||||
attr->DecRef();
|
attr->DecRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7510,7 +7518,7 @@ void wxGrid::DrawCell( wxDC& dc, const wxGridCellCoords& coords )
|
|||||||
// edit control is erased by this code after being rendered.
|
// edit control is erased by this code after being rendered.
|
||||||
// On wxMac (QD build only), the cell editor is a wxTextCntl and is rendered
|
// On wxMac (QD build only), the cell editor is a wxTextCntl and is rendered
|
||||||
// implicitly, causing this out-of order render.
|
// implicitly, causing this out-of order render.
|
||||||
#if !defined(__WXMAC__) || wxMAC_USE_CORE_GRAPHICS
|
#if !defined(__WXMAC__)
|
||||||
wxGridCellEditor *editor = attr->GetEditor(this, row, col);
|
wxGridCellEditor *editor = attr->GetEditor(this, row, col);
|
||||||
editor->PaintBackground(rect, attr);
|
editor->PaintBackground(rect, attr);
|
||||||
editor->DecRef();
|
editor->DecRef();
|
||||||
|
Loading…
Reference in New Issue
Block a user