Salome HOME
*** empty log message ***
[tools/eficas.git] / Editeur / options.py
index d08c6c2e897901f486ffdd275a6dc211d8e09c4c..3e725e2ca727878bc0421300a13482ef05f625e1 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
 """
 # Modules Python
 import os,string
-from tkFileDialog import *
 
 # Modules Eficas
+from widgets import askopenfilename
+import panels
 
+# l'option affichage_commandes peut prendre les valeurs "groupes" ou "alphabetic"
+affichage_commandes="alphabetic"
 
 class OPTIONS:
 
    menu_defs=[
-              ('Options',[
-                           ("Catalogue développeur",'choix_cata_developpeur'),
-                         ]
-              )
+        ('Options',[
+                   ("Affichage commandes",(("alphabétique",'&affichage_alpha'),("groupes",'&affichage_grp'))),
+                   #("Couleur",(("fond",'change_fond'),("barre",'change_barre'))),
+                   # ("Catalogue développeur",'choix_cata_developpeur'),
+                   ]
+        )
              ]
 
    button_defs=[]
@@ -41,6 +47,34 @@ class OPTIONS:
       self.appli=appli
       self.parent=parent
 
+   def affichage_grp(self):
+      global affichage_commandes
+      affichage_commandes="groupes"
+      if hasattr(panels,'panneauCommande'):
+         panel=panels.panneauCommande
+        parent=panel.parent
+        if parent != None :
+           parent.create_panel(parent.node_selected)
+           parent.panel_courant.nb.selectpage("Commande")
+
+   def affichage_alpha(self):
+      global affichage_commandes
+      affichage_commandes="alphabetic"
+      if hasattr(panels,'panneauCommande'):
+         panel=panels.panneauCommande
+        parent=panel.parent
+        if parent != None :
+           parent.create_panel(parent.node_selected)
+           parent.panel_courant.nb.selectpage("Commande")
+
+   def change_fond(self):
+      from tkColorChooser import askcolor
+      #nouvelle=askcolor(self.appli.background)
+      nouvelle=askcolor('grey')
+
+   def change_barre(self):
+       pass
+
    def choix_cata_developpeur(self):
       """ 
           Cette méthode demande à l'utilisateur-développeur d'indiquer quel catalogue
@@ -51,7 +85,7 @@ class OPTIONS:
       file = askopenfilename(title="Choix d'un catalogue personnel",
                              defaultextension=".py",
                              filetypes = ( ("Catalogue", "cata*.py"),))
-      if file != '':
+      if file :
           self.parent.update_idletasks()
           self.appli.reset_affichage_infos()
           rep_fic = os.path.dirname(file)