X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/86020f7e330bcafc746e1f3b86ec6933d6c11811..df0edf44430437b77558152238f1596fdb4d73ae:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index e9917ab6df..f89d8470a6 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -4202,7 +4202,7 @@ wxGrid::~wxGrid() // with dangling view pointer if ( m_ownTable ) delete m_table; - else if ( m_table->GetView() == this ) + else if ( m_table && m_table->GetView() == this ) m_table->SetView(NULL); delete m_typeRegistry; @@ -7102,8 +7102,10 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) return; } +#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) wxClientDC dc( m_gridWin ); PrepareDC( dc ); +#endif if ( m_currentCellCoords != wxGridNoCellCoords ) { @@ -7126,15 +7128,21 @@ void wxGrid::SetCurrentCell( const wxGridCellCoords& coords ) // Otherwise refresh redraws the highlight! m_currentCellCoords = coords; +#if defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS + m_gridWin->Refresh(true /*, & r */); +#else DrawGridCellArea( dc, cells ); DrawAllGridLines( dc, r ); +#endif } } m_currentCellCoords = coords; wxGridCellAttr *attr = GetCellAttr( coords ); +#if !(defined(__WXMAC__) && wxMAC_USE_CORE_GRAPHICS) DrawCellHighlight( dc, attr ); +#endif attr->DecRef(); } @@ -7510,7 +7518,7 @@ void wxGrid::DrawCell( wxDC& dc, const wxGridCellCoords& coords ) // edit control is erased by this code after being rendered. // On wxMac (QD build only), the cell editor is a wxTextCntl and is rendered // implicitly, causing this out-of order render. -#if !defined(__WXMAC__) || wxMAC_USE_CORE_GRAPHICS +#if !defined(__WXMAC__) wxGridCellEditor *editor = attr->GetEditor(this, row, col); editor->PaintBackground(rect, attr); editor->DecRef(); @@ -7705,8 +7713,7 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) int rightCol = GetColPos( internalXToCol(right) ); int bottomRow = internalYToRow(bottom); -#ifndef __WXMAC__ - // CS: I don't know why suddenly unscrolled coordinates are used for clipping +#if !defined(__WXMAC__) || wxMAC_USE_CORE_GRAPHICS wxRegion clippedcells(0, 0, cw, ch); int i, j, cell_rows, cell_cols;