]> git.saurik.com Git - wxWidgets.git/commitdiff
Improved highlight drawing on wxMac/Core Graphics by not using wxClientDC
authorJulian Smart <julian@anthemion.co.uk>
Mon, 6 Nov 2006 11:41:02 +0000 (11:41 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 6 Nov 2006 11:41:02 +0000 (11:41 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43115 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/grid.cpp

index 67b1ed79e2a1d9a6f3f058dcee9612172d722204..0b9df4311277cc829694bfa421d8e860da41760e 100644 (file)
@@ -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();