- def showEvent(self, event):
- if self.prendLeFocus==1 :
- self.activateWindow()
- "il faut deriver le showEvent pour" , self.nom
- self.prendLeFocus=0
- QWidget.showEvent(self,event)
-
- def aideALaSaisie(self):
- mc = self.node.item.get_definition()
- mctype = mc.type[0]
- d_aides = { 'TXM' : tr(u"chaine de caracteres"),
- 'R' : tr("reel"),
- 'I' : tr("entier"),
- 'C' : tr("complexe"),
- 'Matrice' : tr(u'Matrice'),
- 'Fichier' : tr(u'fichier'),
- 'FichierNoAbs' : tr(u'fichier existant'),
- 'Repertoire' : tr(u'repertoire')}
-
- if mc.min == mc.max: commentaire=tr("Entrez ")+" "+str(mc.min)+" "
- else : commentaire=tr("Entrez entre ")+str(mc.min)+tr(" et ")+str(mc.max)
-
- try :
- if issubclass(mctype,object) : ctype = getattr(mctype, 'help_message', tr("Type de base inconnu"))
- else : ctype = d_aides.get(mctype, tr("Type de base inconnu"))
- except:
- ctype = d_aides.get(mctype, tr("Type de base inconnu"))
- if ctype == tr("Type de base inconnu") and "Tuple" in str(mctype): ctype=str(mctype)
-
- commentaire+=ctype
- if mc.max!=1 : commentaire+="s"
- return commentaire
-
- def setZoneInfo(self):
- # info=str(self.nom)+' '
- # if self.monSimpDef.getFr() != None and self.monSimpDef.getFr() != "": info+=self.monSimpDef.getSug() +" "
- # if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "": info+="Valeur suggeree : "self.monSimpDef.getSug()
- pass
-
- def reaffiche(self):
-
- if self.editor.jdc.aReafficher==True :
- self.parentQt.reaffiche()
-
- #PN PN PN pas satisfaisant
- #nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
- #print nodeAVoir.fenetre
- #print "nodeAVoir.fenetre.isVisible()", nodeAVoir.fenetre.isVisible()
- #if nodeAVoir.fenetre.isVisible() : return
- #self.editor.fenetreCentraleAffichee.rendVisibleNoeud(nodeAVoir)
- #nodeAVoir.fenetre.setFocus()
- # return # on est bien postionne
-
- if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
- nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
- try :
- index=self.editor.fenetreCentraleAffichee.listeAffichageWidget.index(nodeAVoir.fenetre.AAfficher)
- if (index==len(self.editor.fenetreCentraleAffichee.listeAffichageWidget)-1) :
- try :
- nodeAVoir.fenetre.setValeursApresBouton()
- except :
- pass
- else :
- self.editor.fenetreCentraleAffichee.afficheSuivant(nodeAVoir.fenetre.AAfficher)
- except :
- pass
- else :
- if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
- try :
- self.setValeursApresBouton()
- except :
- pass
- self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher)
- else :
- if hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7)
-
- def reaffichePourDeplier(self):
- self.parentQt.reaffiche()
-
- def rendVisible(self):
- pass
-
- #def enterEvent(self,event):
- # print "je passe dans enterEvent", self.nom
- # QWidget.enterEvent(self,event)
-
- def traiteClicSurLabel(self,texte):
- #aide=self.aide.encode('latin-1', 'ignore').decode('latin-1')+"\n"+self.aideALaSaisie().encode('latin-1', 'ignore').decode('latin-1')
- try :
- aide=self.aide+"\n"+self.aideALaSaisie()
- except :
- aide=self.aideALaSaisie()
- self.editor.afficheCommentaire(aide)
-
- def formate(self,t):
- l=len(t)//2
- newText=t[0:l]+'-\n'+t[l:]
- return newText
-
-
-
+ def showEvent(self, event):
+ if self.prendLeFocus==1 :
+ self.activateWindow()
+ "il faut deriver le showEvent pour" , self.nom
+ self.prendLeFocus=0
+ QWidget.showEvent(self,event)
+
+ def aideALaSaisie(self):
+ mc = self.node.item.get_definition()
+ mctype = mc.type[0]
+ d_aides = { 'TXM' : tr(u"chaine de caracteres"),
+ 'R' : tr("reel"),
+ 'I' : tr("entier"),
+ 'C' : tr("complexe"),
+ 'Matrice' : tr(u'Matrice'),
+ 'Fichier' : tr(u'fichier'),
+ 'FichierNoAbs' : tr(u'fichier existant'),
+ 'Repertoire' : tr(u'repertoire')}
+
+ if mc.min == mc.max: commentaire=tr("Entrez ")+" "+str(mc.min)+" "
+ else : commentaire=tr("Entrez entre ")+str(mc.min)+tr(" et ")+str(mc.max) + " "
+
+ try :
+ if issubclass(mctype,object) : ctype = getattr(mctype, 'help_message', tr("Type de base inconnu"))
+ else : ctype = d_aides.get(mctype, tr("Type de base inconnu"))
+ except:
+ ctype = d_aides.get(mctype, tr("Type de base inconnu"))
+ if ctype == tr("Type de base inconnu") and "Tuple" in str(mctype): ctype=str(mctype)
+ if ctype == tr("Type de base inconnu") and "bool" in str(mctype): ctype='bool'
+
+ if mc.max!=1 :
+ if ctype == 'chaine de caractere' and mc.max>1 : ctype = 'chaines de caractere'
+ else : ctype = ctype + 's'
+ commentaire+=ctype
+ if mc.max!=1 : commentaire+="s"
+ return commentaire
+
+ def setZoneInfo(self):
+ # info=str(self.nom)+' '
+ # if self.monSimpDef.getFr() != None and self.monSimpDef.getFr() != "": info+=self.monSimpDef.getSug() +" "
+ # if self.monSimpDef.getSug() != None and self.monSimpDef.getSug() != "": info+="Valeur suggeree : "self.monSimpDef.getSug()
+ pass
+
+ def reaffiche(self):
+
+ if self.editor.jdc.aReafficher==True :
+ self.parentQt.reaffiche()
+
+ #PN PN PN pas satisfaisant
+ #nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
+ #print nodeAVoir.fenetre
+ #print "nodeAVoir.fenetre.isVisible()", nodeAVoir.fenetre.isVisible()
+ #if nodeAVoir.fenetre.isVisible() : return
+ #self.editor.fenetreCentraleAffichee.rendVisibleNoeud(nodeAVoir)
+ #nodeAVoir.fenetre.setFocus()
+ # return # on est bien postionne
+
+ if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
+ nodeAVoir=self.parentQt.node.chercheNoeudCorrespondant(self.objSimp)
+ try :
+ index=self.editor.fenetreCentraleAffichee.listeAffichageWidget.index(nodeAVoir.fenetre.AAfficher)
+ if (index==len(self.editor.fenetreCentraleAffichee.listeAffichageWidget)-1) :
+ try :
+ nodeAVoir.fenetre.setValeursApresBouton()
+ except :
+ pass
+ else :
+ self.editor.fenetreCentraleAffichee.afficheSuivant(nodeAVoir.fenetre.AAfficher)
+ except :
+ pass
+ else :
+ if self.objSimp.isValid() and hasattr(self, 'AAfficher'):
+ try :
+ self.setValeursApresBouton()
+ except :
+ pass
+ self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher)
+ else :
+ if hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7)
+
+ def reaffichePourDeplier(self):
+ self.parentQt.reaffiche()
+
+ def rendVisible(self):
+ pass
+
+ #def enterEvent(self,event):
+ # print "je passe dans enterEvent", self.nom
+ # QWidget.enterEvent(self,event)
+
+ def traiteClicSurLabel(self,texte):
+ #aide=self.aide.encode('latin-1', 'ignore').decode('latin-1')+"\n"+self.aideALaSaisie().encode('latin-1', 'ignore').decode('latin-1')
+ try :
+ aide=self.aide+"\n"+self.aideALaSaisie()
+ except :
+ aide=self.aideALaSaisie()
+ self.editor.afficheCommentaire(aide)
+
+ def formate(self,t):
+ l=len(t)//2
+ newText=t[0:l]+'-\n'+t[l:]
+ return newText