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.
This commit is contained in:
Vadim Zeitlin
2018-05-12 23:49:45 +02:00
parent ceee16c01a
commit 24e06054fc
3 changed files with 4 additions and 13 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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
//-----------------------------------------------------------------------------