removed unnecessary commented code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2359,74 +2359,6 @@ bool wxAuiNotebook::DeletePage(size_t page_idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
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);
|
|
||||||
|
|
||||||
// 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();
|
|
||||||
}
|
|
||||||
|
|
||||||
RemoveEmptyTabFrames();
|
|
||||||
|
|
||||||
// set new active pane
|
|
||||||
if (new_active)
|
|
||||||
{
|
|
||||||
m_curpage = -1;
|
|
||||||
SetSelection(m_tabs.GetIdxFromWindow(new_active));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user