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();
The cells which should be on top in the first 5 columns, but aren't, use wxGridCellAttr objects that are defined in various ways (not easy to extract brief code), but have had their text colour, background colour and size (rows, cols) set, along with SetOverflow(false) and SetReadOnly(true) as above.
The screenshots show the initial appearance, and then what happens if I scroll down and up again.
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.