]> git.saurik.com Git - wxWidgets.git/commitdiff
Restored wxSizeEvent code form last week -> wxGLCanvas
authorRobert Roebling <robert@roebling.de>
Sat, 16 Oct 1999 20:07:16 +0000 (20:07 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 16 Oct 1999 20:07:16 +0000 (20:07 +0000)
    probably broken again.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/gtk/frame.h
include/wx/gtk1/frame.h
samples/notebook/test.cpp
src/gtk/frame.cpp
src/gtk/notebook.cpp
src/gtk/win_gtk.c
src/gtk/window.cpp
src/gtk1/frame.cpp
src/gtk1/notebook.cpp
src/gtk1/win_gtk.c
src/gtk1/window.cpp

index 638c506b3d8c43b4653f311800e3ff185ba7ad0f..506ee744c2e70f8a0ab3e8d1c68889b9be6a8ff2 100644 (file)
@@ -60,7 +60,7 @@ public:
     bool Destroy();
 
     virtual bool Show( bool show );
-    virtual void Centre( int direction = wxHORIZONTAL );
+    virtual void Centre( int direction = wxBOTH );
 
 #if wxUSE_STATUSBAR
     virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
index 638c506b3d8c43b4653f311800e3ff185ba7ad0f..506ee744c2e70f8a0ab3e8d1c68889b9be6a8ff2 100644 (file)
@@ -60,7 +60,7 @@ public:
     bool Destroy();
 
     virtual bool Show( bool show );
-    virtual void Centre( int direction = wxHORIZONTAL );
+    virtual void Centre( int direction = wxBOTH );
 
 #if wxUSE_STATUSBAR
     virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
index e140f42cc5a807a2723fa35f15b76898d14c4798..c2dffe86fe4daa06f4eecf629f7b77ef691a441b 100644 (file)
@@ -112,6 +112,7 @@ void MyApp::InitTabView(wxNotebook* notebook, wxPanel* window)
                                          wxDefaultPosition, wxDefaultSize,
                                          5, animals,
                                          2, wxRA_SPECIFY_ROWS);
+
   c = new wxLayoutConstraints;
   c->left.SameAs(radiobox, wxLeft);
   c->height.AsIs();
index 6ecd18ed733eb3584d747ef45e1c5694c48250d8..539fb6c9b7e03984ad78264d45c438dc855315c5 100644 (file)
@@ -795,7 +795,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
     event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( event );
 
-/*
     // send size event to status bar
     if (m_frameStatusBar)
     {
@@ -803,7 +802,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
         event2.SetEventObject( m_frameStatusBar );
         m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
     }
-*/
 
     m_resizing = FALSE;
 }
index 7dae0780011d7950e813e30daba489a7956f19c7..2c275b44340b074da187b0a8db7ba98052b706c2 100644 (file)
@@ -113,7 +113,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
 {
     if (g_isIdle) 
         wxapp_install_idle_handler();
-    
+
     if ((win->m_x == alloc->x) &&
         (win->m_y == alloc->y) &&
         (win->m_width == alloc->width) &&
@@ -124,7 +124,28 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
     
     win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
 
-    if (win->GetAutoLayout()) win->Layout();
+    if (win->GetAutoLayout())
+    {
+        win->Layout();
+    }
+}
+
+//-----------------------------------------------------------------------------
+// "realize" from m_widget
+//-----------------------------------------------------------------------------
+
+/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize 
+   here in order to take repositioning before showing to take effect. */
+
+static gint
+gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
+{
+    if (g_isIdle)
+        wxapp_install_idle_handler();
+
+    gtk_widget_queue_resize( win->m_widget );
+
+    return FALSE;
 }
 
 //-----------------------------------------------------------------------------
@@ -213,6 +234,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation();
 
+    gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
+                            GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
+                           
     Show( TRUE );
 
     return TRUE;
index 18606b962e31048892612694e8b750d82bc45ccf..1c9d78426647ce9a53b028d64fcaf9314a9bfbf9 100644 (file)
@@ -393,7 +393,7 @@ gtk_myfixed_set_size (GtkMyFixed    *myfixed,
             if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
                gtk_widget_queue_resize (widget);
                    
-            break;
+            return;
         }
     }
 }
