]> git.saurik.com Git - wxWidgets.git/commitdiff
resize fun
authorRobert Roebling <robert@roebling.de>
Wed, 17 Feb 1999 10:13:12 +0000 (10:13 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 17 Feb 1999 10:13:12 +0000 (10:13 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/dialog.cpp
src/gtk/frame.cpp
src/gtk1/dialog.cpp
src/gtk1/frame.cpp

index b8c54679b7dbe8fb51c42ffc644ab6fefaaa1488..2efbf3b285976047a6f6404aea230717c5654745 100644 (file)
@@ -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 );
 }
index d48501ac9d10795a7f8a633b7b8eecb365e8d5f6..796b55629f90312e14bf14b47557e658d61cbad5 100644 (file)
@@ -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
index b8c54679b7dbe8fb51c42ffc644ab6fefaaa1488..2efbf3b285976047a6f6404aea230717c5654745 100644 (file)
@@ -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 );
 }
index d48501ac9d10795a7f8a633b7b8eecb365e8d5f6..796b55629f90312e14bf14b47557e658d61cbad5 100644 (file)
@@ -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