def DoDeletePage(self, page):
"""
Does the actual page deletion.
:param `page`: the index of the tab.
"""
# Remove the page from the vector
book = self.GetParent()
self._pagesInfoVec.pop(page)
if self._nIndex >= page:
self._nIndex = self._nIndex - 1
# The delete page was the last first on the array,
# but the book still has more pages, so we set the
# active page to be the first one (0)
if self._nIndex < 0 and len(self._pagesInfoVec) > 0:
self._nIndex = 0
# Refresh the tabs
if self._nIndex >= 0:
book._bForceSelection = True
book.SetSelection(self._nIndex)
book._bForceSelection = False
if not self._pagesInfoVec:
# Erase the page container drawings
dc = wx.ClientDC(self)
dc.Clear()
评论列表
文章目录