From 5b56498f882a9e3d36cd38a2d3a73dee26bdc28c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 6 May 2014 18:20:38 +0000 Subject: [PATCH] Allow using sizers for laying out wxMDIClientWindow in wxMSW. Let the user code put wxMDIParentFrame::GetClientWindow() into a sizer and manage it as any other window, instead of having to do it manually. Closes #16196. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/mdi.cpp | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 1fda7713ec..4b733c3c2c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -69,6 +69,7 @@ wxMSW: - Add support for saving 256*256 32bpp ICOs in PNG format (Artur Wieczorek). - Keep menu item icon after removing and adding it back (Artur Wieczorek). - Add wxThread::MSWGetHandle() (troelsk). +- Allow using sizers for laying out wxMDIClientWindow (Artur Wieczorek). wxOSX/Cocoa: diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index e72a8b1eb8..e2e47e8577 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -38,6 +38,7 @@ #include "wx/settings.h" #include "wx/intl.h" #include "wx/log.h" + #include "wx/sizer.h" #include "wx/toolbar.h" #endif @@ -467,12 +468,17 @@ WXHMENU wxMDIParentFrame::MSWGetActiveMenu() const void wxMDIParentFrame::UpdateClientSize() { - if ( GetClientWindow() ) - { - int width, height; - GetClientSize(&width, &height); + int width, height; + GetClientSize(&width, &height); - GetClientWindow()->SetSize(0, 0, width, height); + if ( wxSizer* sizer = GetSizer() ) + { + sizer->SetDimension(0, 0, width, height); + } + else + { + if ( GetClientWindow() ) + GetClientWindow()->SetSize(0, 0, width, height); } }