1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| #!/usr/bin/env python
# -*- coding: cp1252 -*-
# module2.py
import wx
#-------------------------------------------------------------------------
class Barre_Outils_01(wx.Panel):
"""Barre d'outils de la fenêtre principale"""
#-------------------------------------------------------------------------
def __init__(self, parent):
wx.Panel.__init__(self, parent)
TBFLAGS = ( wx.TB_HORIZONTAL
| wx.NO_BORDER
| wx.TB_FLAT
)
tb = wx.ToolBar(self, style=TBFLAGS) # self
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(tb, 0, wx.EXPAND)
self.SetSizer(sizer)
tsize = (24,24)
# Définition des différents icones de la barre d'outils
Png_01 = wx.Bitmap("exit.png")
Png_02 = wx.Bitmap("book.png")
Png_03 = wx.Bitmap("linux.png")
tb.SetToolBitmapSize(tsize)
# Dessine la Barre d'outils
tb.AddLabelTool(10, "", Png_01)
tb.AddSeparator()
tb.AddLabelTool(20, "", Png_02)
tb.AddSeparator()
tb.AddLabelTool(30, "", Png_03)
tb.AddSeparator()
tb.Realize()
self.SetBackgroundColour('blue') # Bleu
#-------------------------------------------------------------------------
#-------------------------------------------------------------------------
class Interface_Graphique_01(wx.Panel):
"""Interface_Graphique de la fenêtre principale"""
#-------------------------------------------------------------------------
def __init__(self, parent):
wx.Panel.__init__(self, parent, -1)
panel = wx.Panel(self, -1)
panel.SetBackgroundColour('#4f5049') # Gris foncé
midPan = wx.Panel(panel, -1)
midPan.SetBackgroundColour('#ededed') # Gris clair
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(midPan, 1, wx.EXPAND | wx.ALL, 20)
sizer.Add(panel, 1, wx.EXPAND)
self.SetSizer(sizer) |
Partager