+ m_title = title;
+
+ return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
+}
+
+void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
+{
+ wxWindow::GetClientSize( width, height );
+}
+
+void wxMDIChildFrame::AddChild( wxWindow *child )
+{
+ wxWindow::AddChild( child );
+}
+
+static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
+{
+ menu->SetInvokingWindow( win );
+ wxNode *node = menu->GetItems().First();
+ while (node)
+ {
+ wxMenuItem *menuitem = (wxMenuItem*)node->Data();
+ if (menuitem->IsSubMenu())
+ SetInvokingWindow( menuitem->GetSubMenu(), win );
+ node = node->Next();
+ }
+}
+
+void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
+{
+ m_menuBar = menu_bar;
+
+ if (m_menuBar)
+ {
+ wxMDIParentFrame *mdi_frame = (wxMDIParentFrame*)m_parent->m_parent;
+
+ if (m_menuBar->m_parent != this)
+ {
+ wxNode *node = m_menuBar->GetMenus().First();
+ while (node)
+ {
+ wxMenu *menu = (wxMenu*)node->Data();
+ SetInvokingWindow( menu, this );
+ node = node->Next();
+ }
+
+ m_menuBar->m_parent = mdi_frame;
+ }
+
+ /* the menu bar of the child window is shown in idle time as needed */
+ gtk_widget_hide( m_menuBar->m_widget );
+
+ /* insert the invisible menu bar into the _parent_ mdi frame */
+ gtk_myfixed_put( GTK_MYFIXED(mdi_frame->m_mainWidget), m_menuBar->m_widget, 0, 0 );
+ gtk_widget_set_usize( menu_bar->m_widget, mdi_frame->m_width, wxMENU_HEIGHT );
+ }
+}
+
+wxMenuBar *wxMDIChildFrame::GetMenuBar() const
+{
+ return m_menuBar;
+}
+
+void wxMDIChildFrame::Activate()
+{
+}