Hello,
I'm new to the concept of sizers, and I like the mechanism. Just one question:
A horizontal sizer positions its childs horizontally, a vertical sizer positions its childs vertically. But, what if I want two objects (let's say two wxStaticBoxSizers) be aligned vertically (one StaticBox under the other), but expand horizontally?
I use a vertical BoxSizer to align the StaticBoxes under each other. But then thay expand vertically, not horizontally. I want them to not expand vertically, but horizontally.
How can I do this?
I hope I could describe it well enough.
Thanks a lot!
Sizer Question
Thanks for the answer, but I used the wxEXPAND flag. Here is my code:eco wrote:Use the flag wxEXPAND.
Code: Select all
wxBoxSizer* pSizer1 = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer* pSizer1_1 = new wxStaticBoxSizer(wxVERTICAL, p, "Simulation Control");
wxStaticBoxSizer* pSizer1_2 = new wxStaticBoxSizer(wxVERTICAL, p, "Record Simulation");
pSizer1->Add(pSizer1_1, wxEXPAND | wxALL, 5);
pSizer1->Add(pSizer1_2, wxEXPAND | wxALL, 5);
pSizer1_1->Add(pText_SimScript, wxALL, 5);
p->SetSizer(pSizer1);
Can you help me?
Thanks in advance
-
- Filthy Rich wx Solver
- Posts: 203
- Joined: Tue Aug 31, 2004 7:06 pm
- Location: Behind a can of Mountain Dew
- Contact:
It looks like you are missing a parameter in there (proportion). Try this:cr_itm wrote:Code: Select all
pSizer1->Add(pSizer1_1, wxEXPAND | wxALL, 5); pSizer1->Add(pSizer1_2, wxEXPAND | wxALL, 5); pSizer1_1->Add(pText_SimScript, wxALL, 5);
Code: Select all
pSizer1->Add(pSizer1_1, 0, wxEXPAND | wxALL, 5);
pSizer1->Add(pSizer1_2, 0, wxEXPAND | wxALL, 5);
pSizer1_1->Add(pText_SimScript, 0, wxALL, 5);