X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=InterfaceQT4%2Ffeuille.py;h=dcd0c0683b83a1d830055a532084b1aa5a60950c;hb=39b7b166eb606b80c9ac427811651b20db79bde2;hp=79bb9e72602b4cac895ebb3b4a4fbf3d19978240;hpb=67acf086fe9836af1ab54dafe9a29f20a532aa46;p=tools%2Feficas.git diff --git a/InterfaceQT4/feuille.py b/InterfaceQT4/feuille.py index 79bb9e72..dcd0c068 100644 --- a/InterfaceQT4/feuille.py +++ b/InterfaceQT4/feuille.py @@ -21,11 +21,16 @@ import string,types,os import traceback -from PyQt4 import * -from PyQt4.QtGui import * -from PyQt4.QtCore import * +from determine import monEnvQT5 +if monEnvQT5: + from PyQt5.QtWidgets import QToolButton ,QWidget + from PyQt5.QtGui import QFont, QFontMetrics +else : + from PyQt4.QtGui import * + from PyQt4.QtCore import * from Extensions.i18n import tr + from gereIcones import ContientIcones from gereIcones import FacultatifOuOptionnel from qtSaisie import SaisieValeur @@ -103,6 +108,31 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): def finCommentaire(self): return "" + + def finCommentaireListe(self): + commentaire="" + mc = self.node.item.get_definition() + d_aides = { 'TXM' : 'chaines de caracteres', + 'R' : 'reels', + 'I' : 'entiers', + 'C' : 'complexes'} + type = mc.type[0] + if not d_aides.has_key(type) : + if mc.min == mc.max: + commentaire=tr("Entrez ")+str(mc.min)+tr(" valeurs ")+'\n' + else : + commentaire=tr("Entrez entre ")+str(mc.min)+tr(" et ")+str(mc.max)+tr(" valeurs ")+'\n' + else : + if mc.min == mc.max: + commentaire=tr("Entrez ")+str(mc.min)+" "+tr(d_aides[type])+'\n' + else : + commentaire=tr("Entrez entre ")+str(mc.min)+(" et ")+str(mc.max) +" " +tr(d_aides[type])+'\n' + aideval=self.node.item.aide() + commentaire=commentaire + tr(aideval) + self.monCommentaireLabel.setText(str(commentaire)) + return str(commentaire) + + def setSuggestion(self): if self.monSimpDef.get_sug() != None and self.monSimpDef.get_sug() != "": suggere=str('

suggestion : ')+str(self.monSimpDef.get_sug())+"

" @@ -166,7 +196,6 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): def reaffiche(self): #print "dans reaffiche de feuille", self.nom if self.editor.jdc.aReafficher==True : - #print " j appelle le reaffiche de parentQt" self.parentQt.reaffiche() #PN PN PN pas satisfaisant @@ -177,10 +206,28 @@ class Feuille(QWidget,ContientIcones,SaisieValeur,FacultatifOuOptionnel): #self.editor.fenetreCentraleAffichee.rendVisibleNoeud(nodeAVoir) #nodeAVoir.fenetre.setFocus() # return # on est bien postionne - if self.objSimp.isvalid() and hasattr(self, 'AAfficher'): - self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher) + + 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 hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7) + if self.objSimp.isvalid() and hasattr(self, 'AAfficher'): + try : + self.setValeursApresBouton() + except : + self.editor.fenetreCentraleAffichee.afficheSuivant(self.AAfficher) + else : + if hasattr(self, 'AAfficher'): self.AAfficher.setFocus(7) def reaffichePourDeplier(self): self.parentQt.reaffiche()