+ if (m_frameToolBar)
+ {
+ int xx = m_miniEdge;
+ int yy = m_miniEdge + m_miniTitle;
+ if (m_frameMenuBar)
+ {
+ if (!m_menuBarDetached)
+ yy += wxMENU_HEIGHT;
+ else
+ yy += wxPLACE_HOLDER;
+ }
+ int ww = m_width - 2*m_miniEdge;
+ int hh = m_frameToolBar->m_height;
+ if (m_toolBarDetached) hh = wxPLACE_HOLDER;
+ m_frameToolBar->m_x = xx;
+ m_frameToolBar->m_y = yy;
+ /* m_frameToolBar->m_height = hh; don't change the toolbar's height */
+ m_frameToolBar->m_width = ww;
+
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWidget), m_frameToolBar->m_widget, xx, yy );
+ gtk_widget_set_usize( m_frameToolBar->m_widget, ww, hh );
+
+ client_area_y_offset += hh;
+ }
+
+ int client_x = m_miniEdge;
+ int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
+ gtk_myfixed_move( GTK_MYFIXED(m_mainWidget), m_wxwindow, client_x, client_y );
+
+ int client_w = m_width - 2*m_miniEdge;
+ int client_h = m_height - client_area_y_offset- 2*m_miniEdge - m_miniTitle;
+ gtk_widget_set_usize( m_wxwindow, 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 (m_frameStatusBar)
+ {
+ int xx = 0 + m_miniEdge;
+ int yy = m_height - wxSTATUS_HEIGHT - m_miniEdge - client_area_y_offset;
+ int ww = m_width - 2*m_miniEdge;
+ 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_myfixed_move( GTK_MYFIXED(m_wxwindow), m_frameStatusBar->m_widget, xx, yy );
+ gtk_widget_set_usize( m_frameStatusBar->m_widget, ww, hh );
+ }
+
+ /* we actually set the size of a frame here and no-where else */
+ gtk_widget_set_usize( m_widget, m_width, m_height );
+
+ m_sizeSet = TRUE;
+
+ /* send size event to frame */
+ wxSizeEvent event( wxSize(m_width,m_height), GetId() );
+ event.SetEventObject( this );
+ GetEventHandler()->ProcessEvent( event );
+
+ /* 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 );
+ }
+
+ m_resizing = FALSE;
+}
+
+void wxFrame::OnInternalIdle()
+{
+ if (!m_sizeSet)
+ GtkOnSize( m_x, m_y, m_width, m_height );
+
+ DoMenuUpdates();
+}
+
+void wxFrame::OnCloseWindow( wxCloseEvent& event )
+{
+ Destroy();
+}
+
+void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
+{
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+
+ if (GetAutoLayout())
+ {
+ Layout();
+ }
+ else
+ {
+ // do we have exactly one child?
+ wxWindow *child = (wxWindow *)NULL;
+ for ( wxNode *node = GetChildren().First(); node; node = node->Next() )
+ {
+ wxWindow *win = (wxWindow *)node->Data();
+ if ( !wxIS_KIND_OF(win,wxFrame) && !wxIS_KIND_OF(win,wxDialog) )
+ {
+ if ( child )
+ {
+ // it's the second one: do nothing
+ return;
+ }
+
+ child = win;
+ }
+ }
+
+ // no children at all?
+ if ( child )
+ {
+ // yes: set it's size to fill all the frame
+ int client_x, client_y;
+ GetClientSize( &client_x, &client_y );
+ child->SetSize( 1, 1, client_x-2, client_y-2 );
+ }
+ }
+}