From f5eafd0e55812155780cc9ec2910ac25fd1629e7 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 17 Feb 1999 10:13:12 +0000 Subject: [PATCH] resize fun git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/dialog.cpp | 6 +++--- src/gtk/frame.cpp | 13 +++++-------- src/gtk1/dialog.cpp | 6 +++--- src/gtk1/frame.cpp | 13 +++++-------- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index b8c54679b7..2efbf3b285 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -385,13 +385,13 @@ void wxDialog::SetSize( int width, int height ) void wxDialog::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), "invalid frame" ); + wxASSERT_MSG( (m_widget != NULL), "invalid dialog" ); int x = 0; int y = 0; - if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; - if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; + if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; + if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; Move( x, y ); } diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index d48501ac9d..796b55629f 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -164,7 +164,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_window_set_title( GTK_WINDOW(m_widget), title ); GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); - gtk_widget_set( m_widget, "GtkWindow::allow_shrink", TRUE, NULL ); + gtk_window_set_policy( GTK_WINDOW(m_widget), 1, 1, 0 ); gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event", GTK_SIGNAL_FUNC(gtk_frame_delete_callback), (gpointer)this ); @@ -313,13 +313,9 @@ void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_width != old_width) || (m_height != old_height)) { - gtk_widget_set_usize( m_widget, m_width, m_height ); + m_sizeSet = FALSE; } - wxSizeEvent event( wxSize(m_width,m_height), GetId() ); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); - m_resizing = FALSE; } @@ -335,8 +331,8 @@ void wxFrame::Centre( int direction ) int x = 0; int y = 0; - if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; - if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; + if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; + if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; Move( x, y ); } @@ -400,6 +396,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; gtk_widget_set_usize( m_widget, m_width, m_height ); + gdk_window_resize( m_widget->window, m_width, m_height ); // this emulates the new wxMSW behaviour of placing all // frame-subwindows (menu, toolbar..) on one native window diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index b8c54679b7..2efbf3b285 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -385,13 +385,13 @@ void wxDialog::SetSize( int width, int height ) void wxDialog::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), "invalid frame" ); + wxASSERT_MSG( (m_widget != NULL), "invalid dialog" ); int x = 0; int y = 0; - if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; - if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; + if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; + if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; Move( x, y ); } diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index d48501ac9d..796b55629f 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -164,7 +164,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_window_set_title( GTK_WINDOW(m_widget), title ); GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); - gtk_widget_set( m_widget, "GtkWindow::allow_shrink", TRUE, NULL ); + gtk_window_set_policy( GTK_WINDOW(m_widget), 1, 1, 0 ); gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event", GTK_SIGNAL_FUNC(gtk_frame_delete_callback), (gpointer)this ); @@ -313,13 +313,9 @@ void wxFrame::SetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_width != old_width) || (m_height != old_height)) { - gtk_widget_set_usize( m_widget, m_width, m_height ); + m_sizeSet = FALSE; } - wxSizeEvent event( wxSize(m_width,m_height), GetId() ); - event.SetEventObject( this ); - GetEventHandler()->ProcessEvent( event ); - m_resizing = FALSE; } @@ -335,8 +331,8 @@ void wxFrame::Centre( int direction ) int x = 0; int y = 0; - if (direction & wxHORIZONTAL == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; - if (direction & wxVERTICAL == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; + if ((direction & wxHORIZONTAL) == wxHORIZONTAL) x = (gdk_screen_width () - m_width) / 2; + if ((direction & wxVERTICAL) == wxVERTICAL) y = (gdk_screen_height () - m_height) / 2; Move( x, y ); } @@ -400,6 +396,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; gtk_widget_set_usize( m_widget, m_width, m_height ); + gdk_window_resize( m_widget->window, m_width, m_height ); // this emulates the new wxMSW behaviour of placing all // frame-subwindows (menu, toolbar..) on one native window -- 2.47.2