From: Vadim Zeitlin Date: Sat, 14 May 2011 14:18:20 +0000 (+0000) Subject: Fix small error in floating AUI frames client size under wxMSW. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/efd516c29bb56a737f91d096477df300755e712c Fix small error in floating AUI frames client size under wxMSW. The client size of the floating frames ended up being wrong because we changed the wxRESIZE_BORDER flag after setting it and this changed it (at least under MSW). Reset wxRESIZE_BORDER first now and set the client size correctly afterwards. Closes #13043. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/floatpane.cpp b/src/aui/floatpane.cpp index 9fafc9976d..05740acecb 100644 --- a/src/aui/floatpane.cpp +++ b/src/aui/floatpane.cpp @@ -123,7 +123,22 @@ void wxAuiFloatingFrame::SetPaneWindow(const wxAuiPaneInfo& pane) SetTitle(pane.caption); - if (pane.floating_size != wxDefaultSize) + // This code is slightly awkward because we need to reset wxRESIZE_BORDER + // before calling SetClientSize() below as doing it after setting the + // client size would actually change it, at least under MSW, where the + // total window size doesn't change and hence, as the borders size changes, + // the client size does change. + // + // So we must call it first but doing it generates a size event and updates + // pane.floating_size from inside it so we must also record its original + // value before doing it. + const bool hasFloatingSize = pane.floating_size != wxDefaultSize; + if (pane.IsFixed()) + { + SetWindowStyleFlag(GetWindowStyleFlag() & ~wxRESIZE_BORDER); + } + + if ( hasFloatingSize ) { SetSize(pane.floating_size); } @@ -144,11 +159,6 @@ void wxAuiFloatingFrame::SetPaneWindow(const wxAuiPaneInfo& pane) SetClientSize(size); } - - if (pane.IsFixed()) - { - SetWindowStyleFlag(GetWindowStyleFlag() & ~wxRESIZE_BORDER); - } } wxAuiManager* wxAuiFloatingFrame::GetOwnerManager() const