I've got another trivial problem that I seem not to be able to solve on my own. (wxWidgets 3.1.0)
Ive got a simple Dialog using wxFlexGridSizer for each line in my main panel.
But as you can see in the picture, the wxDatePickerCtrl is greedy and takes more of the resizeable space than it actually needs - it just doesn't look good:
Code: Select all
//Body Left - LINE2
mpn_bodyLeft_LINE2 = new wxPanel(mpn_bodyLeft);
mfgs_bodyLeft_LINE2 = new wxFlexGridSizer(2);
wxPanel * pn_birthday = new wxPanel(mpn_bodyLeft_LINE2);
wxFlexGridSizer * fgs_birthday = new wxFlexGridSizer(1);
mst_Geburtsdatum = new wxStaticText(pn_birthday, wxID_ANY, "Geburtsdatum");
mdpc_Geburtsdatum = new wxDatePickerCtrl(pn_birthday, ID_DATEPICKER_BIRTHDAY, dt, wxDefaultPosition, wxDefaultSize, wxDP_DROPDOWN);
fgs_birthday->Add(mst_Geburtsdatum, 1, wxBOTTOM | wxEXPAND, 5);
fgs_birthday->Add(mdpc_Geburtsdatum, 1, wxEXPAND, 0);
fgs_birthday->AddGrowableCol(0, 1);
pn_birthday->SetSizer(fgs_birthday);
wxPanel * pn_salutation = new wxPanel(mpn_bodyLeft_LINE2);
wxFlexGridSizer * fgs_salutation = new wxFlexGridSizer(1);
mst_Anrede = new wxStaticText(pn_salutation, wxID_ANY, "Anrede");
mch_Anrede = new wxChoice(pn_salutation, ID_CHOICE_SALUTATION);
fgs_salutation->Add(mst_Anrede, 1, wxBOTTOM | wxEXPAND, 5);
fgs_salutation->Add(mch_Anrede, 1, wxEXPAND, 5);
fgs_salutation->AddGrowableCol(0, 1);
pn_salutation->SetSizer(fgs_salutation);
mfgs_bodyLeft_LINE2->Add(pn_birthday, 1, wxRIGHT | wxEXPAND, 5);
mfgs_bodyLeft_LINE2->Add(pn_salutation, 1, wxEXPAND, 0);
mfgs_bodyLeft_LINE2->AddGrowableCol(0, 1);
mfgs_bodyLeft_LINE2->AddGrowableCol(1, 1);
mfgs_bodyLeft_LINE2->AddGrowableRow(0, 1);
mpn_bodyLeft_LINE2->SetSizer(mfgs_bodyLeft_LINE2);
In other words: It makes no difference, if I add the ctrl directly or if I give it its own sub-panel and sub-sizer.
I could think of resizing the panel on my own by getting the width of the whole thing, dividing it by 2 and set the width myself. But is there really no better option to deal with this?
Best
Natu