47 void Draw( wxGrid&
grid, wxGridCellAttr& attr, wxDC& dc,
48 const wxRect& rect,
int row,
int col,
bool isSelected )
override
51 T::Draw(
grid, attr, dc, rect, row, col, isSelected );
54 if(
grid.GetCellValue( row, col ).IsEmpty() )
69 dc.SetBrush( wxBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_HIGHLIGHT ) ) );
70 dc.SetPen( *wxTRANSPARENT_PEN );
71 dc.DrawRectangle( rect );
76 wxColour bgColor = attr.GetBackgroundColour();
77 dc.SetBrush( wxBrush( bgColor ) );
78 dc.SetPen( *wxTRANSPARENT_PEN );
79 dc.DrawRectangle( rect );
82 const int stripeSpacing = 20;
84 int bgLuminance = bgColor.GetLuminance();
87 wxPen stripePen( stripeColor, 1, wxPENSTYLE_SOLID );
88 dc.SetPen( stripePen );
91 int startX = rect.GetLeft() - rect.GetHeight();
92 int endX = rect.GetRight() + rect.GetHeight();
95 for(
int x = startX; x < endX; x += stripeSpacing )
98 int y1 = rect.GetTop();
99 int x2 = x + rect.GetHeight();
100 int y2 = rect.GetBottom();
103 if( x1 < rect.GetLeft() )
105 int deltaY = rect.GetLeft() - x1;
107 y1 = rect.GetTop() + deltaY;
110 if( x2 > rect.GetRight() )
112 int deltaY = x2 - rect.GetRight();
113 x2 = rect.GetRight();
114 y2 = rect.GetBottom() - deltaY;
118 if( x1 <= rect.GetRight() && x2 >= rect.GetLeft() && y1 <= rect.GetBottom() && y2 >= rect.GetTop() )
120 dc.DrawLine( x1, y1, x2, y2 );