Page 1 of 1

Move window inside a Sizer

Posted: Tue Jun 22, 2010 8:08 am
by duarteroso

I'm searching for a way to place my windows inside a wxBoxSizer.
Right now, I have a BoxSizer and I'm trying to put a ComboBox and a ScrolledWindow side by side. But it seems that the sizer does not allow it, instead he put the ScrolledWindow under the ComboBox.


Posted: Tue Jun 22, 2010 8:16 am
by jfouche
The is a parameter when you create the wxBoxSizer :

from doc :
wxBoxSizer(int orient)

Constructor for a wxBoxSizer. orient may be either of wxVERTICAL or wxHORIZONTAL for creating either a column sizer or a row sizer.

Posted: Tue Jun 22, 2010 8:32 am
by duarteroso
In my case, i want both.

What I would like to have is almost like GarageBand or Magix Music Maker:
ComboBox ScrolledWindow
ComboBox ScrolledWindow
...and so on

Using the wxHORIZONTAL flag won't do the trick.

Posted: Tue Jun 22, 2010 8:41 am
by jfouche
Ok, what you want is probably a wxFlexGridSizer

I suggest you to try the sizer sample provided with wxWidgets to see all available sizers, and take the one you need.

[edit] : you can also have a look here

Posted: Tue Jun 22, 2010 9:06 am
by duarteroso
Thanks a lot.

I'll look around for some tips :wink: