I use wxWidgets 3.1.5 under Windows, in which I have developed a I have a wxGrid that contains more columns than can be displayed, so a horizontal scroll bar is needed.
The problem arises when I use FreezeTo in a virtual table base through wxGridTableBase:
if the wxGrid contains more rows than can be displayed both the horizontal and vertical scroll bars are visible,
otherwise, if all rows are displayed, the vertical scroll bar is not displayed, the horizontal scroll bar it is disabled even though it must be enabled.
To prove it you can use the example provided by wxWidgets Grid control wxWidgets sample, modifying the BigGridFrame constructor in griddemo.cpp like so:
// ============================================================================
// BigGridFrame and BigGridTable: Sample of a non-standard table
// ============================================================================
BigGridFrame::BigGridFrame(long sizeGrid)
: wxFrame(NULL, wxID_ANY, "Plugin Virtual Table")
{
m_grid = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
m_table = new BigGridTable(sizeGrid);
// VZ: I don't understand why this slows down the display that much,
// must profile it...
//m_table->SetAttrProvider(new MyGridCellAttrProvider);
m_grid->AssignTable(m_table);
SetClientSize(FromDIP(wxSize(500, 450)));
//if sizeGrid <12 the horizontal scrollbar will not be displayed, if sizeGrid> = 12 the horizontal scrollbar will be displayed
m_grid->FreezeTo(0, 3);
}
If sizeGrid <12 the horizontal scrollbar will not be displayed, if sizeGrid> = 12 the horizontal scrollbar will be displayed
how can i fix this bug? (See bug reported on github)
Is it possible to solve it with some workaround on my code, instead of intervening on the wxWidgets library ? For example shrink the height of the wxGrid so that the bottom edge coincides with the last row ? How can I do it ?