@@ -602,16 +602,6 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
 
     myfixed = GTK_MYFIXED (widget);
   
-    children = myfixed->children;
-    while (children)
-    {
-        child = children->data;
-        children = children->next;
-        gtk_myfixed_position_child (myfixed, child);
-        gtk_myfixed_allocate_child (myfixed, child);
-    }
-    
     widget->allocation = *allocation;
     
     if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
@@ -632,6 +622,16 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
         gdk_window_move_resize( widget->window, x, y, w, h );
         gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
     }
+    
+    children = myfixed->children;
+    while (children)
+    {
+        child = children->data;
+        children = children->next;
+        gtk_myfixed_position_child (myfixed, child);
+        gtk_myfixed_allocate_child (myfixed, child);
+    }
 }
 
 static void
@@ -666,56 +666,6 @@ gtk_myfixed_draw (GtkWidget    *widget,
     }
 }
 
-/*
-static void
-gtk_myfixed_draw_border (GtkMyFixed *myfixed)
-{
-    GtkWidget *widget;
-    
-    widget = GTK_WIDGET(myfixed);
-
-    if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
-        return;
-       
-    if (myfixed->shadow_type == GTK_MYSHADOW_OUT)
-    {
-        gtk_draw_shadow( widget->style,
-                         widget->window,
-                         GTK_STATE_NORMAL,
-                         GTK_SHADOW_OUT,
-                         0, 0,
-                        widget->allocation.width,
-                        widget->allocation.height );
-        return;
-    }
-
-    if (myfixed->shadow_type == GTK_MYSHADOW_IN)
-    {
-        gtk_draw_shadow( widget->style,
-                         widget->window,
-                         GTK_STATE_NORMAL,
-                         GTK_SHADOW_IN,
-                         0, 0,
-                        widget->allocation.width,
-                        widget->allocation.height );
-        return;
-    }
-    
-    if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
-    {
-        GdkGC *gc;
-       gc = gdk_gc_new( widget->window );
-        gdk_gc_set_foreground( gc, &widget->style->black );
-        gdk_draw_rectangle( widget->window, gc, FALSE, 
-                            0, 0, 
-                           widget->allocation.width-1,
-                           widget->allocation.height-1 );
-        gdk_gc_unref( gc );
-        return;
-    }
-}
-*/
-
 static gint
 gtk_myfixed_expose (GtkWidget      *widget,
                    GdkEventExpose *event)
@@ -820,23 +770,23 @@ gtk_myfixed_forall (GtkContainer *container,
                   GtkCallback   callback,
                   gpointer      callback_data)
 {
-  GtkMyFixed *myfixed;
-  GtkMyFixedChild *child;
-  GList *children;
+    GtkMyFixed *myfixed;
+    GtkMyFixedChild *child;
+    GList *children;
 
-  g_return_if_fail (container != NULL);
-  g_return_if_fail (GTK_IS_MYFIXED (container));
-  g_return_if_fail (callback != NULL);
+    g_return_if_fail (container != NULL);
+    g_return_if_fail (GTK_IS_MYFIXED (container));
+    g_return_if_fail (callback != NULL);
 
-  myfixed = GTK_MYFIXED (container);
+    myfixed = GTK_MYFIXED (container);
 
-  children = myfixed->children;
-  while (children)
+    children = myfixed->children;
+    while (children)
     {
-      child = children->data;
-      children = children->next;
+        child = children->data;
+        children = children->next;
 
-      (* callback) (child->widget, callback_data);
+        (* callback) (child->widget, callback_data);
     }
 }
 
