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:
@@ -162,8 +162,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void Init();
|
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:
|
public:
|
||||||
// This function needs to be called when a size change is confirmed,
|
// This function needs to be called when a size change is confirmed,
|
||||||
@@ -174,8 +172,6 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxAuiMDIParentFrame* m_pMDIParentFrame;
|
wxAuiMDIParentFrame* m_pMDIParentFrame;
|
||||||
wxRect m_mdiNewRect;
|
|
||||||
wxRect m_mdiCurRect;
|
|
||||||
wxIcon m_icon;
|
wxIcon m_icon;
|
||||||
wxIconBundle m_iconBundle;
|
wxIconBundle m_iconBundle;
|
||||||
bool m_activateOnCreate;
|
bool m_activateOnCreate;
|
||||||
@@ -218,7 +214,6 @@ protected:
|
|||||||
void PageChanged(int oldSelection, int newSelection);
|
void PageChanged(int oldSelection, int newSelection);
|
||||||
void OnPageClose(wxAuiNotebookEvent& evt);
|
void OnPageClose(wxAuiNotebookEvent& evt);
|
||||||
void OnPageChanged(wxAuiNotebookEvent& evt);
|
void OnPageChanged(wxAuiNotebookEvent& evt);
|
||||||
void OnSize(wxSizeEvent& evt);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
wxDECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow);
|
wxDECLARE_DYNAMIC_CLASS(wxAuiMDIClientWindow);
|
||||||
|
@@ -1595,14 +1595,6 @@ public:
|
|||||||
}
|
}
|
||||||
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
|
// TODO: else if (GetFlags() & wxAUI_NB_LEFT){}
|
||||||
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
|
// TODO: else if (GetFlags() & wxAUI_NB_RIGHT){}
|
||||||
|
|
||||||
#if wxUSE_MDI
|
|
||||||
if (wxDynamicCast(page.window, wxAuiMDIChildFrame))
|
|
||||||
{
|
|
||||||
wxAuiMDIChildFrame* wnd = (wxAuiMDIChildFrame*)page.window;
|
|
||||||
wnd->ApplyMDIChildFrameRect();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -722,32 +722,6 @@ void wxAuiMDIChildFrame::DoShow(bool show)
|
|||||||
wxWindow::Show(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
|
// wxAuiMDIClientWindow
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@@ -757,7 +731,6 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxAuiMDIClientWindow, wxAuiNotebook);
|
|||||||
wxBEGIN_EVENT_TABLE(wxAuiMDIClientWindow, wxAuiNotebook)
|
wxBEGIN_EVENT_TABLE(wxAuiMDIClientWindow, wxAuiNotebook)
|
||||||
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, wxAuiMDIClientWindow::OnPageChanged)
|
EVT_AUINOTEBOOK_PAGE_CHANGED(wxID_ANY, wxAuiMDIClientWindow::OnPageChanged)
|
||||||
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, wxAuiMDIClientWindow::OnPageClose)
|
EVT_AUINOTEBOOK_PAGE_CLOSE(wxID_ANY, wxAuiMDIClientWindow::OnPageClose)
|
||||||
EVT_SIZE(wxAuiMDIClientWindow::OnSize)
|
|
||||||
wxEND_EVENT_TABLE()
|
wxEND_EVENT_TABLE()
|
||||||
|
|
||||||
wxAuiMDIClientWindow::wxAuiMDIClientWindow()
|
wxAuiMDIClientWindow::wxAuiMDIClientWindow()
|
||||||
@@ -874,13 +847,5 @@ void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
|
|||||||
PageChanged(evt.GetOldSelection(), evt.GetSelection());
|
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_AUI
|
||||||
#endif // wxUSE_MDI
|
#endif // wxUSE_MDI
|
||||||
|
Reference in New Issue
Block a user