From ac0c857aaa9b48724ed973a3fd28cdf7afaee530 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 2 Jun 2002 14:24:29 +0000 Subject: [PATCH] Overrode wxMDIChildFrame's DoSetSize to not misplace the window when it was using wxFrame's method. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/mdi.h | 5 +++++ include/wx/gtk1/mdi.h | 5 +++++ src/gtk/mdi.cpp | 21 ++++++++++----------- src/gtk1/mdi.cpp | 21 ++++++++++----------- 4 files changed, 30 insertions(+), 22 deletions(-) diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index 5dd2ae1762..97819e9c1b 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -184,6 +184,11 @@ public: bool m_justInserted; protected: + // override wxFrame methods to not do anything + virtual void DoSetSize(int x, int y, + int width, int height, + int sizeFlags = wxSIZE_AUTO); + virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize( int *width, int *height ) const; private: diff --git a/include/wx/gtk1/mdi.h b/include/wx/gtk1/mdi.h index 5dd2ae1762..97819e9c1b 100644 --- a/include/wx/gtk1/mdi.h +++ b/include/wx/gtk1/mdi.h @@ -184,6 +184,11 @@ public: bool m_justInserted; protected: + // override wxFrame methods to not do anything + virtual void DoSetSize(int x, int y, + int width, int height, + int sizeFlags = wxSIZE_AUTO); + virtual void DoSetClientSize(int width, int height); virtual void DoGetClientSize( int *width, int *height ) const; private: diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 99bcb7ede4..958a372944 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -237,11 +237,7 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget); if (!notebook) return (wxMDIChildFrame*) NULL; -#if (GTK_MINOR_VERSION > 0) gint i = gtk_notebook_get_current_page( notebook ); -#else - gint i = gtk_notebook_current_page( notebook ); -#endif if (i < 0) return (wxMDIChildFrame*) NULL; GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data); @@ -325,6 +321,16 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent, return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name ); } +void wxMDIChildFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) +{ + wxWindow::DoSetSize( x, y, width, height, sizeFlags ); +} + +void wxMDIChildFrame::DoSetClientSize(int width, int height) +{ + wxWindow::DoSetClientSize( width, height ); +} + void wxMDIChildFrame::DoGetClientSize( int *width, int *height ) const { wxWindow::DoGetClientSize( width, height ); @@ -361,17 +367,10 @@ wxMenuBar *wxMDIChildFrame::GetMenuBar() const void wxMDIChildFrame::Activate() { -#if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0) wxMDIParentFrame* parent = (wxMDIParentFrame*) GetParent(); GtkNotebook* notebook = GTK_NOTEBOOK(parent->m_widget); gint pageno = gtk_notebook_page_num( notebook, m_widget ); gtk_notebook_set_page( notebook, pageno ); -#else // GTK+ 1.0 - // the only way I can see to do this under gtk+ 1.0.X would - // be to keep track of page numbers, start at first and - // do "next" enough times to get to this page number - messy - // - J. Russell Smyth -#endif } void wxMDIChildFrame::OnActivate( wxActivateEvent& WXUNUSED(event) ) diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 99bcb7ede4..958a372944 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -237,11 +237,7 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget); if (!notebook) return (wxMDIChildFrame*) NULL; -#if (GTK_MINOR_VERSION > 0) gint i = gtk_notebook_get_current_page( notebook ); -#else - gint i = gtk_notebook_current_page( notebook ); -#endif if (i < 0) return (wxMDIChildFrame*) NULL; GtkNotebookPage* page = (GtkNotebookPage*) (g_list_nth(notebook->children,i)->data); @@ -325,6 +321,16 @@ bool wxMDIChildFrame::Create( wxMDIParentFrame *parent, return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name ); } +void wxMDIChildFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) +{ + wxWindow::DoSetSize( x, y, width, height, sizeFlags ); +} + +void wxMDIChildFrame::DoSetClientSize(int width, int height) +{ + wxWindow::DoSetClientSize( width, height ); +} + void wxMDIChildFrame::DoGetClientSize( int *width, int *height ) const { wxWindow::DoGetClientSize( width, height ); @@ -361,17 +367,10 @@ wxMenuBar *wxMDIChildFrame::GetMenuBar() const void wxMDIChildFrame::Activate() { -#if defined(__WXGTK20__) || (GTK_MINOR_VERSION > 0) wxMDIParentFrame* parent = (wxMDIParentFrame*) GetParent(); GtkNotebook* notebook = GTK_NOTEBOOK(parent->m_widget); gint pageno = gtk_notebook_page_num( notebook, m_widget ); gtk_notebook_set_page( notebook, pageno ); -#else // GTK+ 1.0 - // the only way I can see to do this under gtk+ 1.0.X would - // be to keep track of page numbers, start at first and - // do "next" enough times to get to this page number - messy - // - J. Russell Smyth -#endif } void wxMDIChildFrame::OnActivate( wxActivateEvent& WXUNUSED(event) ) -- 2.45.2