5 const wxRect& rect,
int row,
int col,
bool isSelected)
8 wxString cellValue =
grid.GetCellValue(row, col);
9 if (cellValue.IsEmpty())
11 DrawStripedBackground(dc, rect, isSelected);
15 wxGridCellStringRenderer::Draw(
grid, attr, dc, rect, row, col, isSelected);
23 dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)));
24 dc.SetPen(*wxTRANSPARENT_PEN);
25 dc.DrawRectangle(rect);
30 const int stripeHeight = 3;
31 wxColour color1 = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
32 wxColour color2(240, 240, 240);
34 dc.SetPen(*wxTRANSPARENT_PEN);
36 bool useColor1 =
true;
37 for (
int y = rect.GetTop(); y < rect.GetBottom(); y += stripeHeight)
39 wxColour currentColor = useColor1 ? color1 : color2;
40 dc.SetBrush(wxBrush(currentColor));
42 int stripeBottom = wxMin(y + stripeHeight, rect.GetBottom());
43 dc.DrawRectangle(rect.GetLeft(), y, rect.GetWidth(), stripeBottom - y);
45 useColor1 = !useColor1;
void drawStripedBackground(wxDC &dc, wxGridCellAttr &attr, const wxRect &rect, bool isSelected) const
void Draw(wxGrid &grid, wxGridCellAttr &attr, wxDC &dc, const wxRect &rect, int row, int col, bool isSelected) override