if self.editor.fenetreCentraleAffichee != None :
#print "j enleve ", self.editor.fenetreCentraleAffichee, self.editor.fenetreCentraleAffichee.node.item.nom
self.editor.widgetCentraleLayout.removeWidget(self.editor.fenetreCentraleAffichee)
-
self.editor.fenetreCentraleAffichee.setParent(None)
self.editor.fenetreCentraleAffichee.close()
+ self.editor.fenetreCentraleAffichee.deleteLater()
self.editor.widgetCentraleLayout.addWidget(self.fenetre)
#print "j ajoute ", self.fenetre, self.fenetre.node.item.nom
Rend le noeud courant (self) selectionne et deselectionne
tous les autres
"""
- print "select pour", self.item.nom
+ #print "select pour", self.item.nom
for item in self.tree.selectedItems() :
item.setSelected(0)
self.tree.setCurrentItem( self )
def onValid(self):
#print "onValid pour ", self.item.nom
+ if self.JESUISOFF==1 : return
+
if hasattr(self,'fenetre') and self.fenetre: self.fenetre.setValide()
if (self.item.nom == "VARIABLE" or self.item.nom == "DISTRIBUTION") and self.item.isvalid():
self.item.jdc.recalcule_etat_correlation()
-
def update_node_valid(self):
"""Cette methode remet a jour la validite du noeud (icone)
Elle appelle isvalid
nouveau=widget.node.append_child(nom)
if firstNode==None : firstNode=nouveau
if nouveau == None or nouveau == 0 :
- self.editor.affiche_infos(tr('insertion impossible a cet endroit pour '+nom),red)
+ self.editor.affiche_infos(tr('insertion impossible a cet endroit pour '+nom),Qt.red)
self.reaffiche(firstNode)
- if firstNode!=None and firstNode.item!=None :
+ if firstNode!=None and firstNode !=0 and firstNode.item!=None :
firstNode.select()
--- /dev/null
+# Copyright (C) 2007-2013 EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Modules Python
+# Modules Eficas
+
+from determine import monEnvQT5
+if monEnvQT5:
+ from PyQt5.QtWidgets import QCheckBox, QWidget, QLabel
+ from PyQt5.QtCore import Qt
+else :
+ from PyQt4.QtGui import *
+ from PyQt4.QtCore import *
+
+from Extensions.i18n import tr
+from desGroupeOptionnel import Ui_groupeOptionnel
+
+
+# Import des panels
+
+class monButtonCustom(QCheckBox):
+
+ def __init__(self,texte,monOptionnel,parent=None):
+ QCheckBox.__init__(self,tr(texte),parent)
+ self.texte=texte
+ self.monOptionnel=monOptionnel
+
+ def mouseDoubleClickEvent(self, event):
+ #print "dans mouseDoubleClickEvent", self
+ if self not in self.monOptionnel.dicoCb.keys() :
+ event.accept()
+ return
+ listeCheckedMC="+"+self.monOptionnel.dicoCb[self]
+ self.monOptionnel.parentMC.ajoutMC(listeCheckedMC)
+ event.accept()
+
+
+ def mousePressEvent(self, event):
+ #rint "dans mousePressEvent"
+ self.mousePressed=True
+ if not( event.button() != Qt.RightButton) :
+ event.accept()
+ return
+ QCheckBox.mousePressEvent(self, event)
+ event.accept()
+
+
+class MonGroupeOptionnel (QWidget,Ui_groupeOptionnel):
+ """
+ """
+ def __init__(self,liste,parentQt,parentMC):
+ #print "dans init de monWidgetOptionnel ", parentQt, parentQt.node.item.nom
+ QWidget.__init__(self,None)
+ self.setupUi(self)
+ self.listeChecked=[]
+ self.dicoCb={}
+ self.mousePressed=False
+ self.cbPressed=None
+ self.cb=None
+ self.parentQt=parentQt
+ self.parentMC=parentMC
+ self.afficheTitre()
+ if liste != [] : self.affiche(liste)
+ else : self.MCOptionnelLayout.insertWidget(0,QLabel(tr('Pas de MC Optionnel')))
+
+
+ def afficheTitre(self):
+ labeltext,fonte,couleur = self.parentMC.node.item.GetLabelText()
+ l=tr(labeltext)
+ li=[]
+ while len(l) > 25:
+ li.append(l[0:24])
+ l=l[24:]
+ li.append(l)
+ texte=""
+ for l in li : texte+=l+"\n"
+ texte=texte[0:-2]
+ self.MCLabel.setText(texte)
+
+ def affiche(self,liste):
+ #print "dans Optionnel ____ affiche", liste
+ self.dicoCb={}
+ liste.reverse()
+ for mot in liste :
+ cb = monButtonCustom(mot,self)
+ #if monEnvQT5:
+ # cb.clicked.connect(self.ajoutMC)
+ #else :
+ # self.connect(cb,SIGNAL("clicked()"), self.ajoutMC)
+ self.MCOptionnelLayout.insertWidget(0,cb)
+ self.dicoCb[cb]=mot
+ self.scrollAreaCommandesOptionnelles.horizontalScrollBar().setSliderPosition(0)
+ #print "Fin Optionnel ____ affiche", liste
+
+ def CBChecked(self):
+ # ordre ?
+ return
+ for cb in self.dicoCb.keys() :
+ if cb.isChecked() and self.dicoCb[cb] not in self.listeChecked : self.listeChecked.append(self.dicoCb[cb])
+ if not(cb.isChecked()) and self.dicoCb[cb] in self.listeChecked : self.listeChecked.remove(self.dicoCb[cb])
+ self.parentMC.recalculeListeMC(self.listeChecked)
+
+#
+# def ajoutMC(self):
+# maListe=""
+# for cb in self.dicoCb.keys():
+# if cb.isChecked() : maListe+="+"+str(cb.text())
+# if maListe=="":return
+ #print "dans Optionnel __ ajout de ", maListe
+# self.parentMC.ajoutMC(maListe)
+#
self.node.affichePanneau()
#print "dans reaffiche de monWidgetCommande", self.avantH, self.avantV
QTimer.singleShot(1, self.recentre)
- if nodeAVoir != None:
+ if nodeAVoir != None and nodeAVoir!=0:
self.f=nodeAVoir.fenetre
if self.f==None :
newNode=nodeAVoir.treeParent.chercheNoeudCorrespondant(nodeAVoir.item.object)
self.f = newNode.fenetre
- print "dans reaffiche",self.f, nodeAVoir.item.nom
+ #print "dans reaffiche",self.f, nodeAVoir.item.nom
if self.f != None and self.f.isVisible() : return
if self.f != None : QTimer.singleShot(1, self.rendVisible)
self.inhibeExpand=False
return groupe
def vireLesAutres(self,MC):
- print "je passe dans vireLesAutres"
+ #print "je passe dans vireLesAutres"
genea =MC.obj.get_genealogie()
for k in self.dicoMCWidgetOptionnel.keys():
if k not in genea : self.dicoMCWidgetOptionnel[k].close()
- if k not in genea : print k
- print "________"
+ #if k not in genea : print k
+ #print "________"
def titre(self,MC):
class MonWidgetPlusieursBase (Ui_WidgetPlusieursBase,Feuille,GereListe,GerePlie):
def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
- print "MonWidgetPlusieursBase", nom
+ #print "MonWidgetPlusieursBase", nom
self.nomLine="lineEditVal"
self.inInit=True
self.indexDernierLabel=0
Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
GereListe.__init__(self)
self.gereIconePlier()
- self.connect(self.BSelectFichier,SIGNAL("clicked()"), self.selectInFile)
+ if monEnvQT5:
+ self.BSelectFichier.clicked.connect(self.selectInFile)
+ else :
+ self.connect(self.BSelectFichier,SIGNAL("clicked()"), self.selectInFile)
if sys.platform[0:5]!="linux":
repIcon=self.node.editor.appliEficas.repIcon
if self.indexDernierLabel % 2 == 1 : nouveauLE.setStyleSheet("background:rgb(210,210,210)")
else : nouveauLE.setStyleSheet("background:rgb(235,235,235)")
nouveauLE.setFrame(False)
- self.connect(nouveauLE,SIGNAL("returnPressed()"),self.changeValeur)
+ if monEnvQT5:
+ nouveauLE.returnPressed.connect(self.changeValeur)
+ else :
+ self.connect(nouveauLE,SIGNAL("returnPressed()"),self.changeValeur)
setattr(self,nomLineEdit,nouveauLE)
self.listeAffichageWidget.append(nouveauLE)
self.etablitOrdre()
eficas_compile_ui ( desWidgetCommande.ui )
eficas_compile_ui ( desWidgetFormule.ui )
eficas_compile_ui ( desWidgetOptionnel.ui )
+eficas_compile_ui ( desGroupeOptionnel.ui )
eficas_compile_ui ( Tuple2.ui )
eficas_compile_ui ( Tuple3.ui )
#
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>groupeOptionnel</class>
+ <widget class="QWidget" name="groupeOptionnel">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>400</width>
+ <height>300</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Form</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QFrame" name="frame_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::Box</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="MCLabel">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>31</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>QFrame::Raised</enum>
+ </property>
+ <property name="text">
+ <string><html><head/><body><p><span style=" color:#0000ff;">commande </span></p></body></html></string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>1037</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QScrollArea" name="scrollAreaCommandesOptionnelles">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">background : rgb(247,247,247)</string>
+ </property>
+ <property name="frameShape">
+ <enum>QFrame::NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="widgetResizable">
+ <bool>true</bool>
+ </property>
+ <widget class="QWidget" name="MCOptionnelLW">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>382</width>
+ <height>223</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <layout class="QVBoxLayout" name="MCOptionnelLayout">
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>75</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
<property name="widgetResizable">
<bool>true</bool>
</property>
- <widget class="QWidget" name="commandesOptionnellesWidget">
+ <widget class="QWidget" name="groupesOptionnelsW">
<property name="geometry">
<rect>
<x>0</x>
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <layout class="QVBoxLayout" name="commandesOptionnellesLayout">
+ <layout class="QVBoxLayout" name="groupesOptionnelsLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
desSelectVal.py desViewTexte.py desViewRegles.py desVisu.py desWidgetCreeParam.py desWidgetCommande.py \
desWidgetOptionnel.py desWidgetOptionnelMC.py Tuple2.py Tuple3.py \
desWidgetBloc.py desWidgetCB.py desWidgetCommentaire.py desWidgetDate.py \
- desWidgetFact.py desWidgetFactPlie.py desWidgetFormule.py desWidgetHeure.py \
- desWidgetInformation.py desWidgetInactif.py \
+ desWidgetFact.py desWidgetFactPlie.py desWidgetFormule.py desGroupeOptionnel.py \
+ desWidgetHeure.py desWidgetInformation.py desWidgetInactif.py \
desWidgetMatrice.py desWidgetParam.py desWidgetPlusieursBase.py desWidgetPlusieursInto.py \
desWidgetPlusieursIntoOrdonne.py desWidgetPlusieursTuple.py desWidgetRadioButton.py \
desWidget4a6RadioButton.py desWidgetSimpBase.py desWidgetSDCOInto.py desWidgetSimpBool.py \