@@ -848,31 +798,31 @@ static void
 gtk_myfixed_position_child (GtkMyFixed      *myfixed,
                           GtkMyFixedChild *child)
 {
-  gint x;
-  gint y;
+    gint x;
+    gint y;
 
-  x = child->x - myfixed->xoffset;
-  y = child->y - myfixed->yoffset;
+    x = child->x - myfixed->xoffset;
+    y = child->y - myfixed->yoffset;
 
-  if (IS_ONSCREEN (x,y))
+    if (IS_ONSCREEN (x,y))
     {
-      if (GTK_WIDGET_MAPPED (myfixed) &&
+        if (GTK_WIDGET_MAPPED (myfixed) &&
          GTK_WIDGET_VISIBLE (child->widget))
        {
-         if (!GTK_WIDGET_MAPPED (child->widget))
-           gtk_widget_map (child->widget);
+           if (!GTK_WIDGET_MAPPED (child->widget))
+               gtk_widget_map (child->widget);
        }
 
-      if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
-       GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
+        if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
+           GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
     }
-  else
+    else
     {
-      if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
-       GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
+        if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
+           GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
 
-      if (GTK_WIDGET_MAPPED (child->widget))
-       gtk_widget_unmap (child->widget);
+        if (GTK_WIDGET_MAPPED (child->widget))
+           gtk_widget_unmap (child->widget);
     }
 }
 
@@ -880,30 +830,30 @@ static void
 gtk_myfixed_allocate_child (GtkMyFixed      *myfixed,
                           GtkMyFixedChild *child)
 {
-  GtkAllocation allocation;
-  GtkRequisition requisition;
-
-  allocation.x = child->x - myfixed->xoffset;
-  allocation.y = child->y - myfixed->yoffset;
-  gtk_widget_get_child_requisition (child->widget, &requisition);
-  allocation.width = requisition.width;
-  allocation.height = requisition.height;
+    GtkAllocation allocation;
+    GtkRequisition requisition;
+
+    allocation.x = child->x - myfixed->xoffset;
+    allocation.y = child->y - myfixed->yoffset;
+    gtk_widget_get_child_requisition (child->widget, &requisition);
+    allocation.width = requisition.width;
+    allocation.height = requisition.height;
   
-  gtk_widget_size_allocate (child->widget, &allocation);
+    gtk_widget_size_allocate (child->widget, &allocation);
 }
 
 static void
 gtk_myfixed_position_children (GtkMyFixed *myfixed)
 {
-  GList *tmp_list;
+    GList *tmp_list;
 
-  tmp_list = myfixed->children;
-  while (tmp_list)
+    tmp_list = myfixed->children;
+    while (tmp_list)
     {
-      GtkMyFixedChild *child = tmp_list->data;
-      tmp_list = tmp_list->next;
+        GtkMyFixedChild *child = tmp_list->data;
+        tmp_list = tmp_list->next;
       
-      gtk_myfixed_position_child (myfixed, child);
+        gtk_myfixed_position_child (myfixed, child);
     }
 }
 
@@ -911,16 +861,17 @@ static void
 gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
                                       gpointer   cb_data)
 {
-  GtkMyFixedAdjData *data = cb_data;
+    GtkMyFixedAdjData *data = cb_data;
 
-  widget->allocation.x += data->dx;
-  widget->allocation.y += data->dy;
+    widget->allocation.x += data->dx;
+    widget->allocation.y += data->dy;
 
-  if (GTK_WIDGET_NO_WINDOW (widget) &&
-      GTK_IS_CONTAINER (widget))
-    gtk_container_forall (GTK_CONTAINER (widget), 
+    if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
+    {
+        gtk_container_forall (GTK_CONTAINER (widget), 
                          gtk_myfixed_adjust_allocations_recurse,
                          cb_data);
+    }
 }
 
 static void
index 1e1dcdc207a5546e34370b5f116cb31801cf2af5..3dfbae632d4eedbff81c69d6a4cca5e030ffbf57 100644 (file)
@@ -313,39 +313,6 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
 
 #endif // GTK_MINOR_VERSION > 0
 
-
-//-----------------------------------------------------------------------------
-// "size_allocate"
-//-----------------------------------------------------------------------------
-
-static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
-{
-    if (g_isIdle)
-        wxapp_install_idle_handler();
-
-    if (!win->m_hasVMT) 
-        return;
-
-    if (win->m_sizeSet)
-        return;
-       
-    win->m_sizeSet = TRUE;
-    
-/*
-    wxPrintf( "OnSize from " );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        wxPrintf( win->GetClassInfo()->GetClassName() );
-    wxPrintf( " %d %d %d %d\n", (int)alloc->x,
-                                (int)alloc->y,
-                                (int)alloc->width,
-                                (int)alloc->height );
-*/
-
-    wxSizeEvent event( win->GetSize(), win->GetId() );
-    event.SetEventObject( win );
-    win->GetEventHandler()->ProcessEvent( event );
-}
-
 //-----------------------------------------------------------------------------
 // key event conversion routines
 //-----------------------------------------------------------------------------
@@ -2069,13 +2036,6 @@ void wxWindow::PostCreation()
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
 
-    if (!m_isFrame)
-    {
-        /* frames have their own callback */
-        gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
-            GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
-    }
-
     if (m_wxwindow)
     {
         if (!m_noExpose)
@@ -2164,14 +2124,9 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
         m_y = y;
         m_width = width;
         m_height = height;
-
-        m_sizeSet = FALSE;
     }
     else
     {
-        int old_width = m_width;
-       int old_height = m_height;
-       
         GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
        
         if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
@@ -2220,19 +2175,19 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
                               m_y-border,
                               m_width+2*border,
                               m_height+border+bottom_border );
-
-        if ((old_width != m_width) ||
-           (old_height != m_height))
-       {
-           m_sizeSet = FALSE;
-       }
     }
