Salome HOME
menage
[tools/eficas.git] / Aster / style.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2007-2012   EDF R&D
3 #
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
8 #
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # Lesser General Public License for more details.
13 #
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20 """
21 Pour modifier le style d'EFICAS  il faut ajouter un fichier style.py qui contiendra les
22 informations sur le style voulu dans son repertoire Eficas_install.
23
24 La methode la plus simple consiste à modifier directement les attributs de l'objet style dans le 
25 fichier style.py d'Eficas_install. Exemple::
26
27     style.background='yellow'
28
29 pour modifier la couleur du background.
30
31 Il existe une autre méthode qui peut être utilisée quand on veut modifier plusieurs propriétés à la fois.
32
33 Le fichier style.py doit définir une nouvelle classe qui dérive de la classe de base STYLE avec des attributs
34 de classe qui définiront le nouveau style (par exemple, si on veut modifier le background)::
35
36    class STYLE(STYLE):
37        background='yellow'
38
39 Il faut ensuite instancier cette classe, dans ce meme fichier, en donnant le nom style à l'objet cree::
40
41    style=STYLE()
42
43 Tous les attributs de classe possibles sont visibles dans le module Editeur/basestyle.py::
44
45     background='gray90'
46     foreground='black'
47     entry_background='white'
48     list_background='white'
49     list_select_background='#00008b'
50     list_select_foreground='grey'
51     tooltip_background="yellow"
52
53     standard = ("Helvetica",12)
54     standard_italique = ("Helvetica",12,'italic')
55     standard_gras = ("Helvetica",12,'bold')
56     standard_gras_souligne = ("Helvetica",12,'bold','underline')
57
58     canvas = ('Helvetica',10)
59     canvas_italique = ('Helvetica',10,'italic')
60     canvas_gras = ("Helvetica",10,'bold')
61     canvas_gras_italique = ("Helvetica",12,'bold','italic')
62
63     standard12 = ("Helvetica",14)
64     standard12_gras = ("Helvetica",14,'bold')
65     standard12_gras_italique = ( "Helvetica",14,'bold','italic')
66
67
68 Le fichier style.py contenu dans le répertoire Aster permet de spécifier des propriétés globales pour une installation.
69 Les modifications de style contenues dans ce fichier et dans le fichier style.py d'Eficas_install
70 sont prises en compte dans cet ordre.
71 """
72
73 p1=10
74 p2=14
75 f1="Helvetica"
76
77 style.background='gray90'
78 style.foreground='black'
79 style.standard = (f1,p1)
80 style.standard_italique = (f1,p1,'italic')
81 style.standard_gras = (f1,p1,'bold')
82 style.canvas_italique = (f1,p1,'italic')
83 style.canvas_gras = (f1,p1,'bold')
84 style.statusfont = (f1,p2)