Difference between max size, best size and min size ? 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
Rocketmagnet
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Aug 09, 2006 11:14 pm
Location: London
Contact:

Difference between max size, best size and min size ?

Post by Rocketmagnet »

Hi all,

Reading about sizers ... a windows seems to have a min size, best size and max size.

Min and max size seem to be pretty obvious, what's exactly is the point of the best size?

My guess would be that, if there's plenty of room available, then don't make it bigger than the best size. In which case, there's no need for a max size.

Many thanks

Hugo
Grrr
Earned some good credits
Earned some good credits
Posts: 126
Joined: Fri Apr 11, 2008 8:48 am
Location: Netherlands

Post by Grrr »

AFAIK the best size is the preferred size of the control. When you call wxWindows::Fit() on the parent window, it tries to honour this best size.

When the user resizes the parent windows, the minimum and maximum size is limited by the min and max sizes of the controls.
Infinity_77
Experienced Solver
Experienced Solver
Posts: 89
Joined: Tue Oct 03, 2006 6:30 pm
Location: London, UK
Contact:

Re: Difference between max size, best size and min size ?

Post by Infinity_77 »

Hi,
Rocketmagnet wrote:Hi all,

Reading about sizers ... a windows seems to have a min size, best size and max size.

Min and max size seem to be pretty obvious, what's exactly is the point of the best size?

My guess would be that, if there's plenty of room available, then don't make it bigger than the best size. In which case, there's no need for a max size.

Many thanks

Hugo
Try here:

http://wiki.wxpython.org/WindowSizeInfo

It's wxPython, but it doesn't make much difference :-D

HTH.

Andrea.
"Imagination Is The Only Weapon In The War Against Reality."

http://xoomer.alice.it/infinity77/
Rocketmagnet
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Aug 09, 2006 11:14 pm
Location: London
Contact:

Post by Rocketmagnet »

Thanks Infinity_77,

That's pretty helpful.

So, is this correct:

Min and Max size are used when it's the outer window whose size is being set externally (for example by the user dragging it). The Min size prevents the user making the window smaller than that. Similarly with Max size.

Best size is used when the outer window is told to automatically resize itself to whatever size would be best for its children.

I.E. Min and Max are used when size information is flowing from parent to child. Best size is used when size information is flowing from child to parent.

Hugo
Post Reply