X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=dialog.py;h=e97d19e05663a18cc6e7a614f09bede9d8c46190;hp=8ff0e0fcb96df21da13f76c160170c0fb945db47;hb=13666be5de5eeffbe63774c3c0aecd407b519ac6;hpb=8fa853a25a9d62b1446e1bc543e5a3a4d0e03dcf diff --git a/dialog.py b/dialog.py index 8ff0e0f..e97d19e 100755 --- a/dialog.py +++ b/dialog.py @@ -10,6 +10,7 @@ import wx.lib.filebrowsebutton as filebrowse import locale import os import sys +#from listlex import * from KeyFrame import AlcOptFrame #--------------------------------------------------------------------------- provider = wx.SimpleHelpProvider() @@ -18,7 +19,7 @@ wx.HelpProvider_Set(provider) #--------------------------------------------------------------------------- -encodages = [[u'cp1252',u'Windows'], [u'utf-8',u'Linux'], [u'MacRoman',u'MacOs X'], [u'ascii', u'English'], [u'big5', u'Traditional Chinese'], [u'big5hkscs', u'Traditional Chinese'], [u'cp037', u'English'], [u'cp424', u'Hebrew'], [u'cp437', u'English'], [u'cp500', u'Western Europe'], [u'cp737', u'Greek'], [u'cp775', u'Baltic languages'], [u'cp850', u'Western Europe'], [u'cp852', u'Central and Eastern Europe'], [u'cp855', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp856', u'Hebrew'], [u'cp857', u'Turkish'], [u'cp860', u'Portuguese'], [u'cp861', u'Icelandic'], [u'cp862', u'Hebrew'], [u'cp863', u'Canadian'], [u'cp864', u'Arabic'], [u'cp865', u'Danish, Norwegian'], [u'cp866', u'Russian'], [u'cp869', u'Greek'], [u'cp874', u'Thai'], [u'cp875', u'Greek'], [u'cp932', u'Japanese'], [u'cp949', u'Korean'], [u'cp950', u'Traditional Chinese'], [u'cp1006', u'Urdu'], [u'cp1026', u'Turkish'], [u'cp1140', u'Western Europe'], [u'cp1250', u'Central and Eastern Europe'], [u'cp1251', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp1253', u'Greek'], [u'cp1254', u'Turkish'], [u'cp1255', u'Hebrew'], [u'cp1256', u'Arabic'], [u'cp1257', u'Baltic languages'], [u'cp1258', u'Vietnamese'], [u'euc_jp', u'Japanese'], [u'euc_jis_2004', u'Japanese'], [u'euc_jisx0213', u'Japanese'], [u'euc_kr', u'Korean'], [u'gb2312', u'Simplified Chinese'], [u'gbk', u'Unified Chinese'], [u'gb18030', u'Unified Chinese'], [u'hz', u'Simplified Chinese'], [u'iso2022_jp', u'Japanese'], [u'iso2022_jp_1', u'Japanese'], [u'iso2022_jp_2', u'Jp, K, S C, WE, G'], [u'iso2022_jp_2004', u'Japanese'], [u'iso2022_jp_3', u'Japanese'], [u'iso2022_jp_ext', u'Japanese'], [u'iso2022_kr', u'Korean'], [u'latin_1', u'West Europe'], [u'iso8859_2', u'Central and Eastern Europe'], [u'iso8859_3', u'Esperanto, Maltese'], [u'iso8859_4', u'Baltic languages'], [u'iso8859_5', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'iso8859_6', u'Arabic'], [u'iso8859_7', u'Greek'], [u'iso8859_8', u'Hebrew'], [u'iso8859_9', u'Turkish'], [u'iso8859_10', u'Nordic languages'], [u'iso8859_13', u'Baltic languages'], [u'iso8859_14', u'Celtic languages'], [u'iso8859_15', u'Western Europe'], [u'iso8859_16', u'South-Eastern Europe'], [u'johab', u'Korean'], [u'koi8_r', u'Russian'], [u'koi8_u', u'Ukrainian'], [u'mac_cyrillic', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'mac_greek', u'Greek'], [u'mac_iceland', u'Icelandic'], [u'mac_latin2', u'Central and Eastern Europe'], [u'mac_turkish', u'Turkish'], [u'ptcp154', u'Kazakh'], [u'shift_jis', u'Japanese'], [u'shift_jis_2004', u'Japanese'], [u'shift_jisx0213', u'Japanese'], [u'utf_32', u'all languages'], [u'utf_32_be', u'all languages'], [u'utf_32_le', u'all languages'], [u'utf_16', u'all languages'], [u'utf_16_be', u'all languages (BMP only)'], [u'utf_16_le', u'all languages (BMP only)'], [u'utf_7', u'all languages'], [u'utf_8_sig', u'all languages']] +encodages = [[u'cp1252',u'Western Europe'], [u'utf-8',u'all languages'], [u'MacRoman',u'Western Europe'], [u'ascii', u'English'], [u'big5', u'Traditional Chinese'], [u'big5hkscs', u'Traditional Chinese'], [u'cp037', u'English'], [u'cp424', u'Hebrew'], [u'cp437', u'English'], [u'cp500', u'Western Europe'], [u'cp737', u'Greek'], [u'cp775', u'Baltic languages'], [u'cp850', u'Western Europe'], [u'cp852', u'Central and Eastern Europe'], [u'cp855', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp856', u'Hebrew'], [u'cp857', u'Turkish'], [u'cp860', u'Portuguese'], [u'cp861', u'Icelandic'], [u'cp862', u'Hebrew'], [u'cp863', u'Canadian'], [u'cp864', u'Arabic'], [u'cp865', u'Danish, Norwegian'], [u'cp866', u'Russian'], [u'cp869', u'Greek'], [u'cp874', u'Thai'], [u'cp875', u'Greek'], [u'cp932', u'Japanese'], [u'cp949', u'Korean'], [u'cp950', u'Traditional Chinese'], [u'cp1006', u'Urdu'], [u'cp1026', u'Turkish'], [u'cp1140', u'Western Europe'], [u'cp1250', u'Central and Eastern Europe'], [u'cp1251', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp1253', u'Greek'], [u'cp1254', u'Turkish'], [u'cp1255', u'Hebrew'], [u'cp1256', u'Arabic'], [u'cp1257', u'Baltic languages'], [u'cp1258', u'Vietnamese'], [u'euc_jp', u'Japanese'], [u'euc_jis_2004', u'Japanese'], [u'euc_jisx0213', u'Japanese'], [u'euc_kr', u'Korean'], [u'gb2312', u'Simplified Chinese'], [u'gbk', u'Unified Chinese'], [u'gb18030', u'Unified Chinese'], [u'hz', u'Simplified Chinese'], [u'iso2022_jp', u'Japanese'], [u'iso2022_jp_1', u'Japanese'], [u'iso2022_jp_2', u'Jp, K, S C, WE, G'], [u'iso2022_jp_2004', u'Japanese'], [u'iso2022_jp_3', u'Japanese'], [u'iso2022_jp_ext', u'Japanese'], [u'iso2022_kr', u'Korean'], [u'latin_1', u'West Europe'], [u'iso8859_2', u'Central and Eastern Europe'], [u'iso8859_3', u'Esperanto, Maltese'], [u'iso8859_4', u'Baltic languages'], [u'iso8859_5', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'iso8859_6', u'Arabic'], [u'iso8859_7', u'Greek'], [u'iso8859_8', u'Hebrew'], [u'iso8859_9', u'Turkish'], [u'iso8859_10', u'Nordic languages'], [u'iso8859_13', u'Baltic languages'], [u'iso8859_14', u'Celtic languages'], [u'iso8859_15', u'Western Europe'], [u'iso8859_16', u'South-Eastern Europe'], [u'johab', u'Korean'], [u'koi8_r', u'Russian'], [u'koi8_u', u'Ukrainian'], [u'mac_cyrillic', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'mac_greek', u'Greek'], [u'mac_iceland', u'Icelandic'], [u'mac_latin2', u'Central and Eastern Europe'], [u'mac_turkish', u'Turkish'], [u'ptcp154', u'Kazakh'], [u'shift_jis', u'Japanese'], [u'shift_jis_2004', u'Japanese'], [u'shift_jisx0213', u'Japanese'], [u'utf_32', u'all languages'], [u'utf_32_be', u'all languages'], [u'utf_32_le', u'all languages'], [u'utf_16', u'all languages'], [u'utf_16_be', u'all languages (BMP only)'], [u'utf_16_le', u'all languages (BMP only)'], [u'utf_7', u'all languages'], [u'utf_8_sig', u'all languages']] class FileOptionDialog(wx.Dialog): def __init__( @@ -191,8 +192,8 @@ class EncodeDialog(wx.Dialog): kwds["title"] = u'Encodage' wx.Dialog.__init__(self, *args, **kwds) self.label_dict = wx.StaticText(self, -1, u"Langue") - langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)'] - self.langues = [u'french', u'english', u'german', 'italian'] + langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)'] + self.langues = [u'french', u'english', u'german', 'italian', 'swedish', 'portuguese'] self.choice_dict = wx.Choice(self, -1, choices = langues_n) self.encodages = encodages self.text = wx.StaticText(self, -1, u"Encodage du corpus : ") @@ -588,6 +589,10 @@ class PrefGraph(wx.Dialog): self.label_4 = wx.StaticText(self, -1, txt) self.check1 = wx.CheckBox(self, -1) self.spin_nb = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000) + txt = u"""Prendre les x premiers points par classe""" + self.label_chic = wx.StaticText(self, -1, txt) + self.check_chic = wx.CheckBox(self, -1) + self.spin_nbchic = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000) txt = u"""Limiter le nombre de points par le chi2 de liaison aux classes""" self.label_5 = wx.StaticText(self, -1, txt) @@ -642,6 +647,7 @@ au chi2 d'association de la forme""" self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi) self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype) self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2) + self.Bind(wx.EVT_CHECKBOX, self.OnCheckChic, self.check_chic) self.__set_properties() self.OnNorm(wx.EVT_CHECKBOX) self.OnCheckTchi(wx.EVT_CHECKBOX) @@ -662,14 +668,29 @@ au chi2 d'association de la forme""" self.spin3.SetValue(self.paramgraph['taillecar']) self.spin_nb.SetValue(self.paramgraph['select_nb']) self.spin_chi.SetValue(self.paramgraph['select_chi']) + self.spin_nbchic.SetValue(self.paramgraph['nbchic']) self.check1.SetValue(self.paramgraph['do_select_nb']) self.check2.SetValue(self.paramgraph['do_select_chi']) + self.check_chic.SetValue(self.paramgraph['do_select_chi_classe']) self.check3.SetValue(self.paramgraph['over']) if self.paramgraph['do_select_nb'] : self.spin_nb.Enable(True) self.spin_chi.Enable(False) + self.spin_nbchic.Enable(False) + elif self.paramgraph['do_select_chi_classe'] : + self.spin_nb.Enable(False) + self.spin_chi.Enable(False) + self.spin_nbchic.Enable(True) + elif self.paramgraph['do_select_chi'] : + self.spin_nb.Enable(False) + self.spin_chi.Enable(True) + self.spin_nbchic.Enable(False) else : self.spin_nb.Enable(False) + self.spin_chi.Enable(False) + self.spin_nbchic.Enable(False) + + self.check4.SetValue(self.paramgraph['cex_txt']) self.spin_min.SetValue(self.paramgraph['txt_min']) self.spin_max.SetValue(self.paramgraph['txt_max']) @@ -677,11 +698,6 @@ au chi2 d'association de la forme""" self.spin_min_tchi.SetValue(self.paramgraph['tchi_min']) self.spin_max_tchi.SetValue(self.paramgraph['tchi_max']) - if self.paramgraph['do_select_chi'] : - self.spin_nb.Enable(False) - self.spin_chi.Enable(True) - else : - self.spin_chi.Enable(False) self.spin_f1.SetValue(self.paramgraph['facteur'][0]) self.spin_f2.SetValue(self.paramgraph['facteur'][1]) self.spin_f3.SetValue(self.paramgraph['facteur'][2]) @@ -738,6 +754,14 @@ au chi2 d'association de la forme""" fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) + fsizer.Add(self.label_chic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5) + sizer_nbchic = wx.BoxSizer(wx.HORIZONTAL) + sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5) + sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5) + fsizer.Add(sizer_nbchic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5) + fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) + fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) + fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5) sizer_chi = wx.BoxSizer(wx.HORIZONTAL) sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5) @@ -810,22 +834,36 @@ au chi2 d'association de la forme""" sizer_2.Fit(self) self.Layout() - def OnCheck1(self,event): + def OnCheck1(self, event): if self.check1.GetValue() : self.check2.SetValue(False) + self.check_chic.SetValue(False) self.spin_chi.Enable(False) self.spin_nb.Enable(True) + self.spin_nbchic.Enable(False) else : self.spin_nb.Enable(False) - def OnCheck2(self,event): + def OnCheck2(self, event): if self.check2.GetValue() : - self.check1.SetValue(False) - self.spin_nb.Enable(False) - self.spin_chi.Enable(True) + self.check1.SetValue(False) + self.check_chic.SetValue(False) + self.spin_chi.Enable(True) + self.spin_nb.Enable(False) + self.spin_nbchic.Enable(False) else : self.spin_chi.Enable(False) + def OnCheckChic(self, event) : + if self.check_chic.GetValue() : + self.check1.SetValue(False) + self.check2.SetValue(False) + self.spin_chi.Enable(False) + self.spin_nb.Enable(False) + self.spin_nbchic.Enable(True) + else : + self.spin_nbchic.Enable(False) + def OnNorm(self, event): if not self.check4.GetValue() : self.spin_min.Disable() @@ -1360,7 +1398,7 @@ class PrefSimi ( wx.Dialog ): def __set_properties(self): self.choice1.SetSelection(self.paramsimi['coeff']) self.choice2.SetSelection(self.paramsimi['layout']) - self.choice3.SetSelection(self.paramsimi['type']) + self.choice3.SetSelection(self.paramsimi['type_graph']) if self.paramsimi['type'] != 2 : self.film.Enable(False) self.slider_sphere.Enable(False) @@ -1492,7 +1530,7 @@ class PrefSimi ( wx.Dialog ): class SelectColDial ( wx.Dialog ): def __init__( self, parent ): - wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 200,300 ), style = wx.DEFAULT_DIALOG_STYLE ) + wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 400,500 ), style = wx.DEFAULT_DIALOG_STYLE ) self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -2128,11 +2166,11 @@ class FindInCluster(wx.Frame): cl = self.formes[idb][1] - 1 forme = self.formes[idb][0] profile.ProfNB.SetSelection(cl) - UnSelectList(profile.ProfNB.GetPage(cl).list) - datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).list.GetItemCount())]) - profile.ProfNB.GetPage(cl).list.SetItemState(datas[self.formes[idb][0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) - profile.ProfNB.GetPage(cl).list.Focus(datas[forme]) - profile.ProfNB.GetPage(cl).list.SetFocus() + UnSelectList(profile.ProfNB.GetPage(cl)) + datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())]) + profile.ProfNB.GetPage(cl).SetItemState(datas[self.formes[idb][0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) + profile.ProfNB.GetPage(cl).Focus(datas[forme]) + profile.ProfNB.GetPage(cl).SetFocus() def OnCloseMe(self, evt) : self.Close(True) @@ -2181,10 +2219,10 @@ class SearchDial ( wx.Dialog ): pass def OnSearch(self, evt): - UnSelectList(self.listctrl.list) + UnSelectList(self.listctrl) search_word = self.search.GetValue() if search_word.strip() != '' : - formes = [self.listctrl.getColumnText(i, self.col) for i in range(self.listctrl.list.GetItemCount())] + formes = [self.listctrl.getColumnText(i, self.col) for i in range(self.listctrl.GetItemCount())] if search_word.endswith(u'*') : search_word = search_word[0:-1] result = [j for j, forme in enumerate(formes) if forme.startswith(search_word)] @@ -2202,15 +2240,15 @@ class SearchDial ( wx.Dialog ): def showitems(self, items) : if len(items) == 1 : - self.listctrl.list.SetItemState(items[0], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) - self.listctrl.list.Focus(items[0]) - self.listctrl.list.SetFocus() + self.listctrl.SetItemState(items[0], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) + self.listctrl.Focus(items[0]) + self.listctrl.SetFocus() self.Destroy() else : for i in items : - self.listctrl.list.SetItemState(i, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) - self.listctrl.list.Focus(items[0]) - self.listctrl.list.SetFocus() + self.listctrl.SetItemState(i, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) + self.listctrl.Focus(items[0]) + self.listctrl.SetFocus() self.forward.Enable(True) self.backward.Enable(False) self.items = items @@ -2228,12 +2266,13 @@ class SearchDial ( wx.Dialog ): first_forme = proflist[0] cl = first_forme[1] - 1 profile.ProfNB.SetSelection(cl) - profile.ProfNB.GetPage(cl).list.SetFocus() - UnSelectList(profile.ProfNB.GetPage(cl).list) - datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).list.GetItemCount())]) - profile.ProfNB.GetPage(cl).list.SetItemState(datas[first_forme[0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) - profile.ProfNB.GetPage(cl).list.Focus(datas[first_forme[0]]) - profile.ProfNB.GetPage(cl).list.SetFocus() + profile.ProfNB.GetPage(cl).SetFocus() + print profile.ProfNB.GetPage(cl) + UnSelectList(profile.ProfNB.GetPage(cl)) + datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())]) + profile.ProfNB.GetPage(cl).SetItemState(datas[first_forme[0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED) + profile.ProfNB.GetPage(cl).Focus(datas[first_forme[0]]) + profile.ProfNB.GetPage(cl).SetFocus() if len(proflist) == 1 : self.Destroy() else : @@ -2244,8 +2283,8 @@ class SearchDial ( wx.Dialog ): self.noresult() def onforward(self, evt) : - self.listctrl.list.Focus(self.items[self.forwitem]) - self.listctrl.list.SetFocus() + self.listctrl.Focus(self.items[self.forwitem]) + self.listctrl.SetFocus() self.forwitem += 1 if self.forwitem == len(self.items) : self.forward.Enable(False) @@ -2256,8 +2295,8 @@ class SearchDial ( wx.Dialog ): self.backward.Enable(True) def onbackward(self, evt) : - self.listctrl.list.Focus(self.items[self.backitem]) - self.listctrl.list.SetFocus() + self.listctrl.Focus(self.items[self.backitem]) + self.listctrl.SetFocus() self.backitem -= 1 if self.backitem == -1 : self.forwitem -= 1 @@ -2278,6 +2317,7 @@ class SearchDial ( wx.Dialog ): self.search.Clear() def UnSelectList(liste) : + print liste if liste.GetFirstSelected() != -1 : last = liste.GetFirstSelected() liste.Select(liste.GetFirstSelected(), False) @@ -2493,18 +2533,18 @@ class PrefWordCloud ( wx.Dialog ): fgSizer1.SetFlexibleDirection( wx.BOTH ) fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) - self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.m_staticText1.Wrap( -1 ) - fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) + #self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 ) + #self.m_staticText1.Wrap( -1 ) + #fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) - self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 ) - fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + #self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 ) + #fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) - self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) - fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) + #self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + #fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 ) - self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) - fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 ) + #self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + #fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 ) bSizer1 = wx.BoxSizer( wx.HORIZONTAL ) @@ -2547,6 +2587,21 @@ class PrefWordCloud ( wx.Dialog ): self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 ) + self.typeformes = wx.StaticText( self, wx.ID_ANY, u"formes retenues", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.typeformes.Wrap( -1 ) + fgSizer1.Add( self.typeformes, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + + typeformeschoiceChoices = [ u"actives", u"supplémentaires", u"actives et supplémentaires" ] + self.typeformeschoice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, typeformeschoiceChoices, 0 ) + self.typeformeschoice.SetSelection( 0 ) + fgSizer1.Add( self.typeformeschoice, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 ) + + self.m_staticline11 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + fgSizer1.Add( self.m_staticline11, 0, wx.EXPAND |wx.ALL, 5 ) + + self.m_staticline12 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + fgSizer1.Add( self.m_staticline12, 0, wx.EXPAND |wx.ALL, 5 ) + self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText6.Wrap( -1 ) fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) @@ -2764,11 +2819,12 @@ class CorpusPref ( wx.Dialog ): def __init__( self, parent, parametres ): wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Préférences", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE ) self.parent = parent - langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)'] - self.langues = [u'french', u'english', u'german', 'italian'] - self.encodages = encodages + langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)', 'greek', 'other...'] + self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese', 'greek', 'other'] + self.encodages = [enc[0].lower() for enc in encodages] + ucimark = [u'****', u'0000'] - ucemethod = [u'charactères', u'occurrences'] + ucemethod = [u'charactères', u'occurrences', u'paragraphe'] self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize ) @@ -2792,7 +2848,7 @@ class CorpusPref ( wx.Dialog ): self.m_staticText1.Wrap( -1 ) fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) - encodage_choicesChoices = [' - '.join(encodage) for encodage in self.encodages] + encodage_choicesChoices = [' - '.join(encodage) for encodage in encodages] self.encodage_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, encodage_choicesChoices, 0 ) self.encodage_choices.SetSelection( 0 ) fgSizer1.Add( self.encodage_choices, 0, wx.ALL, 5 ) @@ -2926,7 +2982,7 @@ class CorpusPref ( wx.Dialog ): self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ) fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 ) - self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Pas d'espace entre deux formes (pour le chinois par exemple)", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Pas d'espace entre deux formes", wx.DefaultPosition, wx.DefaultSize, 0 ) self.m_staticText16.Wrap( -1 ) fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 ) @@ -2968,7 +3024,11 @@ class CorpusPref ( wx.Dialog ): pass def setparametres(self, parametres) : - self.encodage_choices.SetSelection(0) + if locale.getpreferredencoding().lower() == 'mac-roman' : + enc = self.encodages.index('macroman') + else : + enc = self.encodages.index(locale.getpreferredencoding().lower()) + self.encodage_choices.SetSelection(enc) self.lang_choices.SetSelection(0) self.repout_choices.SetValue(parametres['pathout']) self.ucimark_choices.SetSelection(parametres['ucimark']) @@ -2986,7 +3046,7 @@ class CorpusPref ( wx.Dialog ): def doparametres(self) : parametres = {} - parametres['encoding'] = self.encodages[self.encodage_choices.GetSelection()][0] + parametres['encoding'] = encodages[self.encodage_choices.GetSelection()][0] parametres['lang'] = self.langues[self.lang_choices.GetSelection()] parametres['pathout'] = self.repout_choices.GetValue() parametres['ucimark'] = self.ucimark_choices.GetSelection() @@ -3008,4 +3068,3 @@ class CorpusPref ( wx.Dialog ): else : parametres[val] = 0 return parametres -