allow customization of individual grid lines appearance (patch 1496015)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-07-24 23:16:37 +00:00
parent be085544e9
commit 3d3f3e3749
4 changed files with 82 additions and 2 deletions

View File

@@ -7533,6 +7533,21 @@ void wxGrid::DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr )
#endif
}
wxPen wxGrid::GetDefaultGridLinePen()
{
return wxPen(GetGridLineColour(), 1, wxSOLID);
}
wxPen wxGrid::GetRowGridLinePen(int WXUNUSED(row))
{
return GetDefaultGridLinePen();
}
wxPen wxGrid::GetColGridLinePen(int WXUNUSED(col))
{
return GetDefaultGridLinePen();
}
void wxGrid::DrawCellBorder( wxDC& dc, const wxGridCellCoords& coords )
{
int row = coords.GetRow();
@@ -7540,15 +7555,16 @@ void wxGrid::DrawCellBorder( wxDC& dc, const wxGridCellCoords& coords )
if ( GetColWidth(col) <= 0 || GetRowHeight(row) <= 0 )
return;
dc.SetPen( wxPen(GetGridLineColour(), 1, wxSOLID) );
wxRect rect = CellToRect( row, col );
// right hand border
dc.SetPen( GetColGridLinePen(col) );
dc.DrawLine( rect.x + rect.width, rect.y,
rect.x + rect.width, rect.y + rect.height + 1 );
// bottom border
dc.SetPen( GetRowGridLinePen(row) );
dc.DrawLine( rect.x, rect.y + rect.height,
rect.x + rect.width, rect.y + rect.height);
}
@@ -7693,7 +7709,6 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) )
dc.SetClippingRegion( clippedcells );
dc.SetPen( wxPen(GetGridLineColour(), 1, wxSOLID) );
// horizontal grid lines
//
@@ -7709,6 +7724,7 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) )
if ( bot >= top )
{
dc.SetPen( GetRowGridLinePen(i) );
dc.DrawLine( left, bot, right, bot );
}
}
@@ -7728,6 +7744,7 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) )
if ( colRight >= left )
{
dc.SetPen( GetColGridLinePen(i) );
dc.DrawLine( colRight, top, colRight, bottom );
}
}