From: David Elliott Date: Thu, 12 Jun 2003 13:41:05 +0000 (+0000) Subject: Make wxMDIParentFrame a regular top level window X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/be7a101366995b7b7bb76e3d5b1e7dd8fc9a1af8 Make wxMDIParentFrame a regular top level window - Override DoGetClientSize for wxMDIClientWindow instead of wxMDIParentFrame - Do not override OnSize for wxMDIParentFrame git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/mdi.h b/include/wx/mac/mdi.h index df6eb3b412..c66b4ee2c3 100644 --- a/include/wx/mac/mdi.h +++ b/include/wx/mac/mdi.h @@ -54,17 +54,11 @@ public: long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxFrameNameStr); - void OnSize(wxSizeEvent& event); void OnActivate(wxActivateEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); void SetMenuBar(wxMenuBar *menu_bar); - // Gets the size available for subwindows after menu size, toolbar size - // and status bar size have been subtracted. If you want to manage your own - // toolbar(s), don't call SetToolBar. - void DoGetClientSize(int *width, int *height) const; - // Get the active MDI child window (Windows only) wxMDIChildFrame *GetActiveChild() const ; @@ -162,6 +156,11 @@ class WXDLLEXPORT wxMDIClientWindow: public wxWindow // Note: this is virtual, to allow overridden behaviour. virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL); + // Gets the size available for subwindows after menu size, toolbar size + // and status bar size have been subtracted. If you want to manage your own + // toolbar(s), don't call SetToolBar. + void DoGetClientSize(int *width, int *height) const; + // Explicitly call default scroll behaviour void OnScroll(wxScrollEvent& event); diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index 1d9e43f170..de481635e2 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -27,7 +27,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_SIZE(wxMDIParentFrame::OnSize) EVT_ACTIVATE(wxMDIParentFrame::OnActivate) EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) END_EVENT_TABLE() @@ -123,32 +122,11 @@ wxMDIParentFrame::~wxMDIParentFrame() } -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIParentFrame::DoGetClientSize(int *x, int *y) const -{ - wxDisplaySize( x , y ) ; -} - void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) { wxFrame::SetMenuBar( menu_bar ) ; } -void wxMDIParentFrame::OnSize(wxSizeEvent& event) -{ -#if wxUSE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif - int x = 0; - int y = 0; - int width, height; - GetClientSize(&width, &height); - - if ( GetClientWindow() ) - GetClientWindow()->SetSize(x, y, width, height); -} - void wxMDIParentFrame::OnActivate(wxActivateEvent& event) { if ( m_currentChild && event.GetActive() ) @@ -308,6 +286,12 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) return TRUE; } +// Get size *available for subwindows* i.e. excluding menu bar. +void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const +{ + wxDisplaySize( x , y ) ; +} + // Explicitly call default scroll behaviour void wxMDIClientWindow::OnScroll(wxScrollEvent& event) { diff --git a/src/mac/mdi.cpp b/src/mac/mdi.cpp index 1d9e43f170..de481635e2 100644 --- a/src/mac/mdi.cpp +++ b/src/mac/mdi.cpp @@ -27,7 +27,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxMDIClientWindow, wxWindow) BEGIN_EVENT_TABLE(wxMDIParentFrame, wxFrame) - EVT_SIZE(wxMDIParentFrame::OnSize) EVT_ACTIVATE(wxMDIParentFrame::OnActivate) EVT_SYS_COLOUR_CHANGED(wxMDIParentFrame::OnSysColourChanged) END_EVENT_TABLE() @@ -123,32 +122,11 @@ wxMDIParentFrame::~wxMDIParentFrame() } -// Get size *available for subwindows* i.e. excluding menu bar. -void wxMDIParentFrame::DoGetClientSize(int *x, int *y) const -{ - wxDisplaySize( x , y ) ; -} - void wxMDIParentFrame::SetMenuBar(wxMenuBar *menu_bar) { wxFrame::SetMenuBar( menu_bar ) ; } -void wxMDIParentFrame::OnSize(wxSizeEvent& event) -{ -#if wxUSE_CONSTRAINTS - if (GetAutoLayout()) - Layout(); -#endif - int x = 0; - int y = 0; - int width, height; - GetClientSize(&width, &height); - - if ( GetClientWindow() ) - GetClientWindow()->SetSize(x, y, width, height); -} - void wxMDIParentFrame::OnActivate(wxActivateEvent& event) { if ( m_currentChild && event.GetActive() ) @@ -308,6 +286,12 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) return TRUE; } +// Get size *available for subwindows* i.e. excluding menu bar. +void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const +{ + wxDisplaySize( x , y ) ; +} + // Explicitly call default scroll behaviour void wxMDIClientWindow::OnScroll(wxScrollEvent& event) {