0

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, enter image description here 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. enter image description here

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 ?

famedoro
  • 1,223
  • 2
  • 17
  • 41
  • could you try it with 3.1.7 or even with 3.2.0 release candidate `grid` sample? If you still can reproduce it there - open an issue on github. – Igor Jul 04 '22 at 16:11
  • @Igor Unfortunately I cannot change the version, the configuration and compilation of 3.1.5 took a long time and too many projects are bound to it – famedoro Jul 05 '22 at 06:48
  • @Igor I entered a code to be able to find the bug – famedoro Jul 05 '22 at 09:50
  • you don't have to build you project - just build the library and a `grid` sample. You can also try the sample from the version you have right now and see if the bug is reproducible – Igor Jul 05 '22 at 12:28
  • BTW, this might be a bug in the version you are using, and it could be already fixed in master. Also - I don't understand your comment - in you project you shouldn't be hardworking wx version. You should reference some environment variable or use generic name for directory (wxWidgets instead of wxWidgets-3.1.7). – Igor Jul 05 '22 at 12:35
  • See https://github.com/wxWidgets/wxWidgets/issues/22602 – famedoro Jul 05 '22 at 12:52
  • yes I saw it. You need to wait for the fix.freezing is relatively new feature and it's bound to have bugs... – Igor Jul 05 '22 at 14:58

1 Answers1

0

The problem is solved by applying the patch published to:

patch

famedoro
  • 1,223
  • 2
  • 17
  • 41