From: Robert Roebling Date: Sat, 16 Oct 1999 20:07:16 +0000 (+0000) Subject: Restored wxSizeEvent code form last week -> wxGLCanvas X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6d693bb4fc299b7375dd4da9d878768d80ceaf55 Restored wxSizeEvent code form last week -> wxGLCanvas probably broken again. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4027 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index 638c506b3d..506ee744c2 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -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, diff --git a/include/wx/gtk1/frame.h b/include/wx/gtk1/frame.h index 638c506b3d..506ee744c2 100644 --- a/include/wx/gtk1/frame.h +++ b/include/wx/gtk1/frame.h @@ -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, diff --git a/samples/notebook/test.cpp b/samples/notebook/test.cpp index e140f42cc5..c2dffe86fe 100644 --- a/samples/notebook/test.cpp +++ b/samples/notebook/test.cpp @@ -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(); diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 6ecd18ed73..539fb6c9b7 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -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; } diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 7dae078001..2c275b4434 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -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; diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 18606b962e..1c9d784266 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -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 diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 1e1dcdc207..3dfbae632d 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -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; } diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 6ecd18ed73..539fb6c9b7 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -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; } diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 7dae078001..2c275b4434 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -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; diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c index 18606b962e..1c9d784266 100644 --- a/src/gtk1/win_gtk.c +++ b/src/gtk1/win_gtk.c @@ -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 diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 1e1dcdc207..3dfbae632d 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -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; }