# -*- coding: iso-8859-1 -*- # Copyright 20003 - 2008: Julien Bourdaillet (julien.bourdaillet@lip6.fr), Jean-Gabriel Ganascia (jean-gabriel.ganascia@lip6.fr) # This file is part of MEDITE. # # MEDITE 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. # # MEDITE 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 Foobar; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #---------------------------------------------------------------------------- # Nom: MainToolBar.py # Objet: Classe correspondant a la barre d'outil de l'interface medite #---------------------------------------------------------------------------- #from wx.Python.wx. import * import wx from Utile.constantesGUI import * import os #---------------------------------------------------------------------------- #Classe correspondant a la barre d'outil de l'interface medite class MainToolBar(wx.ToolBar): def __init__(self, parent): wx.ToolBar.__init__(self, parent, -1, wx.DefaultPosition, wx.DefaultSize,wx.TB_HORIZONTAL | wx.NO_BORDER) self.parent=parent self.AddTool(ID_ADD_AUTEUR,self.__getImg('newAuteur.bmp'),shortHelpString = "Enregistrer Auteur", longHelpString = "Enregistrer un nouvel auteur") wx.EVT_TOOL(self, ID_ADD_AUTEUR, self.parent.enregistrerAuteur) self.AddTool(ID_ADD_OEUVRE,self.__getImg('newOeuvre.bmp'),shortHelpString = "Enregistrer Oeuvre", longHelpString = "Enregistrer une nouvelle oeuvre") wx.EVT_TOOL(self, ID_ADD_OEUVRE, self.parent.enregistrerOeuvre) self.AddSeparator() self.AddTool(ID_CHARGER_DG,self.__getImg('chargeDG.bmp'),shortHelpString = "Charger DG", longHelpString = u"Charger un dossier g\xe9n\xe9tique") wx.EVT_TOOL(self, ID_CHARGER_DG, self.parent.chargerDG) self.AddSeparator() self.AddTool(ID_SOURCE,self.__getImg('ouvrirFS.bmp'),shortHelpString = "Ouvrir Source", longHelpString = u"Ouvrir un état source") wx.EVT_TOOL(self, ID_SOURCE, self.parent.ouvrirFicSource) self.EnableTool(ID_SOURCE, False) self.AddTool(ID_CIBLE,self.__getImg('ouvrirFC.bmp'),shortHelpString = "Ouvrir Cible", longHelpString = u"Ouvrir un état cible") wx.EVT_TOOL(self, ID_CIBLE, self.parent.ouvrirFicCible) self.EnableTool(ID_CIBLE, False) self.AddTool(ID_EXECUTER,self.__getImg('executerM.bmp'),shortHelpString = "Executer Medite", longHelpString = u"Executer Medite sur les deux états ouverts") wx.EVT_TOOL(self, ID_EXECUTER, self.parent.executerMedite) self.EnableTool(ID_EXECUTER, False) self.AddTool(ID_INIT,self.__getImg('init.bmp'),shortHelpString = "init", longHelpString = u"init") wx.EVT_TOOL(self, ID_INIT, self.parent.initialiserTextes) #self.EnableTool(ID_INIT, False) self.Realize() def __getImg(self,pNom): chem=os.path.join(REPIMG,pNom) return wx.Bitmap(chem,wx.BITMAP_TYPE_BMP)