-
+    
 /*
+    wxPrintf( "OnSize sent from " );
+    if (GetClassInfo() && GetClassInfo()->GetClassName())
+        wxPrintf( GetClassInfo()->GetClassName() );
+    wxPrintf( " %d %d %d %d\n", (int)m_x, (int)m_y, (int)m_width, (int)m_height );
+*/
+
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
     event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( event );
-*/
+
     m_resizing = FALSE;
 }
 
index 6ecd18ed733eb3584d747ef45e1c5694c48250d8..539fb6c9b7e03984ad78264d45c438dc855315c5 100644 (file)
@@ -795,7 +795,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
     event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( event );
 
-/*
     // send size event to status bar
     if (m_frameStatusBar)
     {
@@ -803,7 +802,6 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height
         event2.SetEventObject( m_frameStatusBar );
         m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
     }
-*/
 
     m_resizing = FALSE;
 }
index 7dae0780011d7950e813e30daba489a7956f19c7..2c275b44340b074da187b0a8db7ba98052b706c2 100644 (file)
@@ -113,7 +113,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
 {
     if (g_isIdle) 
         wxapp_install_idle_handler();
-    
+
     if ((win->m_x == alloc->x) &&
         (win->m_y == alloc->y) &&
         (win->m_width == alloc->width) &&
@@ -124,7 +124,28 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
     
     win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
 
-    if (win->GetAutoLayout()) win->Layout();
+    if (win->GetAutoLayout())
+    {
+        win->Layout();
+    }
+}
+
+//-----------------------------------------------------------------------------
+// "realize" from m_widget
+//-----------------------------------------------------------------------------
+
+/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize 
+   here in order to take repositioning before showing to take effect. */
+
+static gint
+gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
+{
+    if (g_isIdle)
+        wxapp_install_idle_handler();
+
+    gtk_widget_queue_resize( win->m_widget );
+
+    return FALSE;
 }
 
 //-----------------------------------------------------------------------------
@@ -213,6 +234,9 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id,
 
     PostCreation();
 
+    gtk_signal_connect( GTK_OBJECT(m_widget), "realize",
+                            GTK_SIGNAL_FUNC(gtk_notebook_realized_callback), (gpointer) this );
+                           
     Show( TRUE );
 
     return TRUE;
index 18606b962e31048892612694e8b750d82bc45ccf..1c9d78426647ce9a53b028d64fcaf9314a9bfbf9 100644 (file)
@@ -393,7 +393,7 @@ gtk_myfixed_set_size (GtkMyFixed    *myfixed,
             if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (myfixed))
                gtk_widget_queue_resize (widget);
                    
-            break;
+            return;
         }
     }
 }
