# -*- coding: iso-8859-1 -*-
#
#-------------------------------------------------------------------------------
# Code_Saturne version 1.3
# ------------------------
#
#
# This file is part of the Code_Saturne User Interface, element of the
# Code_Saturne CFD tool.
#
# Copyright (C) 1998-2007 EDF S.A., France
#
# contact: saturne-support@edf.fr
#
# The Code_Saturne User Interface 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.
#
# The Code_Saturne User Interface 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 the Code_Saturne Kernel; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA
#
#-------------------------------------------------------------------------------
"""
This module defines constant used by almost all the code: it creates a
few 'instance' variables that are used for common access across all other files.
This module is the only that can not to be reloaded with 'Ctrl+A'.
"""
#-------------------------------------------------------------------------------
# Library modules import
#-------------------------------------------------------------------------------
import os.path, string
#-------------------------------------------------------------------------------
# Application modules import
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
# Version number
#-------------------------------------------------------------------------------
# SaturneGUI Version - remember to change this!
#
VERSION = "1.1.l"
#-------------------------------------------------------------------------------
# Global display data
#-------------------------------------------------------------------------------
DISPLAY_WIDTH = 680
DISPLAY_HEIGHT = 750
SCREEN_X_PIXEL = 80
SCREEN_Y_PIXEL = 100
SCREEN_X_PIXEL = 10
SCREEN_Y_PIXEL = 10
TREE_WIDTH = 200
LENGHT_WIDTH = 230
#-------------------------------------------------------------------------------
# Global XML data
#-------------------------------------------------------------------------------
#TODELETE
#ROOT = "Code_Saturne_GUI"
#ATTR_VERSION = "version"
#ATTR_STUDY = "study"
#ATTR_CASE = "case"
#TODELETE
#-------------------------------------------------------------------------------
# Setup Windows Manager initialization
#-------------------------------------------------------------------------------
wm = {}
# 1) current regular (and used) options reconized by the Windows Manager
wm['activebackground'] = "lightgrey" # background for focused widget
wm['activeforeground'] = "black" # foreground for focused widget
wm['background'] = "ivory" # main bg color for the application
wm['borderwidth'] = 2 #- this option does not work !
wm['disabledbackground'] = "pink" #? this option does not work !
wm['disabledforeground'] = "#808080" # foreground for Button (Select/OptionMenu) wich is DISABLED
wm['disabledtextbackground'] = "pink" #? this option does not work !
wm['fixed_font'] = "courier -12" #- not used
wm['fixedfamily'] = "courier" #- not used
wm['focusmodel'] = "clicktofocus" # the other possibility us tk_focusFollowMouse
wm['font'] = "helvetica" # family of the standard font
wm['fontsize'] = 12 # size of the standard font
wm['foreground'] = "black" # color used to render the text
wm['highlightbackground'] = "ivory" # color of the focus highlight when the widget does not have focus
wm['highlightcolor'] = "black" # color of the focus highlight when the widget has the focus
wm['highlightthickness'] = 2 # size of the focus highlight
wm['menu_font'] = "helvetica -12" #- not used
wm['menubackground'] = "ivory" #- this option does not work !
wm['menufamily'] = "helvetica"
wm['menuforeground'] = "black" #- this option does not work !
wm['scrollbars'] = "grey" # background of the scrollbars
wm['selectbackground'] = "green" # color used to render selected the text for entry and listbox
wm['selectcolor'] = "red" # color for pushed radiobutton or checkbutton
wm['selectforeground'] = "black" # color to use displaying selected text for entry and listbox
wm['system_font'] = "helvetica -12" #- not used
wm['systemfamily'] = "helvetica" #- not used
wm['text_font'] = "helvetica -12" #- not used
wm['textfamily'] = "helvetica" #- not used
wm['textbackground'] = "white" # background for Entry and Listbox
wm['textforeground'] = "black" # color used to render the text for entry and listbox
# 2) supplementary convenience stuff
wm['identity'] = "lightblue" # background of label in Identity bar and IdentityAndPathes Pages
wm['inactivebackground'] = "wheat" # background of inactive tag from Notebook
wm['treebackground'] = "white" # background of the NavigatorTree
wm['treeselectcolor'] = "blue" # color used to render selected the text for Hlist ans Tree
wm['hlistbackground'] = "white" # background for HList Tree DirTree
wm['selectvalidate'] = "green" # color used to render validated data in Entry
wm['selecterror'] = "red" # color used to render unvalidated data in Entry
#-------------------------------------------------------------------------------
# General font declaration:
# Any widgets are created with a default font specified in the module
# Toolbox.py, unless its font is overriden by a font option in widget
# constructor.
#-------------------------------------------------------------------------------
#TODELETE
### Standard font
###
##fN = (wm['font'], wm['fontsize'], "normal", "roman")
### StudyBar, StudyIdBar, NavigatorTree fonts
###
##fS = (wm['font'], wm['fontsize'], "normal", "roman")
##fI = (wm['font'], wm['fontsize']-2, "normal", "roman")
##fH = (wm['font'], wm['fontsize']-2, "bold", "roman")
### Pages: Title, Heading, Symbol fonts
###
##fT = (wm['font'], wm['fontsize'], "bold", "italic")
##fB = (wm['font'], wm['fontsize'], "bold", "roman")
##fG = ('Symbol', wm['fontsize'], "normal", "roman")
##fW = ("times", 18, "bold")
### FIXME: fonts to delete
###
##fL = (wm['font'], wm['fontsize']+2, "bold", "roman")
##fY = (wm['font'], wm['fontsize']+2, "normal", "roman")
#TODELETE
# Font for the Main Title
#
fW = '-*-times-bold-r-normal-*-18-*-*-*-*-*-*-*'
# Font for the Tree Navigator
#
fH = '-*-helvetica-bold-r-normal-*-10-*-*-*-*-*-*-*'
# Font for the Status Bar
#
fS = '-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*'
# Font for the Identity Bar
#
fI = '-*-helvetica-medium-r-normal-*-10-*-*-*-*-*-*-*'
# Font for the Menu Bar
#
#fM = '-*-times-medium-r-normal-*-12-*-*-*-*-*-*-*'
fM = '-*-helvetica-normal-r-normal-*-12-*-*-*-*-*-*-*'
# Font for the Pages (title, normal, bold)
#
fT = '-*-helvetica-bold-o-normal-*-12-*-*-*-*-*-*-*'
fN = '-*-helvetica-normal-r-normal-*-12-*-*-*-*-*-*-*'
fB = '-*-helvetica-bold-r-normal-*-12-*-*-*-*-*-*-*'
fL = '-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*'
fY = '-*-helvetica-normal-r-normal-*-14-*-*-*-*-*-*-*'
# Font for greek symbols
#
fG = '-*-symbol-normal-r-normal-*-14-*-*-*-*-*-*-*'
#-------------------------------------------------------------------------------
# Pictures and icons path
#-------------------------------------------------------------------------------
PIC_PATH = os.path.dirname(os.path.abspath(__file__)) + '/../Pictures/'
#-------------------------------------------------------------------------------
# Pages path
#-------------------------------------------------------------------------------
PAGES_PATH = os.path.dirname(os.path.abspath(__file__))
PAGES_PATH = string.join(string.split(PAGES_PATH,'/')[:-1],'/') + '/Pages'
#-------------------------------------------------------------------------------
# Global constants
#-------------------------------------------------------------------------------
GRAND = 1.0e+12
SPGRAND = "1e+12"
SMGRAND = "-1e+12"
#-------------------------------------------------------------------------------
# End of Common
#-------------------------------------------------------------------------------
syntax highlighted by Code2HTML, v. 0.9.1