Merge branch 'tlw-layout'

Make wxTLW::Layout() do the right thing and resize the only child to fit
the entire TLW client area.

See https://github.com/wxWidgets/wxWidgets/pull/1496
This commit is contained in:
Vadim Zeitlin
2019-08-27 13:08:47 +02:00
7 changed files with 50 additions and 21 deletions

View File

@@ -276,9 +276,13 @@ public:
virtual bool IsTopNavigationDomain(NavigationKind kind) const wxOVERRIDE;
virtual bool IsVisible() const { return IsShown(); }
// override to do TLW-specific layout: we resize our unique child to fill
// the entire client area
virtual bool Layout() wxOVERRIDE;
// event handlers
void OnCloseWindow(wxCloseEvent& event);
void OnSize(wxSizeEvent& WXUNUSED(event)) { DoLayout(); }
void OnSize(wxSizeEvent& WXUNUSED(event)) { Layout(); }
// Get rect to be used to center top-level children
virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h);
@@ -326,9 +330,8 @@ protected:
// send the iconize event, return true if processed
bool SendIconizeEvent(bool iconized = true);
// do TLW-specific layout: we resize our unique child to fill the entire
// client area
void DoLayout();
// this method is only kept for compatibility, call Layout() instead.
void DoLayout() { Layout(); }
static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; }
static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; }