def InsertPage(self, posn, page, text, switch=1): which = __main__.GDI(text) BaseNotebook.InsertPage(self, posn, page, text, switch, self.GNBI(which)) self.root.dragger._InsertItem(posn, text) if self.GetSelection() == posn or switch: self.root.OnDocumentChange(page.GetWindow1()) self._seen()
def AddPage(self, page, text, switch=1): which = __main__.GDI(text) BaseNotebook.AddPage(self, page, text, switch, self.GNBI(which)) self.root.dragger._AddItem(text) if switch or self.GetPageCount() == 1: self.root.OnDocumentChange(page.GetWindow1()) ## self.root.dragger._SelectItem(max(self.GetPageCount()-1, 0)) self._seen()
def OnDragDone(self, evt): i = evt.Selection cp = self.fr self.fr = None if cp is None: return try: self.Freeze() if wx.VERSION >= (3, ): # wx >3.0 moves the page as you drag, # so move it back before calling MoveTabPage p = self.GetPage(i) t = self.GetPageText(i) BaseNotebook.RemovePage(self, i) BaseNotebook.InsertPage(self, cp, p, t, 1, self.GNBI(__main__.GDI(t))) self.MoveTabPage(cp, i) finally: self.Thaw() evt.Skip()
def OnGetItemImage(self, item): return __main__.GDI(os.path.split(self.disp_items[item])[1])
def OnGetItemImage(self, item): if item >= self.root.control.GetPageCount(): return -1 return __main__.GDI( self.root.control.GetPage(item).GetWindow1().getshort())