-
- // actually destroy the window now
- if (wnd->IsKindOf(CLASSINFO(wxAuiMDIChildFrame)))
- {
- // delete the child frame with pending delete, as is
- // customary with frame windows
- if (!wxPendingDelete.Member(wnd))
- wxPendingDelete.Append(wnd);
- }
- else
- {
- wnd->Destroy();
- }
-
- return true;
-
-/*
-
- wxWindow* wnd = m_tabs.GetWindowFromIdx(page_idx);
- wxWindow* new_active = NULL;
-
- // find out which onscreen tab ctrl owns this tab
- wxAuiTabCtrl* ctrl;
- int ctrl_idx;
- if (!FindTab(wnd, &ctrl, &ctrl_idx))
- return false;
-
- // find a new page and set it as active
- int new_idx = ctrl_idx+1;
- if (new_idx >= (int)ctrl->GetPageCount())
- new_idx = ctrl_idx-1;
-
- if (new_idx >= 0 && new_idx < (int)ctrl->GetPageCount())
- {
- new_active = ctrl->GetWindowFromIdx(new_idx);
- }
- else
- {
- // set the active page to the first page that
- // isn't the one being deleted
- size_t i, page_count = m_tabs.GetPageCount();
- for (i = 0; i < page_count; ++i)
- {
- wxWindow* w = m_tabs.GetWindowFromIdx(i);
- if (wnd != w)
- {
- new_active = m_tabs.GetWindowFromIdx(i);
- break;
- }
- }
- }
-
- // remove the tab from main catalog
- if (!m_tabs.RemovePage(wnd))
- return false;
-
- // remove the tab from the onscreen tab ctrl
- ctrl->RemovePage(wnd);
-