we add controls into a wxFlexGridSizer which is inside a wxScrolledWindow. When the dialog shows up, it is not resized to a proper size. Dialog creation and setup is like this:
Code: Select all
dialog_config_mismatch d(nullptr, wxID_ANY, _(warn));
wxFont font(wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD, false, wxEmptyString);
auto s1 = new wxStaticText(&d, wxID_ANY, display_path, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
s1->Wrap(-1);
s1->SetFont(font);
d.m_mainsizer->Add(s1, 0, wxALL, 5);
auto s2 = new wxStaticText(&d, wxID_ANY, t.default_value, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
s2->Wrap(-1);
d.m_mainsizer->Add(s2, 0, wxALL, 5);
auto r1 = new wxRadioButton(&d, wxID_ANY, wxString() << system_value, wxDefaultPosition, wxDefaultSize, wxRB_GROUP|wxALIGN_LEFT);
r1->SetValue(true);
d.m_mainsizer->Add(r1, 0, wxALL, 5);
auto r2 = new wxRadioButton(&d, wxID_ANY, wxString() << t.project_value, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
d.m_mainsizer->Add(r2, 0, wxALL, 5);
auto s3 = new wxStaticText(&d, wxID_ANY, t.restart_flag, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
d.m_mainsizer->Add(s3, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
d.m_mainsizer->Layout();
d.m_scrolledWindow1->SetSize(600, 200);
d.m_scrolledWindow1->FitInside();
d.m_main_vertical_boxsizer->Fit(&d);
d.Layout();
This is how the dialog is set up in wxFormBuilder:
It should display another grid row with 5 wxStaticText controls. Does anyone know why the dialog does not expand to the 600x200px requested in
Code: Select all
d.m_scrolledWindow1->SetSize(600, 200);
Heiner