-void wxGrid::DrawCellBackground( wxDC& dc, const wxGridCellCoords& coords )
-{
- if ( m_colWidths[coords.GetCol()] <=0 ||
- m_rowHeights[coords.GetRow()] <= 0 ) return;
-
- int row = coords.GetRow();
- int col = coords.GetCol();
-
- dc.SetBackgroundMode( wxSOLID );
-
- if ( IsInSelection( coords ) )
- {
- // TODO: improve this
- //
- dc.SetBrush( *wxBLACK_BRUSH );
- }
- else
- {
- dc.SetBrush( wxBrush(GetCellBackgroundColour(row, col), wxSOLID) );
- }
-
- dc.SetPen( *wxTRANSPARENT_PEN );
-
- dc.DrawRectangle( m_colRights[col] - m_colWidths[col] + 1,
- m_rowBottoms[row] - m_rowHeights[row] + 1,
- m_colWidths[col]-1,
- m_rowHeights[row]-1 );
-}
-
-
-void wxGrid::DrawCellValue( wxDC& dc, const wxGridCellCoords& coords )
-{
- if ( m_colWidths[coords.GetCol()] <=0 ||
- m_rowHeights[coords.GetRow()] <= 0 ) return;
-
- int row = coords.GetRow();
- int col = coords.GetCol();
-
- dc.SetBackgroundMode( wxTRANSPARENT );
-
- if ( IsInSelection( row, col ) )
- {
- // TODO: improve this
- //
- dc.SetTextBackground( wxColour(0, 0, 0) );
- dc.SetTextForeground( wxColour(255, 255, 255) );
- }
- else
- {
- dc.SetTextBackground( GetCellBackgroundColour(row, col) );
- dc.SetTextForeground( GetCellTextColour(row, col) );
- }
- dc.SetFont( GetCellFont(row, col) );
-
- int hAlign, vAlign;
- GetCellAlignment( row, col, &hAlign, &vAlign );
-
- wxRect rect;
- rect.SetX( m_colRights[col] - m_colWidths[col] + 2 );
- rect.SetY( m_rowBottoms[row] - m_rowHeights[row] + 2 );
- rect.SetWidth( m_colWidths[col] - 4 );
- rect.SetHeight( m_rowHeights[row] - 4 );
-
- DrawTextRectangle( dc, GetCellValue( row, col ), rect, hAlign, vAlign );
-}
-
-
-