#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # generated by wxGlade 0.5 on Wed Sep 26 22:17:31 2007 from D:\python\cutline\cutline03.wxg import wx,time class MyFrame(wx.Frame): def __init__(self, *args, **kwds): # begin wxGlade: MyFrame.__init__ kwds["style"] = wx.DEFAULT_FRAME_STYLE wx.Frame.__init__(self, *args, **kwds) self.label_1 = wx.StaticText(self, -1, " Fichier source") self.button_1 = wx.Button(self, -1, "Parcourir") self.text_ctrl_1 = wx.TextCtrl(self, -1, "") self.label_2 = wx.StaticText(self, -1, " Garder une ligne sur") self.label_5 = wx.StaticText(self, -1, "..................") self.text_ctrl_2 = wx.TextCtrl(self, -1, "") self.label_3 = wx.StaticText(self, -1, " Fichier destination") self.button_2 = wx.ToggleButton(self, -1, "Auto") self.text_ctrl_3 = wx.TextCtrl(self, -1, "") self.label_4 = wx.StaticText(self, -1, " Etat") self.button_3 = wx.Button(self, -1, "Go") self.label_6 = wx.StaticText(self, -1, " Cutline 1.0") self.__set_properties() self.__do_layout() self.Bind(wx.EVT_BUTTON, self.parcourir, self.button_1) self.Bind(wx.EVT_TOGGLEBUTTON, self.auto, self.button_2) self.Bind(wx.EVT_BUTTON, self.go, self.button_3) self.compteur=0 # end wxGlade def __set_properties(self): # begin wxGlade: MyFrame.__set_properties self.SetTitle("Cutline") self.SetBackgroundColour(wx.Colour(213, 213, 213)) self.text_ctrl_1.SetMinSize((500, 24)) self.text_ctrl_3.SetMinSize((500, 24)) # end wxGlade def __do_layout(self): # begin wxGlade: MyFrame.__do_layout sizer_1 = wx.BoxSizer(wx.VERTICAL) grid_sizer_1 = wx.FlexGridSizer(4, 3, 2, 2) grid_sizer_1.Add(self.label_1, 0, 0, 0) grid_sizer_1.Add(self.button_1, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_1, 0, 0, 0) grid_sizer_1.Add(self.label_2, 0, 0, 0) grid_sizer_1.Add(self.label_5, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_2, 0, 0, 0) grid_sizer_1.Add(self.label_3, 0, 0, 0) grid_sizer_1.Add(self.button_2, 0, 0, 0) grid_sizer_1.Add(self.text_ctrl_3, 0, 0, 0) grid_sizer_1.Add(self.label_4, 0, 0, 0) grid_sizer_1.Add(self.button_3, 0, 0, 0) grid_sizer_1.Add(self.label_6, 0, 0, 0) sizer_1.Add(grid_sizer_1, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) sizer_1.Fit(self) self.Layout() # end wxGlade def auto(self, event): # wxGlade: MyFrame. print "Event handler `auto' not implemented" event.Skip() def parcourir(self, event): # wxGlade: MyFrame. print "Event handler `parcourir' not implemented" event.Skip() def go(self, event): # wxGlade: MyFrame. print "Event handler `go' not implemented" self.compteur+=1 self.label_6.SetLabel(str(self.compteur)) event.Skip() # end of class MyFrame if __name__ == "__main__": print "--------------" app = wx.App(0) wx.InitAllImageHandlers() frame_1 = MyFrame(None, -1, "") app.SetTopWindow(frame_1) frame_1.Show() app.MainLoop()