Salome HOME
*** empty log message ***
[tools/eficas.git] / Editeur / appli.py
index e9f105aba19d246eea472b80ca6539c017623343..d6f823664b5a16f15446b6f5945bc5f39ecfdbe1 100644 (file)
@@ -35,6 +35,8 @@ from widgets import showerror
 # Modules Eficas
 import splash
 import prefs
+import styles
+from styles import style
 import fontes
 import tooltip
 import properties
@@ -42,7 +44,7 @@ from widgets import Fenetre
 from Misc import MakeNomComplet
 import session
 
-VERSION="EFICAS v1.7"
+VERSION="EFICAS v1.8"
 
 class APPLI: 
   def __init__ (self,master,code=prefs.code,fichier=None,test=0) :
@@ -79,16 +81,21 @@ class APPLI:
       # PN : ajout d un attribut pour indiquer si 
       # l appli a ete lance depuis Salome
       self.salome=0
+      self.dir=None
+
+      # Fermer le splash et deiconifier la fenetre principale si on n'est pas en test
       if (self.test == 0):
            splash.fini_splash()
            #self.affiche_FAQ()
 
-      cwd=os.getcwd()
       # Ouverture des fichiers de commandes donnes sur la ligne de commande
+      cwd=os.getcwd()
+      self.dir=cwd
       for study in session.d_env.studies:
           os.chdir(cwd)
           d=session.get_unit(study,self)
-          self.bureau.openJDC(study["comm"],d)
+          self.bureau.openJDC(file=study["comm"],units=d)
+
 
   def send_message(self,message):
       self.message=message
@@ -175,13 +182,13 @@ class APPLI:
         root.option_add('*Listbox*Font',fontes.standard)
 
   def initializeTk_colors_common(self, root):
-        root.option_add('*background', 'grey')
-        root.option_add('*foreground', 'black')
-        root.option_add('*EntryField.Entry.background', 'white')
-       root.option_add('*Entry*background', 'white')
-        root.option_add('*Listbox*background', 'white')
-        root.option_add('*Listbox*selectBackground', '#00008b')
-        root.option_add('*Listbox*selectForeground', 'white')
+        root.option_add('*background', style.background)
+        root.option_add('*foreground', style.foreground)
+        root.option_add('*EntryField.Entry.background', style.entry_background)
+       root.option_add('*Entry*background', style.entry_background)
+        root.option_add('*Listbox*background', style.list_background)
+        root.option_add('*Listbox*selectBackground', style.list_select_background)
+        root.option_add('*Listbox*selectForeground', style.list_select_foreground)
 
   def initializeTk_mac(self, root):
         self.initializeTk_colors_common(root)
@@ -235,15 +242,22 @@ class APPLI:
       radio=None
       for item in itemlist:
          number_item=number_item + 1
+        raccourci_label=""
          if not item :
             menu.add_separator()
          else:
             if len(item)==3:
                raccourci=item[2]
+              raccourci_label="   "+raccourci
                newitem=(item[0],item[1])
             else :
-              raccourci=""
-               newitem=item
+              if len(item)==4:
+                  raccourci=item[2]
+                 raccourci_label="   "+item[3]
+                  newitem=(item[0],item[1])
+              else :
+                 raccourci=""
+                  newitem=item
             item=newitem
             label,method=item
             if type(method) == types.TupleType:
@@ -258,7 +272,7 @@ class APPLI:
                if radio == None:radio=number_item
             else:
                command=getattr(appli_composant,method)
-               menu.add_command(label=label,command=command)
+               menu.add_command(label=label,accelerator=raccourci_label,command=command)
                if raccourci != "" :
                   self.top.bind(raccourci,command)
       # Si au moins un radiobouton existe on invoke le premier