If I use the code generated by the patched cb the min size of the window is not set, so I can shrink it smaller then the content.
I just tested a frame and with 'Lay out the window' turned off you can resize the frame to any size you want. With it on (the default) you can't resize below the minimum size that fits all controls. That is the expected behaviour.
I have "Default min size" checked.
I'm always confused by this min size stuff, so I don't know if this is a regression or not but it is a change in behaviour.
Size sets the initial size of the window, overriding the layout system.
Min size sets the minimum size of the window. This will override the layout system if the layout could be smaller.
Max size sets the maximum size of the window. This will override the layout system if the layout should be bigger.
Manually setting these sizes is really not a good idea in most cases. SetSizeHints sets these automatically, based on the ideal minimum and maximum sizes reported by the layout system.
I just ran some tests and noticed a bug that has been around for a very long time. As SetSizeHints was called for every sizer, it overrode whatever sizes you entered. This probably explains why you found them confusing. They actually did nothing. I've also been caught out by this a few times.
With the attached patch, size, min size and max size should work correctly. For top level windows with 'Lay out window' selected it gets a little complicated.
- If size, min and max are set to default, SetSizeHints() is used. The layout system is free to decide the optimum window layout and sizes.
- If size is default but min and/or max are not, Fit() is used. This sets size to the optimum decided by the layout system while still obeying min and max size. Depending on min/max size the layout may not fit.
- If size is not default Layout() is used. This makes the layout system try to fit to your defined size. The layout probably will not fit.
The attached patch has these changes:
- The above changes depending on what defaults are used
- The missing files
- Fixed 'Lay out the window' selection not being saved correctly.
- Fixed SetSizer() sometimes being called twice on top level windows