From 24e06054fc485e2d0cf6aade6dfd459a8db996e1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 12 May 2018 23:49:45 +0200 Subject: [PATCH] Remove wxAuiMDIChildFrame::DoShow() This method is confusing as it's not used for implementing Show(), which is the usual naming convention when both Foo() and DoFoo() members exist, and gives no clear indication about what does it really do. Just call wxWindow::Show() directly instead. Also create the wxAuiMDIChildFrame window hidden from the beginning, instead of creating it in a visible state and then hiding it. --- include/wx/aui/tabmdi.h | 1 - src/aui/auibook.cpp | 2 +- src/aui/tabmdi.cpp | 14 +++----------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/include/wx/aui/tabmdi.h b/include/wx/aui/tabmdi.h index 842e9dd805..3fa2b16993 100644 --- a/include/wx/aui/tabmdi.h +++ b/include/wx/aui/tabmdi.h @@ -168,7 +168,6 @@ public: // we needed this function to prevent anybody from the outside // changing the panel... it messes the UI layout when we would allow it. void ApplyMDIChildFrameRect(); - void DoShow(bool show); protected: wxAuiMDIParentFrame* m_pMDIParentFrame; diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index f01a58c46b..0a37a469ba 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -930,7 +930,7 @@ static void ShowWnd(wxWindow* wnd, bool show) if (wxDynamicCast(wnd, wxAuiMDIChildFrame)) { wxAuiMDIChildFrame* cf = (wxAuiMDIChildFrame*)wnd; - cf->DoShow(show); + cf->wxWindow::Show(show); } else #endif diff --git a/src/aui/tabmdi.cpp b/src/aui/tabmdi.cpp index 30a781cbc8..c088931844 100644 --- a/src/aui/tabmdi.cpp +++ b/src/aui/tabmdi.cpp @@ -496,17 +496,14 @@ bool wxAuiMDIChildFrame::Create(wxAuiMDIParentFrame* parent, if (style & wxMINIMIZE) m_activateOnCreate = false; - wxSize cli_size = pClientWindow->GetClientSize(); - - // create the window off-screen to prevent flicker + // create the window hidden to prevent flicker + wxWindow::Show(false); wxWindow::Create(pClientWindow, id, - wxPoint(cli_size.x+1, cli_size.y+1), + wxDefaultPosition, size, wxNO_BORDER, name); - DoShow(false); - SetMDIParentFrame(parent); m_title = title; @@ -717,11 +714,6 @@ bool wxAuiMDIChildFrame::Show(bool show) return true; } -void wxAuiMDIChildFrame::DoShow(bool show) -{ - wxWindow::Show(show); -} - //----------------------------------------------------------------------------- // wxAuiMDIClientWindow //-----------------------------------------------------------------------------