-void wxFrame::GtkOnSize()
-{
- // avoid recursions
- if (m_resizing) return;
- m_resizing = true;
-
- // this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow
- wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") );
-
- // space occupied by m_frameToolBar and m_frameMenuBar
- int client_area_x_offset = 0,
- client_area_y_offset = 0;
-
- /* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
- wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
- set in wxFrame::Create so it is used to check what kind of frame we
- have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
- skip the part which handles m_frameMenuBar, m_frameToolBar and (most
- importantly) m_mainWidget */
-
- ConstrainSize();
-
- if (m_mainWidget)
- {
- // TODO
- // Rewrite this terrible code to using GtkVBox
-
- // m_mainWidget holds the menubar, the toolbar and the client
- // area, which is represented by m_wxwindow.
-
-#if wxUSE_MENUS_NATIVE
- if (m_frameMenuBar && m_frameMenuBar->IsShown())
- {
- int xx = m_miniEdge;
- int yy = m_miniEdge + m_miniTitle;
- int ww = m_width - 2*m_miniEdge;
- if (ww < 0)
- ww = 0;
- int hh = m_menuBarHeight;
- if (m_menuBarDetached) hh = wxPLACE_HOLDER;
- m_frameMenuBar->m_x = xx;
- m_frameMenuBar->m_y = yy;
- m_frameMenuBar->m_width = ww;
- m_frameMenuBar->m_height = hh;
- gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
- m_frameMenuBar->m_widget,
- xx, yy, ww, hh );
- client_area_y_offset += hh;
- }
-#endif // wxUSE_MENUS_NATIVE
-
-#if wxUSE_TOOLBAR
- if ((m_frameToolBar) && m_frameToolBar->IsShown() &&
- (m_frameToolBar->m_widget->parent == m_mainWidget))
- {
- int xx = m_miniEdge;
- int yy = m_miniEdge + m_miniTitle;
-#if wxUSE_MENUS_NATIVE
- if (m_frameMenuBar)
- {
- if (!m_menuBarDetached)
- yy += m_menuBarHeight;
- else
- yy += wxPLACE_HOLDER;
- }
-#endif // wxUSE_MENUS_NATIVE
-
- m_frameToolBar->m_x = xx;
- m_frameToolBar->m_y = yy;
-
- // don't change the toolbar's reported height/width
- int ww, hh;
- if ( m_frameToolBar->GetWindowStyle() & wxTB_VERTICAL )
- {
- ww = m_toolBarDetached ? wxPLACE_HOLDER
- : m_frameToolBar->m_width;
- hh = m_height - 2*m_miniEdge;
-
- client_area_x_offset += ww;
- }
- else if( m_frameToolBar->HasFlag(wxTB_RIGHT) )
- {
- yy += 2;
- ww = m_toolBarDetached ? wxPLACE_HOLDER
- : m_frameToolBar->m_width;
- xx = GetClientSize().x - 1;
- hh = m_height - 2*m_miniEdge;
- if( hh < 0 )
- hh = 0;
-
- }
- else if( m_frameToolBar->GetWindowStyle() & wxTB_BOTTOM )
- {
- xx = m_miniEdge;
- yy = GetClientSize().y;
-#if wxUSE_MENUS_NATIVE
- yy += m_menuBarHeight;
-#endif // wxUSE_MENU_NATIVE
- m_frameToolBar->m_x = xx;
- m_frameToolBar->m_y = yy;
- ww = m_width - 2*m_miniEdge;
- hh = m_toolBarDetached ? wxPLACE_HOLDER
- : m_frameToolBar->m_height;
- }
- else
- {
- ww = m_width - 2*m_miniEdge;
- hh = m_toolBarDetached ? wxPLACE_HOLDER
- : m_frameToolBar->m_height;
-
- client_area_y_offset += hh;
- }
-
- if (ww < 0)
- ww = 0;
- if (hh < 0)
- hh = 0;
- gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
- m_frameToolBar->m_widget,
- xx, yy, ww, hh );
- }
-#endif // wxUSE_TOOLBAR
-
- int client_x = client_area_x_offset + m_miniEdge;
- int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
- int client_w = m_width - client_area_x_offset - 2*m_miniEdge;
- int client_h = m_height - client_area_y_offset- 2*m_miniEdge - m_miniTitle;
- if (client_w < 0)
- client_w = 0;
- if (client_h < 0)
- client_h = 0;
- gtk_pizza_set_size( GTK_PIZZA(m_mainWidget),
- m_wxwindow,
- client_x, client_y, client_w, client_h );
- }
- else
- {
- // If there is no m_mainWidget between m_widget and m_wxwindow there
- // is no need to set the size or position of m_wxwindow.
- }
-
-#if wxUSE_STATUSBAR
- if (m_frameStatusBar && m_frameStatusBar->IsShown())
- {
- int xx = 0 + m_miniEdge;
- int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge - client_area_y_offset;
- int ww = m_width - 2*m_miniEdge;
- if (ww < 0)
- ww = 0;
- int hh = wxSTATUS_HEIGHT;
- m_frameStatusBar->m_x = xx;
- m_frameStatusBar->m_y = yy;
- m_frameStatusBar->m_width = ww;
- m_frameStatusBar->m_height = hh;
- gtk_pizza_set_size( GTK_PIZZA(m_wxwindow),
- m_frameStatusBar->m_widget,
- xx, yy, ww, hh );
- }
-#endif // wxUSE_STATUSBAR
-
- m_sizeSet = true;
-
- // send size event to frame
- wxSizeEvent event( wxSize(m_width,m_height), GetId() );
- event.SetEventObject( this );
- GetEventHandler()->ProcessEvent( event );
-
-#if wxUSE_STATUSBAR
- // send size event to status bar
- if (m_frameStatusBar)
- {
- wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
- event2.SetEventObject( m_frameStatusBar );
- m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
- }
-#endif // wxUSE_STATUSBAR
-
- m_resizing = false;
-}
-
-void wxFrame::OnInternalIdle()