Menu

#70 Cannot add more about 2000 items

open
None
4
2008-11-01
2008-09-16
Corsix
No

I use wxPropGrid in a scenario where I want to have lots of items in it (i.e. 16,000 or more). I was using wx 2.6.2 along with whatever version of wxPropGrid was available when 2.6.2 was released, and this worked fine. After upgrading to the latest wx and wxPropGrid, I can no longer put this many items into the control.

After the height of the properties in the control exceeds 32767 pixels, nothing more is drawn. For me, this happens around the 1800 item mark - see attached screenshot for example of this.

I took the propgrid sample, and then changed these lines:

pg->Append( new wxArrayStringProperty( wxT("ArrayStringProperty"), wxPG_LABEL,
example_array) );

to these:

for(int iRepeat = 0; iRepeat < 2000; ++iRepeat)
pg->Append( new wxArrayStringProperty( wxString::Format(wxT("Item %0.5i"), iRepeat), wxPG_LABEL,
example_array) );

pg->Append( new wxArrayStringProperty( wxT("ArrayStringProperty"), wxPG_LABEL,
example_array) );

Discussion

  • Corsix

    Corsix - 2008-09-16

    Screenshot of bug

     
  • Jaakko Salli

    Jaakko Salli - 2008-09-17

    While this looks like a bug that should be fixed, I must say that wxPropertyGrid was not designed to be used for very high item counts. wxGrid, wxListCtrl and wxDataViewCtrl, especially with their virtual modes are probably better for this.

    Anyhow, the reason why this does not work from version 1.3.0 forwards is that I have added intermediate wxPanel inside the actual wxPropertyGrid scrolled window. This change has allowed easy elimination of various graphics glitches, but yes, apparently MSW windows have 32767 pixel height limit that rears its ugly head in this case.

    As a workaround I can only suggest going back to latest release of previous stable branch (1.2.12), assuming you mostly want bug fixes. This is especially because of rather weak possibility that this bug will be fixed in 1.4, which is should be pretty stable at the moment and I'd rather not do significant changes to fix bug that only affects small minority of users. I will however wxASSERT_MSG to inform people who bump into this same issue.

    wxWidgets SVN trunk, where wxPG development branch resides right now, is of course another matter, and should receive appropriate fix at some point (which I will backport to wxPG 1.4 if it looks small enough).

    Thanks!

    Jaakko

     
  • Jaakko Salli

    Jaakko Salli - 2008-09-17
    • assigned_to: nobody --> jmsalli
     
  • Jaakko Salli

    Jaakko Salli - 2008-11-01
    • priority: 5 --> 4
     

Log in to post a comment.