Hello I am using wxWindows since a few weeks and for my GUI, I need to display a grid inside a wxStaticBox object. I want the following: when the user resize the window, and especially sizes up the width, I would like all columns to expand in order to fit the new frame width. For now I have a grid with some columns of a certain size and on frame resizing, just a white square (like the grid background) is scaling up, not the columns that keep their width! I have tried with wxLayoutConstraints and wxSizers objects and I did not find any solution. Always this ugly white square! It's a big problem for me and I think the people who are using wxWindows for a long time must know the solution. Thanks you in advance!
Here is my code:
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer *kontaktgrid = new wxStaticBoxSizer(new wxStaticBox(panel,
-1, _T("Query Services List")), wxHORIZONTAL);
wxGrid *gridtest = new wxGrid(panel, -1, wxDefaultPosition, wxSize(-1, 220));
gridtest->CreateGrid(10, 5);
gridtest->UpdateDimensions();
kontaktgrid->Add(gridtest, 0, wxGROW | wxCENTER, 10);
topsizer->Add(kontaktgrid, 0, wxEXPAND | wxALL | wxCENTER, 10);
panel->SetAutoLayout(TRUE);
SetSizer( topsizer );
|