#!/usr/bin/python # -*- coding: cp1252 -*- # Module : Module4.py import wx import Module3 import Main from Module2 import * #------------------------------------------------------------------------- class MaBarreOutils(wx.Panel): """Barre d'outils de la fenętre principale""" #------------------------------------------------------------------------- def __init__(self, parent): wx.Panel.__init__(self, parent, -1) TBFLAGS = ( wx.TB_HORIZONTAL | wx.NO_BORDER | wx.TB_FLAT ) tb = wx.ToolBar(self, style=TBFLAGS) # self line = wx.StaticLine(self, -1) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(tb, 0, wx.EXPAND) self.SetSizer(sizer) tsize = (24,24) tb.SetToolBitmapSize(tsize) # Résolution Moins tb.AddLabelTool(40, "Résolution Moins", wx.Bitmap(gloIcn['Moins_png']), shortHelp="Résolution Moins", longHelp="Diminue la résolution de la Map") self.Bind(wx.EVT_TOOL, self.OnMoins, id=40) # Résolution Origine tb.AddLabelTool(35, "Résolution Origine", wx.Bitmap(gloIcn['Origine_png']), shortHelp="Résolution Origine", longHelp="affiche la résolution maxi de la Map") self.Bind(wx.EVT_TOOL, self.OnOrigine, id=35) # Résolution Plus tb.AddLabelTool(30, "Résolution Plus", wx.Bitmap(gloIcn['Plus_png']), shortHelp="Résolution Plus", longHelp="Augmente la résolution de la Map") self.Bind(wx.EVT_TOOL, self.OnPlus, id=30) tb.Realize() def OnPlus(self, event): if gloImg['ratio'] < gloImg['ratio_Maxi'] and gloImg['imgORIG'] != None: gloImg['ratio'] = gloImg['ratio'] + gloImg['inc'] largeur = (gloImg['imgORIX'] * gloImg['ratio'])/100 hauteur = (gloImg['imgORIY'] * gloImg['ratio'])/100 bmpRESU = gloImg['imgORIG'].Scale(largeur, hauteur).ConvertToBitmap() tempo = wx.GetTopLevelParent(self).MonInterfaceGraphique.P_Map.Affiche(bmpRESU, gloImg['ratio']) def OnOrigine(self, event): if gloImg['imgORIG'] != None: gloImg['ratio'] = gloImg['imgRatiORIG'] largeur = (gloImg['imgORIX'] * gloImg['ratio'])/100 hauteur = (gloImg['imgORIY'] * gloImg['ratio'])/100 bmpRESU = gloImg['imgORIG'].Scale(largeur, hauteur).ConvertToBitmap() tempo = wx.GetTopLevelParent(self).MonInterfaceGraphique.P_Map.Affiche(bmpRESU, gloImg['ratio']) def OnMoins(self, event): if gloImg['ratio'] > gloImg['ratio_Mini'] and gloImg['imgORIG'] != None: gloImg['ratio'] = gloImg['ratio'] - gloImg['inc'] largeur = (gloImg['imgORIX'] * gloImg['ratio'])/100 hauteur = (gloImg['imgORIY'] * gloImg['ratio'])/100 bmpRESU = gloImg['imgORIG'].Scale(largeur, hauteur).ConvertToBitmap() tempo = wx.GetTopLevelParent(self).MonInterfaceGraphique.P_Map.Affiche(bmpRESU, gloImg['ratio'])