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
| #-*- coding:utf-8 -*-
import wx
import export_pdf
import reportlab
import select_new
import os.path
l = 920
h = 800
ID_EXPORT = 101
class Root(wx.Frame):
def __init__(self, titre):
wx.Frame.__init__(self, None, -1, title = titre, size = (l,h))
self.Center(True)
self.font0 = wx.Font(8, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, 'Verdana')
self.font1 = wx.Font(8, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD, False, 'Verdana')
self.font2 = wx.Font(8, wx.FONTFAMILY_DECORATIVE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, 'Verdana')
self.font3 = (224, 223, 227, 255)
self.font4 = wx.NamedColour('Green')
self.font5 = wx.NamedColour('Dark Blue')
menuFichier = wx.Menu()
menuFichier.Append(wx.ID_NEW, "Nouveau")
menuFichier.Append(ID_EXPORT, "Export PDF", "Permet l'export au format PDF du projet")
menuBarre = wx.MenuBar()
menuBarre.Append(menuFichier, "Fichier")
def new_project(self, evt):
#cette fonction me permet d'ouvrir une nouvelle class frame me permettant
#de choisir un projet. Une fois cette étape validée, j'ai une fonction qui crée le
#notebook avec une nouvelle page, panel, wxWidget..."""
frame = select_new.frame(self, l, h)
evt.Skip()
def export(self, evt):
#Cette fonction doit me permettre de récupérer les valeurs des wxWidget du
#de la page actuelle de mon notebook (par exemple e_dep qui est un TextCtrl
titre = self.book.GetPageText(self.book.GetSelection())
a = panel.e_dep.GetValue()
print a
#export_pdf.frame(self, titre, a)
def close_book(self, evt):
try:
self.book.DeletePage(self.book.GetSelection())
except:pass
evt.Skip()
class MonApp(wx.App):
def OnInit(self):
fen = Root('AtellConf 0.1a')
fen.Show(True)
self.SetTopWindow(fen)
return True
app = MonApp()
app.MainLoop() |
Partager