Sizer bug... or programmer bug...? Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Sizer bug... or programmer bug...?

Post by acsMike » Thu Oct 12, 2006 1:14 pm

Hi,
I am filling a wxScrolledWindow with a lot of sub-panels using this hiearchy:

wxScrolledWindow ->wxBoxSizer(vertical) -> wxPanel

There is about 10 sub panels, totally occupying a virtual height 2-3 times that of the wxScrolledWindow. Each sub panel is of different height, but my problem is that in the scrolled window, after Fit'ing and Layout'ing it, all sub panels are resized to equal height, namely that of the talleest sub panel.

This inserts alot of white space between those who should have been smaller. Am I doing something obviously wrong? Some known problem with wxBoxSizer or wxScrolledWindow?

Thanks for reading all the way to the bottom!
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

phlox81
wxWorld Domination!
wxWorld Domination!
Posts: 1387
Joined: Thu Aug 18, 2005 7:49 pm
Location: Germany
Contact:

Post by phlox81 » Thu Oct 12, 2006 1:35 pm

Maybe you should use wxFlexBoxSizer.

acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Post by acsMike » Thu Oct 12, 2006 1:42 pm

phlox81 wrote:Maybe you should use wxFlexBoxSizer.
Perhaps if I knew what it was, but I can't find it in the docs. So do you mean there is a bug in wxBoxSizer that wxFlexBoxSizer can fix?
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

Jorg
Moderator
Moderator
Posts: 3971
Joined: Fri Aug 27, 2004 9:38 pm
Location: Delft, Netherlands
Contact:

Post by Jorg » Thu Oct 12, 2006 1:48 pm

wxFlexBoxSizer does not exist, I think he meant wxFlexGridSizer. That one you can select which rows / columns are growable and which are not.

- Jorgen
Forensic Software Engineer
Netherlands Forensic Insitute
http://english.forensischinstituut.nl/
-------------------------------------
Jorg's WasteBucket
http://www.xs4all.nl/~jorgb/wb

acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Post by acsMike » Thu Oct 12, 2006 1:53 pm

Jorg wrote:wxFlexBoxSizer does not exist, I think he meant wxFlexGridSizer. That one you can select which rows / columns are growable and which are not.

- Jorgen
Ah, searching the web came up with nothing, so I suppose that was it. I could try wxFlexGridSizer. But still don't understand why all panels grow to equal size? I though they where suppose to shrink to minimum size when Fit'ing?
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

acsMike
I live to help wx-kind
I live to help wx-kind
Posts: 153
Joined: Fri Feb 11, 2005 9:05 am
Location: Stockholm, Sweden

Post by acsMike » Thu Oct 12, 2006 1:57 pm

Jorg wrote:wxFlexBoxSizer does not exist, I think he meant wxFlexGridSizer. That one you can select which rows / columns are growable and which are not.

- Jorgen
This works perfectly! Thanks both. It now looks much better :-)
/Michael Ljunggren, developer
Peavey Electronics

Windows: 2.6.3, 2.8.9 (VS2005) ** Mac: 2.6.3 (XCode 3) ** WinCE: 2.8.9 (VS2005), ** GTK: 2.8.9 (Kdevelop)

Post Reply