Remove sizing hacks from wxAuiMDIChildFrame

There doesn't seem to be any reason for overriding DoSetSize() and
DoMoveWindow(), so just stop doing it.

Notice that this was already changed for wxGTK many years ago in
a94476deb9 and there is no reason to use
different code wxGTK and other ports.
This commit is contained in:
Vadim Zeitlin
2018-05-12 23:57:42 +02:00
parent c1bcf16eb9
commit ceee16c01a
3 changed files with 0 additions and 48 deletions

View File

@@ -162,8 +162,6 @@ public:
protected:
void Init();
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE;
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE;
public:
// This function needs to be called when a size change is confirmed,
@@ -174,8 +172,6 @@ public:
protected:
wxAuiMDIParentFrame* m_pMDIParentFrame;
wxRect m_mdiNewRect;
wxRect m_mdiCurRect;
wxIcon m_icon;
wxIconBundle m_iconBundle;
bool m_activateOnCreate;
@@ -218,7 +214,6 @@ protected:
void PageChanged(int oldSelection, int newSelection);
void OnPageClose(wxAuiNotebookEvent& evt);
void OnPageChanged(wxAuiNotebookEvent& evt);
void OnSize(wxSizeEvent& evt);
private:
wxDECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow);

View File

@@ -1595,14 +1595,6 @@ public:
}
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
#if wxUSE_MDI
if (wxDynamicCast(page.window, wxAuiMDIChildFrame))
{
wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window;
wnd->ApplyMDIChildFrameRect();
}
#endif
}
}

View File

@@ -722,32 +722,6 @@ void wxAuiMDIChildFrame::DoShow(bool show)
wxWindow::Show(show);
}
void wxAuiMDIChildFrame::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{
m_mdiNewRect = wxRect(x, y, width, height);
#ifdef __WXGTK__
wxWindow::DoSetSize(x,y,width, height, sizeFlags);
#else
wxUnusedVar(sizeFlags);
#endif
}
void wxAuiMDIChildFrame::DoMoveWindow(int x, int y, int width, int height)
{
m_mdiNewRect = wxRect(x, y, width, height);
}
void wxAuiMDIChildFrame::ApplyMDIChildFrameRect()
{
if (m_mdiCurRect != m_mdiNewRect)
{
wxWindow::DoMoveWindow(m_mdiNewRect.x, m_mdiNewRect.y,
m_mdiNewRect.width, m_mdiNewRect.height);
m_mdiCurRect = m_mdiNewRect;
}
}
//-----------------------------------------------------------------------------
// wxAuiMDIClientWindow
//-----------------------------------------------------------------------------
@@ -757,7 +731,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxAuiMDIClientWindow, wxAuiNotebook);
wxBEGIN_EVENT_TABLE(wxAuiMDIClientWindow, wxAuiNotebook)
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, wxAuiMDIClientWindow::OnPageChanged)
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, wxAuiMDIClientWindow::OnPageClose)
EVT_SIZE(wxAuiMDIClientWindow::OnSize)
wxEND_EVENT_TABLE()
wxAuiMDIClientWindow::wxAuiMDIClientWindow()
@@ -874,13 +847,5 @@ void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
PageChanged(evt.GetOldSelection(), evt.GetSelection());
}
void wxAuiMDIClientWindow::OnSize(wxSizeEvent& evt)
{
wxAuiNotebook::OnSize(evt);
for (size_t pos = 0; pos < GetPageCount(); pos++)
((wxAuiMDIChildFrame *)GetPage(pos))->ApplyMDIChildFrameRect();
}
#endif //wxUSE_AUI
#endif // wxUSE_MDI