Package medite :: Package GUI :: Module MainToolBar
[hide private]
[frames] | no frames]

Source Code for Module medite.GUI.MainToolBar

 1  # -*- coding: iso-8859-1 -*- 
 2  # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) 
 3  # This file is part of MEDITE. 
 4  # 
 5  #    MEDITE is free software; you can redistribute it and/or modify 
 6  #    it under the terms of the GNU General Public License as published by 
 7  #    the Free Software Foundation; either version 2 of the License, or 
 8  #    (at your option) any later version. 
 9  # 
10  #    MEDITE is distributed in the hope that it will be useful, 
11  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
13  #    GNU General Public License for more details. 
14  # 
15  #    You should have received a copy of the GNU General Public License 
16  #    along with Foobar; if not, write to the Free Software 
17  #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA 
18  #---------------------------------------------------------------------------- 
19  # Nom:          MainToolBar.py 
20  # Objet:        Classe correspondant a la barre d'outil de l'interface medite 
21  #---------------------------------------------------------------------------- 
22   
23  #from wx.Python.wx. import * 
24  import wx 
25  from Utile.constantesGUI import * 
26  import os 
27   
28  #---------------------------------------------------------------------------- 
29  #Classe correspondant a la barre d'outil de l'interface medite 
30 -class MainToolBar(wx.ToolBar):
31 - def __init__(self, parent):
32 wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize,wx.TB_HORIZONTAL | wx.NO_BORDER) 33 self.parent=parent 34 35 self.AddTool(ID_ADD_AUTEUR,self.__getImg('newAuteur.bmp'),shortHelpString = "Enregistrer Auteur", longHelpString = "Enregistrer un nouvel auteur") 36 wx.EVT_TOOL(self, ID_ADD_AUTEUR, self.parent.enregistrerAuteur) 37 38 self.AddTool(ID_ADD_OEUVRE,self.__getImg('newOeuvre.bmp'),shortHelpString = "Enregistrer Oeuvre", longHelpString = "Enregistrer une nouvelle oeuvre") 39 wx.EVT_TOOL(self, ID_ADD_OEUVRE, self.parent.enregistrerOeuvre) 40 41 self.AddSeparator() 42 43 self.AddTool(ID_CHARGER_DG,self.__getImg('chargeDG.bmp'),shortHelpString = "Charger DG", longHelpString = u"Charger un dossier g\xe9n\xe9tique") 44 wx.EVT_TOOL(self, ID_CHARGER_DG, self.parent.chargerDG) 45 46 self.AddSeparator() 47 48 self.AddTool(ID_SOURCE,self.__getImg('ouvrirFS.bmp'),shortHelpString = "Ouvrir Source", longHelpString = u"Ouvrir un état source") 49 wx.EVT_TOOL(self, ID_SOURCE, self.parent.ouvrirFicSource) 50 self.EnableTool(ID_SOURCE, False) 51 52 self.AddTool(ID_CIBLE,self.__getImg('ouvrirFC.bmp'),shortHelpString = "Ouvrir Cible", longHelpString = u"Ouvrir un état cible") 53 wx.EVT_TOOL(self, ID_CIBLE, self.parent.ouvrirFicCible) 54 self.EnableTool(ID_CIBLE, False) 55 56 self.AddTool(ID_EXECUTER,self.__getImg('executerM.bmp'),shortHelpString = "Executer Medite", longHelpString = u"Executer Medite sur les deux états ouverts") 57 wx.EVT_TOOL(self, ID_EXECUTER, self.parent.executerMedite) 58 self.EnableTool(ID_EXECUTER, False) 59 60 self.Realize()
61
62 - def __getImg(self,pNom):
63 chem=os.path.join(REPIMG,pNom) 64 return wx.Bitmap(chem,wx.BITMAP_TYPE_BMP)
65