Hello,
I'm using custom GridCellRenderers to draw the grid cell contents, all Ok.
But recently I discovered that for simply cell decorations i can call to any gridrenderer to draw the contents with the current attributes and after, do the decoration.
That is:
class CellRendererStringWithBorder(gridlib.PyGridCellRenderer):
def Draw(self, grid, attr, dc, rect, row, col, isSelected):
# Call string renderer to draw contents
gridlib.GridCellStringRenderer().Draw(grid, attr, dc, rect, row, col, isSelected)
# do decoration
dc.SetBrush(wx.Brush(wx.Colour(0,0,0), wx.TRANSPARENT))
dc.SetPen(wx.Pen(wx.Colour(255, 0, 0), 1, wx.SOLID))
dc.DrawRoundedRectangle(rect.x, rect.y, rect.width, rect.height, 3)
This renderer call GridCellStringRenderer.Draw for draw the contents and after draw a box. On simple tests works fine.
The question is:
I have not seen anywhere these way to do the render. It's correct?
Can produce unwanted side effects?
Thanks,
···
--
Oswaldo Hern�ndez