- // if we're using constraints or sizers - do use them
- if ( GetAutoLayout() )
- {
- Layout();
- }
- else
- {
- // do we have _exactly_ one child?
- wxWindow *child = (wxWindow *)NULL;
- for ( wxWindowList::compatibility_iterator node = GetChildren().GetFirst();
- node;
- node = node->GetNext() )
- {
- wxWindow *win = node->GetData();
-
- // exclude top level and managed windows (status bar isn't
- // currently in the children list except under wxMac anyhow, but
- // it makes no harm to test for it)
- if ( !win->IsTopLevel() /*&& !IsOneOfBars(win)*/ )
- {
- if ( child )
- {
- return; // it's our second subwindow - nothing to do
- }
-
- child = win;
- }
- }
-
- // do we have any children at all?
- if ( child )
- {
- // exactly one child - set it's size to fill the whole frame
- int clientW, clientH;
- DoGetClientSize(&clientW, &clientH);
-
- // for whatever reasons, wxGTK wants to have a small offset - it
- // probably looks better with it?
-#ifdef __WXGTK__
- static const int ofs = 1;
-#else
- static const int ofs = 0;
-#endif
-
- child->SetSize(ofs, ofs, clientW - 2*ofs, clientH - 2*ofs);
- }
- }
-}
-
-/*** Copied from top level..! ***/
-// The default implementation for the close window event.
-void wxGenericMDIChildFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
-{
- Destroy();
-}
-
-void wxGenericMDIChildFrame::SetMDIParentFrame(wxGenericMDIParentFrame* parentFrame)
-{
- m_pMDIParentFrame = parentFrame;
-}
-
-wxGenericMDIParentFrame* wxGenericMDIChildFrame::GetMDIParentFrame() const
-{
- return m_pMDIParentFrame;
-}
-
-void wxGenericMDIChildFrame::Init()
-{
- m_pMDIParentFrame = (wxGenericMDIParentFrame *) NULL;
-#if wxUSE_MENUS
- m_pMenuBar = (wxMenuBar *) NULL;
-#endif // wxUSE_MENUS
-}