Salome HOME
PN : pour afficher correctement les arguments de la formule nouvelle.
[tools/eficas.git] / Editeur / toolbar.py
index bd93737a4fd216724dbb8ef4daf41895ca22bf54..7e549db9fe0017cc149f2c48493fa3c38b8c5c4b 100644 (file)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8 -*-
 #            CONFIGURATION MANAGEMENT OF EDF VERSION
 # ======================================================================
 # COPYRIGHT (C) 1991 - 2002  EDF R&D                  WWW.CODE-ASTER.ORG
@@ -46,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
@@ -156,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,