1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2017 EDF R&D
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 from __future__ import absolute_import
23 from builtins import str
24 from builtins import range
30 from six.moves import range
31 from PyQt5.QtWidgets import QCheckBox, QScrollBar, QFrame, QApplication, QLabel
32 from PyQt5.QtWidgets import QSizePolicy,QSpacerItem
33 from PyQt5.QtGui import QPalette, QFont
34 from PyQt5.QtCore import Qt
36 from Extensions.i18n import tr
38 from desWidgetIntoSug import Ui_WidgetIntoSug
39 from monWidgetPlusieursInto import MonWidgetPlusieursInto
41 class MonWidgetIntoSug (Ui_WidgetIntoSug, MonWidgetPlusieursInto):
43 # cette wdget ne fonctionne actuellement que pour Telemac
44 # on attend du texte . on n essaye pas de transformer
46 def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
48 MonWidgetPlusieursInto.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
49 self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
51 def LEValeurAjouteDsPossible(self):
52 text=str(self.lineEditVal.text())
53 if text == "" : return
54 # il faudrait essauer d en obtenir un reel, un tuple ou ...
55 # si cela est utilise pour autre chose que Telemac
56 if not isinstance(text,str) :
57 self.lineEditVal.setText("")
60 self.monSimpDef.intoSug.insert(0,text)