Salome HOME
PN : pour afficher correctement les arguments de la formule nouvelle.
[tools/eficas.git] / Editeur / toolbar.py
index e99a56de3109de28f874a400cc4cea0059c27ffc..7e549db9fe0017cc149f2c48493fa3c38b8c5c4b 100644 (file)
@@ -1,3 +1,23 @@
+# -*- coding: utf-8 -*-
+#            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
@@ -27,52 +47,6 @@ class TOOLBAR:
       b.bind("<Enter>",lambda e,s=self,but=b,t=texte : s.affiche_balloon(e,but,t,pos='right'))
       b.bind("<Leave>", self.efface_balloon)
 
-      #self.creer_boutons()
-
-  def creer_boutons(self):
-      self.l_boutons = (('New24',self.appli.newJDC,"Création d'un nouveau fichier",'always'),
-                        ('Open24',self.appli.openJDC,"Ouverture d'un fichier existant",'always'),
-                        ('Save24',self.appli.saveJDC,"Sauvegarde du fichier courant",'always'),
-                        ('Zoom24',self.appli.visuJDC,"Visualisation du fichier de commandes",'always'),
-                        None,
-                        ('Copy24',self.appli.copy,"Copie l'objet courant",'jdc'),
-                        ('Cut24',self.appli.cut,"Coupe l'objet courant",'jdc'),
-                        ('Paste24',self.appli.paste,"Colle l'objet copié après l'objet courant",'jdc'),
-                        None,
-                        ('Delete24',self.appli.delete,"Supprime l'objet courant",'jdc'),
-                        ('Help24',self.appli.view_doc,"Documentation de l'objet courant",'jdc')
-                        )
-      # liste des boutons à activer quand statut != 'always'
-      self.l_boutons_a_activer = [] 
-
-      for bouton in self.l_boutons :
-          if not bouton :
-              # on veut afficher un bouton vide (=espace entre boutons)
-              Button(self.barreboutons,
-                     image = images.get_image('New24'),
-                     relief = 'flat').pack(side='left')
-              continue
-          nom_fic,commande,texte,statut = bouton
-          b = Button(self.barreboutons,
-                     image = images.get_image(nom_fic),
-                     command = commande,
-                     relief='flat')
-          b.pack(side='left')
-          b.bind("<Enter>",lambda e,s=self,but=b,t=texte : s.affiche_balloon(e,but,t))
-          b.bind("<Leave>", self.efface_balloon)
-          if statut != 'always':
-              self.l_boutons_a_activer.append(b)
-      # bouton Infos à l'extrême droite de la barre des boutons
-      b = Button(self.barreboutons,
-                 image = images.get_image('About24'),
-                 command = self.view_infos)
-      b.pack(side='right')
-      texte = "Infos EFICAS"
-      b.bind("<Enter>",lambda e,s=self,but=b,t=texte : s.affiche_balloon(e,but,t,pos='right'))
-      b.bind("<Leave>", self.efface_balloon)
-      # inactive les boutons qui doivent l'être tant qu'aucun JDC courant
-      self.inactive_boutons()
-
   def inactive_boutons(self):
       """
       Inactive les boutons de la liste self.l_boutons_a_activer
@@ -137,16 +111,17 @@ class TOOLBAR:
       """
       self.fen_infos.destroy()
 
-  def creer_boutons_extension(self,l_boutons,extension):
+  def creer_boutons_appli_composant(self,l_boutons,appli_composant):
       for bouton in l_boutons :
           if not bouton :
               # on veut afficher un bouton vide (=espace entre boutons)
               Button(self.barreboutons,
-                     image = images.get_image('New24'),
+                     image = images.get_image('Sep'),
+                     state='disabled',
                      relief = 'flat').pack(side='left')
               continue
           nom_fic,commande,texte,statut = bouton
-          commande=getattr(extension,commande)
+          commande=getattr(appli_composant,commande)
           b = Button(self.barreboutons,
                      image = images.get_image(nom_fic),
                      command = commande,