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
|
class MainWindow (wx.Frame):
def __init__ (self, parent, ID, title, pos=wx.DefaultPosition, \
size=wx.DefaultSize, style=wx.DEFAULT_FRAME_STYLE):
wx.Frame.__init__(self, parent, ID, title, pos, size, style)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
self.locale = code.Locale("fr_FR.aff","fr_FR.locale")
self.blocklist = code.BlockList()
self.dico = code.Dico (False)
[...]
def OnOuvrir (self, event):
dial = wx.FileDialog ( self, "Ouvrir un dictionnaire", "", "", \
"Dictionnaire (*.dic)|*.dic", \
wx.OPEN | wx.HIDE_READONLY )
if (dial.ShowModal() == wx.ID_OK) & os.path.exists(dial.GetPath()):
self.WaitPointer()
self.stat_bar.SetStatusText("Lecture du fichier...", 0)
self.blocklist.Vider()
self.blocklist.ReadFile(dial.GetPath())
self.SetTitle(code.ID_VERSION + " -- " + dial.GetPath())
self.stat_bar.SetStatusText("Tri en cours...", 0)
self.blocklist.Trier()
self.MaJ()
self.stat_bar.SetStatusText("", 0)
self.ActivePointer() |
Partager