fix repaining of highlight for merged cells [backport of r55630 from trunk] (closes #9718)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-02-08 10:23:19 +00:00
parent d166aa7c16
commit e3646f4afd
2 changed files with 22 additions and 1 deletions

View File

@@ -132,6 +132,7 @@ All (GUI):
wxMac with CoreGraphics where sash drawing isn't implemented.
- Use bitmap mask in wxSplashScreen.
- Translate "(c)" and "(C)" to the real copyright sign in wxAboutBox.
- Fix painting of highlight border for merged cells in wxGrid (K. Jones).
All (Unix):

View File

@@ -7859,7 +7859,27 @@ void wxGrid::DrawHighlight(wxDC& dc, const wxGridCellCoordsArray& cells)
size_t count = cells.GetCount();
for ( size_t n = 0; n < count; n++ )
{
if ( cells[n] == m_currentCellCoords )
wxGridCellCoords cell = cells[n];
// If we are using attributes, then we may have just exposed another
// cell in a partially-visible merged cluster of cells. If the "anchor"
// (upper left) cell of this merged cluster is the cell indicated by
// m_currentCellCoords, then we need to refresh the cell highlight even
// though the "anchor" itself is not part of our update segment.
if ( CanHaveAttributes() )
{
int rows = 0,
cols = 0;
GetCellSize(cell.GetRow(), cell.GetCol(), &rows, &cols);
if ( rows < 0 )
cell.SetRow(cell.GetRow() + rows);
if ( cols < 0 )
cell.SetCol(cell.GetCol() + cols);
}
if ( cell == m_currentCellCoords )
{
wxGridCellAttr* attr = GetCellAttr(m_currentCellCoords);
DrawCellHighlight(dc, attr);