1 # -*- coding: utf-8 -*-
3 from PyQt4.QtGui import *
4 from PyQt4.QtCore import *
6 #---------------------------#
7 class PopUpMenuNodePartiel :
8 #---------------------------#
9 def createPopUpMenu(self):
12 self.menu = QMenu(self.tree)
14 self.commentMenu=self.menu.addMenu('Commentaire')
15 self.commentMenu.addAction(self.CommApres)
16 self.commentMenu.addAction(self.CommAvant)
18 self.paramMenu =self.menu.addMenu('Parametre')
19 self.paramMenu.addAction(self.ParamApres)
20 self.paramMenu.addAction(self.ParamAvant)
23 self.menu.addAction(self.Supprime)
25 def createActions(self):
26 self.CommApres = QAction('après',self.tree)
27 self.tree.connect(self.CommApres,SIGNAL("activated()"),self.addCommApres)
28 self.CommApres.setStatusTip("Insere un commentaire apres la commande ")
29 self.CommAvant = QAction('avant',self.tree)
30 self.tree.connect(self.CommAvant,SIGNAL("activated()"),self.addCommAvant)
31 self.CommAvant.setStatusTip("Insere un commentaire avant la commande ")
33 self.ParamApres = QAction('après',self.tree)
34 self.tree.connect(self.ParamApres,SIGNAL("activated()"),self.addParametersApres)
35 self.ParamApres.setStatusTip("Insere un parametre apres la commande ")
36 self.ParamAvant = QAction('avant',self.tree)
37 self.tree.connect(self.ParamAvant,SIGNAL("activated()"),self.addParametersAvant)
38 self.ParamAvant.setStatusTip("Insere un parametre avant la commande ")
40 self.Supprime = QAction('Supprimer',self.tree)
41 self.tree.connect(self.Supprime,SIGNAL("activated()"),self.supprimeNoeud)
42 self.Supprime.setStatusTip("supprime le mot clef ")
44 def supprimeNoeud(self):
45 item= self.tree.currentItem()
48 def addParametersApres(self):
49 item= self.tree.currentItem()
50 item.addParameters(True)
52 def addParametersAvant(self):
53 item= self.tree.currentItem()
54 item.addParameters(False)
56 def addCommApres(self):
57 item= self.tree.currentItem()
60 def addCommAvant(self):
61 item= self.tree.currentItem()
62 item.addComment(False)
64 #-----------------------------------------#
65 class PopUpMenuNode(PopUpMenuNodePartiel) :
66 #-----------------------------------------#
67 def createPopUpMenu(self):
68 PopUpMenuNodePartiel.createPopUpMenu(self)
69 self.Commente = QAction('ce noeud',self.tree)
70 self.tree.connect(self.Commente,SIGNAL("activated()"),self.Commenter)
71 self.Commente.setStatusTip("commente le noeud ")
72 self.commentMenu.addAction(self.Commente)
75 item= self.tree.currentItem()