Fix XRC sample main frame initial and minimal size.

The size hints must be explicitly set if tool and/or status bars are added to
the frame after loading its contents from XRC. This didn't matter before
because the (only) item of the frame sizer effectively had wxGROW style and so
adjusted to the frame size even if it was less than the minimal size, but now
that wxALIGN_CENTER_VERTICAL, which was always specified in rc/frame.xrc file
but never taken into account before, is honoured, the initial frame size is
not big enough to show its contents which looks ugly, so work around this.
This commit is contained in:
Vadim Zeitlin
2015-04-06 02:13:18 +02:00
parent a5988a0389
commit 45effb085a

View File

@@ -133,6 +133,11 @@ MyFrame::MyFrame(wxWindow* parent)
// here.
CreateStatusBar( 1 );
#endif // wxUSE_STATUSBAR
// As we have created the toolbar and status bar after loading the main
// frame from resources, we need to readjust its minimal size to fit both
// its client area contains and the bars.
GetSizer()->SetSizeHints(this);
}
//-----------------------------------------------------------------------------