Salome HOME
mise a niveau catalogue
[tools/eficas.git] / Editeur / fenetre_mc_inconnus.py
index 113ec4e4e808353f7fa42101598a924e238a9171..e2b4cf7815802916c2fbaa9d0ab97a939e2bdf25 100644 (file)
@@ -1,3 +1,22 @@
+#            CONFIGURATION MANAGEMENT OF EDF VERSION
+# ======================================================================
+# COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
+# THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
+# IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
+# THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
+# (AT YOUR OPTION) ANY LATER VERSION.
+#
+# THIS PROGRAM 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
+# GENERAL PUBLIC LICENSE FOR MORE DETAILS.
+#
+# YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
+# ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
+#    1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
+#
+#
+# ======================================================================
 """
 """
 # Modules Python
@@ -46,17 +65,13 @@ class fenetre_mc_inconnus :
        self.frame1.place(relx=0,rely=0,relheight=0.2,relwidth=1)
        self.frame2.place(relx=0,rely=0.2,relheight=0.6,relwidth=1)
        self.frame3.place(relx=0,rely=0.8,relheight=0.2,relwidth=1)
-       self.frame21 = Frame(self.frame2)
-       self.frame22 = Frame(self.frame2)
-       self.frame21.place(relx=0,rely=0,relwidth=0.6,relheight=1)
-       self.frame22.place(relx=0.6,rely=0,relwidth=0.4,relheight=1)
     
     def init_label(self):
        """
        Affichage du label dans la zone concernée
        """
        txt = " Un ou plusieurs mots-clés inconnus ont été trouvés dans le fichier de commandes."
-       txt = txt + "En cliquant sur leur nom, vous pourrez soit corriger l'orthographe soit supprimer ce mot-clé"
+       #txt = txt + "En cliquant sur leur nom, vous pourrez soit corriger l'orthographe soit supprimer ce mot-clé"
        self.fenetre.update_idletasks()
        Label(self.frame1,
              text = txt,
@@ -68,19 +83,24 @@ class fenetre_mc_inconnus :
        """
        Affiche les mots-clés à modifier ou supprimer  
        """
+       i=0
+       self.widgets=[]
        for mc in self.l_mc :
            # mc est une liste :
            # mc contient comme premiers arguments l'étape et éventuellement les blocs, mcfact ...
           # et contient comme 2 derniers éléments le nom du mot-clé et sa valeur
           path_mc = self.get_path(mc[0:-2])
           nom_mc  = mc[-2]
-          Label(self.frame21,text = path_mc).pack(side='left')
-          e = Entry(self.frame22)
-          e.pack(side='left')
+          lab=Label(self.frame2,text = path_mc)
+          lab.grid(row=i,column=1,sticky=W)
+          e = Entry(self.frame2)
+          e.grid(row=i,column=0,sticky=W)
           e.insert(END,nom_mc)
-          e.bind("<Button-1>",lambda event,en=e,m=mc,s=self : s.select_mc(m,en))
-          e.bind("<Return>",lambda e,s=self : s.modifie_mc())
+          #e.bind("<Button-1>",lambda event,en=e,m=mc,s=self : s.select_mc(m,en))
+          #e.bind("<Return>",lambda e,s=self : s.modifie_mc())
           e.configure(relief='flat',state='disabled')
+           self.widgets.append((e,lab))
+           i=i+1
 
     def init_boutons(self):
         """
@@ -100,9 +120,10 @@ class fenetre_mc_inconnus :
        self.b_quit = Button(self.frame3,
                            text = "Fermer",
                            command = self.quit)
-       self.b_mod.place(relx=0.25,rely=0.5,anchor='center')
-       self.b_sup.place(relx=0.50,rely=0.5,anchor='center')
-       self.b_quit.place(relx=0.75,rely=0.5,anchor='center')
+       #self.b_mod.place(relx=0.25,rely=0.5,anchor='center')
+       #self.b_sup.place(relx=0.50,rely=0.5,anchor='center')
+       #self.b_quit.place(relx=0.75,rely=0.5,anchor='center')
+       self.b_quit.place(relx=0.50,rely=0.5,anchor='center')
                            
     def wait_new_list(self):
         """
@@ -120,7 +141,6 @@ class fenetre_mc_inconnus :
        """
        txt = ''
        for o in l_o :
-           print o
           txt = txt + o.nom+'/'
        # on enlève le dernier slash en trop
        txt = txt[0:-1]
@@ -156,6 +176,9 @@ class fenetre_mc_inconnus :
        """
        index = self.l_mc.index(self.mc_courant)
        self.new_l_mc[index] = None
+        e,lab=self.widgets[index]
+        e.grid_remove()
+        lab.grid_remove()
        self.desactive_boutons()
        self.desactive_entry()