@@ -602,16 +602,6 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
 
     myfixed = GTK_MYFIXED (widget);
   
-    children = myfixed->children;
-    while (children)
-    {
-        child = children->data;
-        children = children->next;
-        gtk_myfixed_position_child (myfixed, child);
-        gtk_myfixed_allocate_child (myfixed, child);
-    }
-    
     widget->allocation = *allocation;
     
     if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
@@ -632,6 +622,16 @@ gtk_myfixed_size_allocate (GtkWidget     *widget,
         gdk_window_move_resize( widget->window, x, y, w, h );
         gdk_window_move_resize( myfixed->bin_window, 0, 0, w, h );
     }
+    
+    children = myfixed->children;
+    while (children)
+    {
+        child = children->data;
+        children = children->next;
+        gtk_myfixed_position_child (myfixed, child);
+        gtk_myfixed_allocate_child (myfixed, child);
+    }
 }
 
 static void
@@ -666,56 +666,6 @@ gtk_myfixed_draw (GtkWidget    *widget,
     }
 }
 
-/*
-static void
-gtk_myfixed_draw_border (GtkMyFixed *myfixed)
-{
-    GtkWidget *widget;
-    
-    widget = GTK_WIDGET(myfixed);
-
-    if (myfixed->shadow_type == GTK_MYSHADOW_NONE)
-        return;
-       
-    if (myfixed->shadow_type == GTK_MYSHADOW_OUT)
-    {
-        gtk_draw_shadow( widget->style,
-                         widget->window,
-                         GTK_STATE_NORMAL,
-                         GTK_SHADOW_OUT,
-                         0, 0,
-                        widget->allocation.width,
-                        widget->allocation.height );
-        return;
-    }
-
-    if (myfixed->shadow_type == GTK_MYSHADOW_IN)
-    {
-        gtk_draw_shadow( widget->style,
-                         widget->window,
-                         GTK_STATE_NORMAL,
-                         GTK_SHADOW_IN,
-                         0, 0,
-                        widget->allocation.width,
-                        widget->allocation.height );
-        return;
-    }
-    
-    if (myfixed->shadow_type == GTK_MYSHADOW_THIN)
-    {
-        GdkGC *gc;
-       gc = gdk_gc_new( widget->window );
-        gdk_gc_set_foreground( gc, &widget->style->black );
-        gdk_draw_rectangle( widget->window, gc, FALSE, 
-                            0, 0, 
-                           widget->allocation.width-1,
-                           widget->allocation.height-1 );
-        gdk_gc_unref( gc );
-        return;
-    }
-}
-*/
-
 static gint
 gtk_myfixed_expose (GtkWidget      *widget,
                    GdkEventExpose *event)
