+ if (m_mainWidget)
+ {
+ /* check if size is in legal range */
+ if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
+ if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight;
+ if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
+ if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
+
+ /* I revert back to wxGTK's original behaviour. m_mainWidget holds the
+ * menubar, the toolbar and the client area, which is represented by
+ * m_wxwindow.
+ * this hurts in the eye, but I don't want to call SetSize()
+ * because I don't want to call any non-native functions here. */
+
+ if (m_frameMenuBar)
+ {
+ int xx = m_miniEdge;
+ int yy = m_miniEdge + m_miniTitle;
+ int ww = m_width - 2*m_miniEdge;
+ int hh = wxMENU_HEIGHT;
+ 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_myfixed_set_size( GTK_MYFIXED(m_mainWidget),
+ m_frameMenuBar->m_widget,
+ xx, yy, ww, hh );
+ client_area_y_offset += hh;
+ }
+
+#if wxUSE_TOOLBAR
+ 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_set_size( GTK_MYFIXED(m_mainWidget),
+ m_frameToolBar->m_widget,
+ xx, yy, ww, hh );
+ client_area_y_offset += hh;
+ }
+#endif
+
+ int client_x = m_miniEdge;
+ int client_y = client_area_y_offset + m_miniEdge + m_miniTitle;
+ int client_w = m_width - 2*m_miniEdge;
+ int client_h = m_height - client_area_y_offset- 2*m_miniEdge - m_miniTitle;
+ gtk_myfixed_set_size( GTK_MYFIXED(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)
+ {
+ 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_set_size( GTK_MYFIXED(m_wxwindow),
+ m_frameStatusBar->m_widget,
+ xx, yy, ww, hh );
+ }
+#endif
+
+ /* 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 );