X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=KeyFrame.py;h=20cb046c42594bb72ef51d330c3bae5b27793cfa;hp=2c4090900638078ddfc5c6ecb0cd7fae429ca4c4;hb=58a5e544fea2eeaabf07c13437514450ab91cdc5;hpb=22cd27b2bbe9ab1ffa7ef06fa764b5147ae17dad diff --git a/KeyFrame.py b/KeyFrame.py index 2c40909..20cb046 100755 --- a/KeyFrame.py +++ b/KeyFrame.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- #Author: Pierre Ratinaud #Copyright (c) 2008 Pierre Ratinaud -#Lisense: GNU/GPL +#License: GNU/GPL import wx -from functions import sortedby +from functions import sortedby, DoConf # begin wxGlade: extracode # end wxGlade @@ -43,7 +43,7 @@ class AlcOptFrame(wx.Dialog): 'nr' : [wx.NewId(),wx.NewId(),u"Formes non reconnues"], } self.parent=parent - self.KeyConf=self.parent.KeyConf + self.keys=self.parent.keys self.listlabel=[] self.listspin=[] self.listbutton=[] @@ -58,7 +58,7 @@ class AlcOptFrame(wx.Dialog): for line in self.listcleori: cle,ids,idb,label=line self.listlabel.append(wx.StaticText(self, -1, label)) - self.listspin.append(wx.SpinCtrl(self, ids,self.KeyConf.get('KEYS',cle), min=0, max=2)) + self.listspin.append(wx.SpinCtrl(self, ids,`self.keys[cle]`, min=0, max=2)) #if cle != 'nr' and cle!= 'num' : self.listbutton.append(wx.Button(self, idb, u"voir liste")) self.listids.append(ids) @@ -66,12 +66,12 @@ class AlcOptFrame(wx.Dialog): self.listcle.append(cle) - self.button_val = wx.Button(self,wx.ID_APPLY) + self.button_val = wx.Button(self, wx.ID_OK) for button in self.listbutton : self.Bind(wx.EVT_BUTTON,self.OnShowList,button) - self.Bind(wx.EVT_BUTTON, self.OnApply, self.button_val) + #self.Bind(wx.EVT_BUTTON, self.OnApply, self.button_val) self.dico=self.parent.parent.lexique#'dictionnaires/lexique.txt') @@ -118,25 +118,21 @@ class AlcOptFrame(wx.Dialog): def CreateList(self,type): if type=='ver_sup' or type=='ver': - liste=[descr[0] for item,descr in self.dico.iteritems() if descr[1]==type] + #liste=[descr[0] for item,descr in self.dico.iteritems() if descr[1]==type] + liste = [forme for forme in self.corpus.formes if self.corpus.formes[forme].gram==type] liste=list(set(liste)) else: - liste=[item for item,descr in self.dico.iteritems() if descr[1]==type] + #liste=[item for item,descr in self.dico.iteritems() if descr[1]==type] + liste = [forme for forme in self.corpus.formes if self.corpus.formes[forme].gram==type] liste.sort() txt=('\n').join(liste) - ListViewFrame=ListView(self.parent.parent) + ListViewFrame=ListView(self.parent) ListViewFrame.text_ctrl_1.WriteText(txt) ListViewFrame.text_ctrl_1.SetSelection(0,0) ListViewFrame.text_ctrl_1.SetInsertionPoint(0) ListViewFrame.CenterOnParent() val=ListViewFrame.ShowModal() - def OnApply(self,evt): - for i in range(0,len(self.listlabel)): - self.KeyConf.set('KEYS',self.listcle[i],`self.listspin[i].GetValue()`) - self.Destroy() - - class ListView(wx.Dialog): def __init__(self, parent): wx.Dialog.__init__(self, parent, size=wx.Size(200, 400),style=wx.DEFAULT_DIALOG_STYLE)