I'm using wxWidgets 3.0.2 on Windows 7.
I have a C++ application that has a potentially very large spreadsheet-style grid. I'm in the process of recoding the handling of attributes as I was having serious performance issues when the 18-column grid held several thousand rows—it was taking up to one minute for the initial display. In the previous implementation I was just using the SetBackgroundColour, SetTextColour and SetCellSize methods on the wxGrid-derived object directly, and despite the slowness, all looked OK.
My new approach has been to derive my own class from wxGridTableBase and to override the GetAttr method directly on that. Initial display is massively faster—down from 1 minute to 0.2 seconds—and everything looks fine at the moment it becomes visible. However, when I scroll the table, I'm having a problem that I didn't have before, which is that cells that should be covered by other cells for which a multi-row size has been set are showing through.
In the screenshots below I've coloured my normal light-grey table background a garish cyan so you can see what's going on. Basically, I have a set of attributes for empty cells which are defined as follows:
Code: Select all
m_emptyAttr = new wxGridCellAttr();
m_emptyAttr->SetBackgroundColour(m_backgroundColour);
m_emptyAttr->SetOverflow(false);
m_emptyAttr->SetReadOnly(true);
The screenshots show the initial appearance, and then what happens if I scroll down and up again.
Before scrolling After scrolling down and back up Any ideas what I might be missing or doing wrong? Happy to provide more details if I've missed something important.
Many thanks,
Andrew