Salome HOME
legere difference ds VARIABLES_TO_BE...
[tools/eficas.git] / InterfaceQT4 / monWidgetIntoSug.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2013   EDF R&D
3 #
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.
8 #
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.
13 #
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
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 # Modules Python
21 from __future__ import absolute_import
22 try :
23    from builtins import str
24    from builtins import range
25 except : pass
26
27 import types,os
28
29 # Modules Eficas
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
35
36 from Extensions.i18n import tr
37
38 from desWidgetIntoSug        import Ui_WidgetIntoSug 
39 from monWidgetPlusieursInto  import MonWidgetPlusieursInto 
40
41 class MonWidgetIntoSug (Ui_WidgetIntoSug, MonWidgetPlusieursInto):
42 # Attention Attention
43 # cette wdget ne fonctionne actuellement que pour Telemac
44 # on attend du texte . on n essaye pas de transformer 
45
46   def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande):
47
48         MonWidgetPlusieursInto.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande)
49         self.lineEditVal.returnPressed.connect(self.LEValeurAjouteDsPossible)
50
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("")
58           print ('jkjkl')
59           return
60        self.monSimpDef.intoSug.insert(0,text)
61        self.setValeurs()