def OnCut(self, evt): '''wx.ID_CUT handler.''' item = self.tree.GetSelection() index = self.tree.ItemFullIndex(item) state = self.tree.GetFullState() node = Presenter.cut() g.undoMan.RegisterUndo(undo.UndoCutDelete(index, state, node))
def OnDelete(self, evt): '''wx.ID_DELETE handler.''' if len(self.tree.GetSelections()) == 1: item = self.tree.GetSelection() index = self.tree.ItemFullIndex(item) node = Presenter.delete(self.tree.GetSelection()) g.undoMan.RegisterUndo(undo.UndoCutDelete(index, node)) else: g.undoMan.RegisterUndo(undo.UndoGlobal()) Presenter.deleteMany(self.tree.GetSelections())