+ self.connect(self.RBHaut,SIGNAL("clicked()"),self.hautPushed)
+ self.connect(self.RBBas,SIGNAL("clicked()"),self.basPushed)
+ self.connect(self.RBMoins,SIGNAL("clicked()"),self.moinsPushed)
+ self.connect(self.RBPlus,SIGNAL("clicked()"),self.plusPushed)
+ self.connect(self.RBVoisListe,SIGNAL("clicked()"),self.voisListePushed)
+
+ def hautPushed(self):
+ if self.NumLineEditEnCours == 1 : return
+ else : numEchange=self.NumLineEditEnCours-1
+ self.echange(self.NumLineEditEnCours,numEchange)
+ self.LineEditEnCours.setFocus(True)
+ self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+
+ def basPushed(self):
+ if self.NumLineEditEnCours == self.indexDernierLabel : return
+ else : numEchange=self.NumLineEditEnCours+1
+ self.echange(self.NumLineEditEnCours,numEchange)
+ self.LineEditEnCours.setFocus(True)
+ self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+ def echange(self,num1,num2):
+ # on donne le focus au a celui ou on a bouge
+ # par convention le 2
+ nomLineEdit=self.nomLine+str(num1)
+ #print nomLineEdit
+ courant=getattr(self,nomLineEdit)
+ valeurAGarder=courant.text()
+ nomLineEdit2=self.nomLine+str(num2)
+ #print nomLineEdit2
+ courant2=getattr(self,nomLineEdit2)
+ courant.setText(courant2.text())
+ courant2.setText(valeurAGarder)
+ self.changeValeur(changeDePlace=False)
+ self.NumLineEditEnCours=num2
+ self.LineEditEnCours=courant2
+ self.LineEditEnCours.setFocus(True)
+
+ def moinsPushed(self):
+ # on supprime le dernier
+ if self.NumLineEditEnCours==self.indexDernierLabel :
+ nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+ courant=getattr(self,nomLineEdit)
+ courant.clean()
+ else :
+ for i in range (self.NumLineEditEnCours, self.indexDernierLabel):
+ aRemonter=i+1
+ nomLineEdit=self.nomLine+str(aRemonter)
+ courant=getattr(self,nomLineEdit)
+ valeurARemonter=courant.getValeur()
+ nomLineEdit=self.nomLine+str(i)
+ courant=getattr(self,nomLineEdit)
+ courant.setValeur(valeurARemonter)
+ nomLineEdit=self.nomLine+str(self.indexDernierLabel)
+ courant=getattr(self,nomLineEdit)
+ courant.clean()
+ self.changeValeur(changeDePlace=False,oblige=True)
+ self.setValide()
+
+ def plusPushed(self):
+ if self.indexDernierLabel == self.monSimpDef.max:
+ self.editor.affiche_infos('nb max de valeurs : '+str(self.monSimpDef.max)+' atteint')
+ return
+ self.ajoutLineEdit()
+ self.descendLesLignes()
+
+ def descendLesLignes(self):
+ if self.NumLineEditEnCours==self.indexDernierLabel : return
+ nomLineEdit=self.nomLine+str(self.NumLineEditEnCours+1)
+ courant=getattr(self,nomLineEdit)
+ valeurADescendre=courant.getValeur()
+ courant.clean()
+ for i in range (self.NumLineEditEnCours+1, self.indexDernierLabel):
+ aDescendre=i+1
+ nomLineEdit=self.nomLine+str(aDescendre)
+ courant=getattr(self,nomLineEdit)
+ valeurAGarder=courant.getValeur()
+ courant.setValeur(valeurADescendre)
+ valeurADescendre=valeurAGarder
+ self.changeValeur(changeDePlace=False)
+ self.scrollArea.ensureWidgetVisible(self.LineEditEnCours)
+
+ def voisListePushed(self):
+ print "voisListePushed"
+ texteValeurs=""
+ for v in self.node.item.GetListeValeurs():
+ texteValeurs+=str(v)+", "
+ entete="Valeurs pour "+self.nom
+ f=ViewText(self,self.editor,entete,texteValeurs[0:-2])
+ f.show()
+