@@ -820,23 +770,23 @@ gtk_myfixed_forall (GtkContainer *container,
                   GtkCallback   callback,
                   gpointer      callback_data)
 {
-  GtkMyFixed *myfixed;
-  GtkMyFixedChild *child;
-  GList *children;
+    GtkMyFixed *myfixed;
+    GtkMyFixedChild *child;
+    GList *children;
 
-  g_return_if_fail (container != NULL);
-  g_return_if_fail (GTK_IS_MYFIXED (container));
-  g_return_if_fail (callback != NULL);
+    g_return_if_fail (container != NULL);
+    g_return_if_fail (GTK_IS_MYFIXED (container));
+    g_return_if_fail (callback != NULL);
 
-  myfixed = GTK_MYFIXED (container);
+    myfixed = GTK_MYFIXED (container);
 
-  children = myfixed->children;
-  while (children)
+    children = myfixed->children;
+    while (children)
     {
-      child = children->data;
-      children = children->next;
+        child = children->data;
+        children = children->next;
 
-      (* callback) (child->widget, callback_data);
+        (* callback) (child->widget, callback_data);
     }
 }
 
@@ -848,31 +798,31 @@ static void
 gtk_myfixed_position_child (GtkMyFixed      *myfixed,
                           GtkMyFixedChild *child)
 {
-  gint x;
-  gint y;
+    gint x;
+    gint y;
 
-  x = child->x - myfixed->xoffset;
-  y = child->y - myfixed->yoffset;
+    x = child->x - myfixed->xoffset;
+    y = child->y - myfixed->yoffset;
 
-  if (IS_ONSCREEN (x,y))
+    if (IS_ONSCREEN (x,y))
     {
-      if (GTK_WIDGET_MAPPED (myfixed) &&
+        if (GTK_WIDGET_MAPPED (myfixed) &&
          GTK_WIDGET_VISIBLE (child->widget))
        {
-         if (!GTK_WIDGET_MAPPED (child->widget))
-           gtk_widget_map (child->widget);
+           if (!GTK_WIDGET_MAPPED (child->widget))
+               gtk_widget_map (child->widget);
        }
 
-      if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
-       GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
+        if (GTK_WIDGET_IS_OFFSCREEN (child->widget))
+           GTK_PRIVATE_UNSET_FLAG (child->widget, GTK_IS_OFFSCREEN);
     }
-  else
+    else
     {
-      if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
-       GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
+        if (!GTK_WIDGET_IS_OFFSCREEN (child->widget))
+           GTK_PRIVATE_SET_FLAG (child->widget, GTK_IS_OFFSCREEN);
 
-      if (GTK_WIDGET_MAPPED (child->widget))
-       gtk_widget_unmap (child->widget);
+        if (GTK_WIDGET_MAPPED (child->widget))
+           gtk_widget_unmap (child->widget);
     }
 }
 
@@ -880,30 +830,30 @@ static void
 gtk_myfixed_allocate_child (GtkMyFixed      *myfixed,
                           GtkMyFixedChild *child)
 {
-  GtkAllocation allocation;
-  GtkRequisition requisition;
-
-  allocation.x = child->x - myfixed->xoffset;
-  allocation.y = child->y - myfixed->yoffset;
-  gtk_widget_get_child_requisition (child->widget, &requisition);
-  allocation.width = requisition.width;
-  allocation.height = requisition.height;
+    GtkAllocation allocation;
+    GtkRequisition requisition;
+
+    allocation.x = child->x - myfixed->xoffset;
+    allocation.y = child->y - myfixed->yoffset;
+    gtk_widget_get_child_requisition (child->widget, &requisition);
+    allocation.width = requisition.width;
+    allocation.height = requisition.height;
   
-  gtk_widget_size_allocate (child->widget, &allocation);
+    gtk_widget_size_allocate (child->widget, &allocation);
 }
 
 static void
 gtk_myfixed_position_children (GtkMyFixed *myfixed)
 {
-  GList *tmp_list;
+    GList *tmp_list;
 
-  tmp_list = myfixed->children;
-  while (tmp_list)
+    tmp_list = myfixed->children;
+    while (tmp_list)
     {
-      GtkMyFixedChild *child = tmp_list->data;
-      tmp_list = tmp_list->next;
+        GtkMyFixedChild *child = tmp_list->data;
+        tmp_list = tmp_list->next;
       
-      gtk_myfixed_position_child (myfixed, child);
+        gtk_myfixed_position_child (myfixed, child);
     }
 }
 
@@ -911,16 +861,17 @@ static void
 gtk_myfixed_adjust_allocations_recurse (GtkWidget *widget,
                                       gpointer   cb_data)
 {
-  GtkMyFixedAdjData *data = cb_data;
+    GtkMyFixedAdjData *data = cb_data;
 
-  widget->allocation.x += data->dx;
-  widget->allocation.y += data->dy;
+    widget->allocation.x += data->dx;
+    widget->allocation.y += data->dy;
 
-  if (GTK_WIDGET_NO_WINDOW (widget) &&
-      GTK_IS_CONTAINER (widget))
-    gtk_container_forall (GTK_CONTAINER (widget), 
+    if (GTK_WIDGET_NO_WINDOW (widget) && GTK_IS_CONTAINER (widget))
+    {
+        gtk_container_forall (GTK_CONTAINER (widget), 
                          gtk_myfixed_adjust_allocations_recurse,
                          cb_data);
+    }
 }
 
 static void
index 1e1dcdc207a5546e34370b5f116cb31801cf2af5..3dfbae632d4eedbff81c69d6a4cca5e030ffbf57 100644 (file)
@@ -313,39 +313,6 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU
 
 #endif // GTK_MINOR_VERSION > 0
 
-
-//-----------------------------------------------------------------------------
-// "size_allocate"
-//-----------------------------------------------------------------------------
-
-static void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
-{
-    if (g_isIdle)
-        wxapp_install_idle_handler();
-
-    if (!win->m_hasVMT) 
-        return;
-
-    if (win->m_sizeSet)
-        return;
-       
-    win->m_sizeSet = TRUE;
-    
-/*
-    wxPrintf( "OnSize from " );
-    if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
-        wxPrintf( win->GetClassInfo()->GetClassName() );
-    wxPrintf( " %d %d %d %d\n", (int)alloc->x,
-                                (int)alloc->y,
-                                (int)alloc->width,
-                                (int)alloc->height );
-*/
-
-    wxSizeEvent event( win->GetSize(), win->GetId() );
-    event.SetEventObject( win );
-    win->GetEventHandler()->ProcessEvent( event );
-}
-
 //-----------------------------------------------------------------------------
 // key event conversion routines
 //-----------------------------------------------------------------------------
@@ -2069,13 +2036,6 @@ void wxWindow::PostCreation()
 {
     wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
 
-    if (!m_isFrame)
-    {
-        /* frames have their own callback */
-        gtk_signal_connect( GTK_OBJECT(m_widget), "size_allocate",
-            GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
-    }
-
     if (m_wxwindow)
     {
         if (!m_noExpose)
@@ -2164,14 +2124,9 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
         m_y = y;
         m_width = width;
         m_height = height;
-
-        m_sizeSet = FALSE;
     }
     else
     {
-        int old_width = m_width;
-       int old_height = m_height;
-       
         GtkMyFixed *myfixed = GTK_MYFIXED(m_parent->m_wxwindow);
        
         if ((sizeFlags & wxSIZE_ALLOW_MINUS_ONE) == 0)
@@ -2220,19 +2175,19 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
                               m_y-border,
                               m_width+2*border,
                               m_height+border+bottom_border );
-
-        if ((old_width != m_width) ||
-           (old_height != m_height))
-       {
-           m_sizeSet = FALSE;
-       }
     }
-
+    
 /*
+    wxPrintf( "OnSize sent from " );
+    if (GetClassInfo() && GetClassInfo()->GetClassName())
+        wxPrintf( GetClassInfo()->GetClassName() );
+    wxPrintf( " %d %d %d %d\n", (int)m_x, (int)m_y, (int)m_width, (int)m_height );
+*/
+
     wxSizeEvent event( wxSize(m_width,m_height), GetId() );
     event.SetEventObject( this );
     GetEventHandler()->ProcessEvent( event );
-*/
+
     m_resizing = FALSE;
 }