Salome HOME
bug 53004
[tools/eficas.git] / InterfaceQT4 / monWidgetOptionnel.py
index 93a81041ac0f92a23d3b95f27f36e707f2017cf0..f8fe210bfb198fbeca3e19b0a462b70b7a80a64c 100644 (file)
@@ -30,11 +30,12 @@ from desWidgetOptionnel import Ui_WidgetOptionnel
 class monButtonCustom(QCheckBox):
 
    def __init__(self,texte,monOptionnel,parent=None):
-      QCheckBox.__init__(self,texte,parent)
+      QCheckBox.__init__(self,QString(tr(texte)),parent)
+      self.texte=texte
       self.monOptionnel=monOptionnel
 
    def mouseDoubleClickEvent(self, event):
-      #print "dans mouseDoubleClickEvent"
+      #print "dans mouseDoubleClickEvent", self
       if self not in self.monOptionnel.dicoCb.keys() : 
          event.accept()
          return
@@ -75,7 +76,7 @@ class MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
 
 
   def affiche(self,liste):
-     #print "dans Optionnel ____ affiche", liste
+     print "dans Optionnel ____ affiche", liste
      self.show()
      labeltext,fonte,couleur = self.parentMC.node.item.GetLabelText()
      l=labeltext
@@ -90,21 +91,22 @@ class MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
      self.GeneaLabel.setText(tr("Options pour \n") +texte)
 
      for cb in self.dicoCb.keys():
-         #print 'je detruit', self.dicoCb[cb], cb
+         #print 'je detruis', self.dicoCb[cb], cb
          #print cb.close()
          cb.close()
+
      self.dicoCb={}
      liste.reverse()
      for mot in liste :
-         cb = monButtonCustom(QString(mot),self)
+         cb = monButtonCustom(mot,self)
          #print "j ajoute ", mot, cb
          self.dicoCb[cb]=mot
          self.commandesOptionnellesLayout.insertWidget(0,cb)
-     #print "Fin Optionnel ____ affiche", liste
+     self.scrollAreaCommandesOptionnelles.horizontalScrollBar().setSliderPosition(0)
+     print "Fin Optionnel ____ affiche", liste
 
   def CBChecked(self):
       # ordre ?
-      #print "kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk"
       return
       for cb in self.dicoCb.keys() :
           if cb.isChecked()      and self.dicoCb[cb] not in self.listeChecked : self.listeChecked.append(self.dicoCb[cb])
@@ -120,3 +122,6 @@ class MonWidgetOptionnel (QWidget,Ui_WidgetOptionnel):
      #print "dans Optionnel __ ajout de ", maListe
      self.parentMC.ajoutMC(maListe)
 
+  def hide(self):
+     self.parentQt.editor.saveSplitterSizes()
+     QWidget.hide(self)