I have a wxPanel.
In there is a vertical wxStaticBoxSizer.
The top half is not interesting, it has a bunch of checkboxes. The bottom half is a wxGrid.
When the grid has enough rows to be in need of a scrollbar, the scrollbar's *place* pops up (a slightly darker rectangle than the background) *and* I can scroll the grid with it, but it is not visible. The arrows and slider thingy are simply not visible, even though they work just fine.
It's most strange. I wonder if anyone has seen this strange behaviour and if yes, what might be the cause? Most likely me, but I can't figure out.
Code fragment that generates the whole thing is here, 'this' is an object derived from wxPanel:
Code: Select all
sv = new wxStaticBoxSizer( wxVERTICAL, this, "Device log" );
SetSizer( sv );
... create the top half, a panel named 'topwin', then ...
logwin = new wxGrid( parent, myID_LOG );
logwin->CreateGrid( NVM_LOGS, 3 );
logwin->SetColLabelAlignment( wxLEFT, wxCENTRE );
logwin->SetColLabelValue( 0, "Date" );
logwin->SetColLabelValue( 1, "Time" );
logwin->SetColLabelValue( 2, "Event" );
logwin->EnableGridLines( true );
sv->Add( topwin, 1, wxEXPAND );
sv->Add( logwin, 1, wxEXPAND );
A related question: is it possible to tell wxGrid that one of its columns should be stretchable horizontally? Basically, I have 3 columns. What I'd like to happen when the user resizes the window horizontally is that the first two columns remain the same width all the time but the third one becomes wider or narrower as needed. Thus, the grid would always occupy all the available width rather than being only as wide as the content demands and having empty space between the right edge of the grid and the right edge of the window. Is it possible to do with wxGrid?