def on_bdown(self, ev=None): if gui.recon_context(self.tree, ev): self.item = self.tree.selection if self.item == self.top: gui.context_menu(self, ev, self.filemenu) elif self.item is not None: gui.context_menu(self, ev, self.editmenu) else: gui.Message.ok(self.title, 'You need to select a tree item first') #menu.append() else: ev.skip()
def on_context(self, event): if gui.recon_context(self, event): item = self.selection if item is not None: menu = gui.PopupMenu() menu.append("Ajouter une sous-tache", callback=self.on_add) menu.append("Editer", callback=self.on_edit) menu.append("Supprimer", enabled=(item.data!=self.main_task), callback=self.on_remove) menu.append_separator() menu.append('Couper', callback=self.on_cut) menu.append('Coller', enabled=(self._cut_buffer is not None), callback=self.on_paste) gui.context_menu(self, event, menu) else: event.skip()
def on_bdown(self, ev): if gui.recon_context(self, ev): edit_menu = gui.PopupMenu() edit_menu.append("Annuler", callback=self.on_undo, enabled=self.can_undo()) edit_menu.append_separator() edit_menu.append("Couper", callback=self.on_cut) edit_menu.append("Copier", callback=self.on_cut) edit_menu.append("Coller", callback=self.on_paste) edit_menu.append_separator() edit_menu.append("Tout selectionner", callback=self.on_select_all) edit_menu.append_separator() edit_menu.append("Inserer lien vers fichier", callback=self.insert_file_link) edit_menu.append("Inserer lien web") gui.context_menu(self, ev, edit_menu) #menu.append() else: ev.skip()