wdc
[iramuteq] / dialog.py
1 #!/bin/env python
2 # -*- coding: utf-8 -*-
3 #Author: Pierre Ratinaud
4 #Copyright (c) 2008-2009 Pierre Ratinaud
5 #Lisense: GNU/GPL
6 import  wx
7 import  wx.lib.colourselect as  csel
8 import wx.lib.sized_controls as sc
9 import wx.lib.filebrowsebutton as filebrowse
10 import locale
11 import os
12 import sys
13 #from listlex import *
14 from KeyFrame import AlcOptFrame
15 #---------------------------------------------------------------------------
16 provider = wx.SimpleHelpProvider()
17 wx.HelpProvider_Set(provider)
18
19 #---------------------------------------------------------------------------
20
21
22 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']]
23
24 class FileOptionDialog(wx.Dialog):
25     def __init__(
26             self, parent, ID, title, sep=False, sheet = False, size=wx.DefaultSize, pos=wx.DefaultPosition,
27             style=wx.DEFAULT_DIALOG_STYLE
28             ):
29
30         pre = wx.PreDialog()
31         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
32         pre.Create(parent, ID, title, pos, size, style)
33
34         self.PostCreate(pre)
35
36         sizer = wx.BoxSizer(wx.VERTICAL)
37         grid_sizer = wx.FlexGridSizer(5, 2, 2, 2)
38 ##############################
39
40         label = wx.StaticText(self, -1, u"La première ligne contient les noms de colonne")
41         label.SetHelpText(u"La première ligne contient les noms de colonne")
42         grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
43         on = ["oui", "non"]
44         self.radio_box_1 = wx.RadioBox(self, -1, u"", choices=on, majorDimension=0, style=wx.RA_SPECIFY_ROWS)
45         self.radio_box_1.SetHelpText(u"La première ligne contient les noms de colonne")
46         grid_sizer.Add(self.radio_box_1, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
47
48 ##############################
49
50         label = wx.StaticText(self, -1, u"La première colonne contient un identifiant")
51         label.SetHelpText(u"La première colonne contient un identifiant")
52         grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
53         on = ["oui", "non"]
54         self.radio_box_2 = wx.RadioBox(self, -1, u"", choices=on, majorDimension=0, style=wx.RA_SPECIFY_ROWS)
55         self.radio_box_2.SetHelpText(u"La première colonne contient un identifiant")
56         grid_sizer.Add(self.radio_box_2, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
57
58 ##############################
59         if sep:
60             label = wx.StaticText(self, -1, u"Séparateur de colonne")
61             label.SetHelpText(u"Quel charactère sépare les colonnes ?")
62             grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
63             self.colsep = [";", "tabulation", ","]
64             self.choice3 = wx.Choice(self, -1, (100, 50), choices=self.colsep)
65             self.choice3.SetHelpText(u"Quel charactère sépare les colonnes ?")
66             grid_sizer.Add(self.choice3, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
67     
68     ##############################
69     
70             label = wx.StaticText(self, -1, u"Séparateur de texte")
71             label.SetHelpText(u"Quel caractère encadre les champs texte ?")
72             grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
73             self.txtsep = ["\"", "'"]
74             self.choice4 = wx.Choice(self, -1, (100, 50), choices=self.txtsep)
75             self.choice4.SetHelpText(u"Quel caractère encadre les champs texte ?")
76             grid_sizer.Add(self.choice4, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
77             self.choice3.SetSelection(0)
78             self.choice4.SetSelection(0)
79             self.text = wx.StaticText(self, -1, u"Encodage du corpus : ")
80             grid_sizer.Add(self.text, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
81             self.le = [enc[0].lower() for enc in encodages] 
82             self.list_encodages = wx.Choice(self, -1, (25, 30), choices=[' - '.join(encodage) for encodage in encodages])
83             if locale.getpreferredencoding().lower() == 'mac-roman' :
84                 enc = self.le.index('macroman')
85             else :
86                 enc = self.le.index(locale.getpreferredencoding().lower())
87             self.list_encodages.SetSelection(enc)
88             grid_sizer.Add(self.list_encodages, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
89         elif sheet :
90             label = wx.StaticText(self, -1, u"Feuille ")
91             grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
92             self.spin1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=500)
93             grid_sizer.Add(self.spin1, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
94         
95         sizer.Add(grid_sizer, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
96
97
98         line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
99         sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
100
101         btnsizer = wx.StdDialogButtonSizer()
102         
103         if wx.Platform != "__WXMSW__":
104             btn = wx.ContextHelpButton(self)
105             btnsizer.AddButton(btn)
106         
107         btn = wx.Button(self, wx.ID_OK)
108         btn.SetHelpText("The OK button completes the dialog")
109         btn.SetDefault()
110         btnsizer.AddButton(btn)
111
112         btn = wx.Button(self, wx.ID_CANCEL)
113         btn.SetHelpText("The Cancel button cnacels the dialog. (Cool, huh?)")
114         btnsizer.AddButton(btn)
115         btnsizer.Realize()
116
117         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
118
119         self.SetSizer(sizer)
120         sizer.Fit(self)
121
122
123 class ClusterNbDialog(wx.Dialog):
124     def __init__(
125             self, LIST_CLASSE, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
126             style=wx.DEFAULT_DIALOG_STYLE
127             ):
128
129         pre = wx.PreDialog()
130         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
131         pre.Create(parent, ID, title, pos, size, style)
132
133         self.PostCreate(pre)
134
135         # Now continue with the normal construction of the dialog
136         # contents
137         sizer = wx.BoxSizer(wx.VERTICAL)
138
139         label = wx.StaticText(self, -1, u"Résultats de la classification")
140         label.SetHelpText("This is the help text for the label")
141         sizer.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
142
143         box = wx.BoxSizer(wx.HORIZONTAL)
144
145         label = wx.StaticText(self, -1, u"Choisissez le nombre de classes")
146         label.SetHelpText("This is the help text for the label")
147         box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
148         LIST_CLASSE_OK = []
149         if type(LIST_CLASSE) != float :
150             for i in LIST_CLASSE :
151                 LIST_CLASSE_OK.append(str(i))
152         else :
153             LIST_CLASSE_OK.append(str(LIST_CLASSE))
154         print str(LIST_CLASSE_OK)
155         self.list_box_1 = wx.ListBox(self, -1, choices=LIST_CLASSE_OK, style=wx.LB_SINGLE | wx.LB_HSCROLL)
156         self.list_box_1.SetHelpText("Here's some help text for field #1")
157         box.Add(self.list_box_1, 1, wx.ALIGN_CENTRE | wx.ALL, 5)
158
159         sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
160
161
162 ###############################
163         line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
164         sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
165
166         btnsizer = wx.StdDialogButtonSizer()
167         
168         if wx.Platform != "__WXMSW__":
169             btn = wx.ContextHelpButton(self)
170             btnsizer.AddButton(btn)
171         
172         btn = wx.Button(self, wx.ID_OK)
173         btn.SetHelpText("The OK button completes the dialog")
174         btn.SetDefault()
175         btnsizer.AddButton(btn)
176
177         btn = wx.Button(self, wx.ID_CANCEL)
178         btn.SetHelpText("The Cancel button cnacels the dialog. (Cool, huh?)")
179         btnsizer.AddButton(btn)
180         btnsizer.Realize()
181
182         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
183
184         self.SetSizer(sizer)
185         sizer.Fit(self)
186
187 class EncodeDialog(wx.Dialog):
188     def __init__(self, *args, **kwds):
189         # begin wxGlade: MyDialog.__init__
190         kwds["style"] = wx.DEFAULT_DIALOG_STYLE
191         kwds["size"] = wx.Size(100, 60)
192         kwds["title"] = u'Encodage'
193         wx.Dialog.__init__(self, *args, **kwds)
194         self.label_dict = wx.StaticText(self, -1, u"Langue")
195         langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)']
196         self.langues = [u'french', u'english', u'german', 'italian', 'swedish', 'portuguese']
197         self.choice_dict = wx.Choice(self, -1, choices = langues_n)
198         self.encodages = encodages
199         self.text = wx.StaticText(self, -1, u"Encodage du corpus : ")
200         self.le = [enc[0].lower() for enc in self.encodages] 
201         self.list_encodages = wx.Choice(self, -1, (25, 50), choices=[' - '.join(encodage) for encodage in self.encodages])#style=wx.LB_SINGLE | wx.LB_HSCROLL)
202         self.button_1 = wx.Button(self, wx.ID_OK, "")
203
204         self.__set_properties()
205         self.__do_layout()
206         # end wxGlade
207
208     def __set_properties(self):
209         # begin wxGlade: MyDialog.__set_properties
210         self.SetTitle(u"Encodage du corpus")
211         self.SetMinSize(wx.Size(300, 100))
212         if  locale.getpreferredencoding().lower() == 'mac-roman' :
213             enc = self.le.index('macroman')
214         else :
215             enc = self.le.index(locale.getpreferredencoding().lower())
216         self.list_encodages.SetSelection(enc)
217         self.choice_dict.SetSelection(0)
218         # end wxGlade
219
220     def __do_layout(self):
221         # begin wxGlade: MyDialog.__do_layout
222         sizer_1 = wx.BoxSizer(wx.VERTICAL)
223         sizer_1.Add(self.text, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
224         sizer_1.Add(self.list_encodages, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
225         sizer_1.Add(self.label_dict, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
226         sizer_1.Add(self.choice_dict, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
227         sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
228         self.SetSizer(sizer_1)
229         sizer_1.Fit(self)
230         self.Layout()
231
232 class CHDDialog(wx.Dialog):
233     def __init__(
234             self, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
235             style=wx.DEFAULT_DIALOG_STYLE | wx.CANCEL
236             ):
237         pre = wx.PreDialog()
238         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
239         pre.Create(parent, ID, title, pos, size, style)
240
241         self.PostCreate(pre)
242        
243         self.colsep = parent.colsep
244         self.Box = 1
245         self.content = parent.content[:]
246         self.header = parent.header[:]
247         LABELLIST = []
248         for i in self.header:
249             if len(i) > 60 :
250                 LABELLIST.append(i[0:60])
251             else:
252                 LABELLIST.append(i)
253         self.LABELLISTTOT = LABELLIST
254         self.LISTVARSUP = []
255 #----------------------------------------------------------------------------------------------------
256         self.text1 = wx.StaticText(self, -1, u"Variables Actives (au moins 3)")
257         self.text2 = wx.StaticText(self, -1, u"Variables Supplémentaires (au moins 1)")
258         self.list_box_1 = wx.ListBox(self, -1, choices=LABELLIST, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
259         self.list_box_2 = wx.ListBox(self, -1, choices=LABELLIST, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
260         self.button_cancel = wx.Button(self, wx.ID_CANCEL)
261         self.button_back = wx.Button(self, wx.ID_BACKWARD)
262         self.button_forw = wx.Button(self, wx.ID_FORWARD)
263         self.button_ok = wx.Button(self, wx.ID_OK)
264         self.button_pref = wx.Button(self, wx.ID_PROPERTIES)
265         self.button_selectall = wx.Button(self, wx.NewId(), u"Sélectionner tout")
266         self.__set_properties()
267         self.__do_layout()
268
269         self.Bind(wx.EVT_BUTTON, self.OnPrec, self.button_back)
270         self.Bind(wx.EVT_BUTTON, self.OnSuivant, self.button_forw)
271         self.Bind(wx.EVT_BUTTON, self.OnValider, self.button_ok)
272         self.Bind(wx.EVT_BUTTON, self.OnSelectAll, self.button_selectall)
273         # end wxGlade
274         self.parent = parent
275         self.TEMPDIR = parent.TEMPDIR
276         self.num = 0
277
278     def __set_properties(self):
279         # begin wxGlade: ConfChi2.__set_properties
280         self.SetTitle(u"Sélection des variables")
281         self.list_box_2.Enable(False)
282         self.button_ok.Enable(False)        
283         self.button_back.Enable(False)
284         # end wxGlade
285
286     def __do_layout(self):
287         # begin wxGlade: ConfChi2.__do_layout
288         sizer_1 = wx.BoxSizer(wx.VERTICAL)
289         sizer_2 = wx.BoxSizer(wx.VERTICAL)
290         sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
291         sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
292         sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
293         sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
294         sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
295         sizer_5.Add(self.text1, 1, wx.CENTER | wx.ALL, 0)
296         sizer_5.Add(self.text2, 1, wx.CENTER | wx.ALL, 0)
297         sizer_3.Add(self.list_box_1, 0, wx.EXPAND, 0)
298         sizer_3.Add(self.list_box_2, 0, wx.EXPAND, 0)
299         sizer_6.Add(self.button_selectall, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 0) 
300         sizer_7.Add(self.button_cancel, 0, wx.ALL, 0)
301         sizer_7.Add(self.button_pref, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
302         sizer_7.Add(self.button_ok, 0, wx.wx.ALIGN_CENTER_HORIZONTAL, 0)
303         sizer_4.Add(self.button_back, 0, wx.ALL, 0)
304         sizer_4.Add(self.button_forw, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
305         sizer_2.Add(sizer_5, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
306         sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
307         sizer_2.Add(sizer_6, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
308         sizer_2.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
309         sizer_2.Add(sizer_7, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
310         sizer_1.Add(sizer_2, 1, wx.EXPAND, 4)
311         self.SetSizer(sizer_1)
312         sizer_1.Fit(self)
313         self.Layout()
314         # end wxGlade
315 #--------------FIXME-----------------------
316 #NETTOYAGE des variables inutiles
317     def OnSuivant(self, event): 
318         LISTACTIVE = self.list_box_1.GetSelections()
319         if len(LISTACTIVE) != len(self.LABELLISTTOT) and len(LISTACTIVE) >= 3: 
320             self.button_ok.Enable(True)
321         self.Box = 2
322         self.LISTHEADERINDICE = []
323         self.LISTNUMACTIVE = []
324         COMPT = 0
325         header = self.header[:]
326         for i in range(0, len(header)):
327             self.LISTHEADERINDICE.append(i)
328         for i in LISTACTIVE :
329             self.LISTNUMACTIVE.append(i)
330             header.pop(i - COMPT)
331             self.LISTHEADERINDICE.pop(i - COMPT)
332             COMPT += 1
333         self.LABELLIST = []
334         for i in header:
335             if len(i) > 60 :
336                 self.LABELLIST.append(i[0:60])
337             else:
338                 self.LABELLIST.append(i)
339         self.list_box_2.Clear()
340         for i in self.LABELLIST :
341             self.list_box_2.Append(i)
342                     
343         self.list_box_1.Enable(False)    
344         self.list_box_2.Enable(True)
345         self.button_forw.Enable(False)
346         self.button_back.Enable(True)
347
348     def OnValider(self, event):
349         LISTVARSUPSEL = self.list_box_2.GetSelections()
350         for i in LISTVARSUPSEL :
351             self.LISTVARSUP.append(self.LISTHEADERINDICE[i])
352         event.Skip()
353
354     def OnPrec(self, event):
355         self.list_box_1.Enable(True)
356         self.list_box_2.Enable(False)
357         self.button_forw.Enable(True)
358         self.button_back.Enable(False)   
359         self.button_ok.Enable(False)
360         self.Box = 1
361         event.Skip()
362
363     def OnSelectAll(self, event):
364         if self.Box == 1:
365             for i in range(len(self.LABELLISTTOT)):
366                 self.list_box_1.Select(i)
367         else:
368             for i in range(len(self.LABELLIST)):
369                 self.list_box_2.Select(i)
370
371 class PrefDialog ( wx.Dialog ):
372     
373     def __init__( self, parent ):
374         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 )
375         self.parent = parent
376         
377         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
378         
379         bSizer1 = wx.BoxSizer( wx.VERTICAL )
380         
381         fgSizer1 = wx.FlexGridSizer( 4, 3, 0, 0 )
382         fgSizer1.SetFlexibleDirection( wx.BOTH )
383         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
384         
385         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Jouer un son à la fin des analyses", wx.DefaultPosition, wx.DefaultSize, 0 )
386         self.m_staticText1.Wrap( -1 )
387         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
388         
389         self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
390         self.m_staticText2.Wrap( -1 )
391         fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
392         
393         m_radioBox1Choices = [ u"oui", u"non" ]
394         self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
395         self.m_radioBox1.SetSelection( 0 )
396         fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
397
398         msg = u"""Vérifier au démarrage si une
399 nouvelle version est disponible"""
400         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
401         self.m_staticText3.Wrap( -1 )
402         fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
403         
404         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
405         self.m_staticText4.Wrap( -1 )
406         fgSizer1.Add( self.m_staticText4, 0, wx.ALL, 5 )
407         
408         m_radioBox2Choices = [ u"oui", u"non" ]
409         self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
410         self.m_radioBox2.SetSelection( 0 )
411         fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
412         
413         msg = u"""Vérifier l'installation des
414 bibliothèques de R"""
415         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
416         self.m_staticText5.Wrap( -1 )
417         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
418         
419         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
420         self.m_staticText6.Wrap( -1 )
421         fgSizer1.Add( self.m_staticText6, 0, wx.ALL, 5 )
422         
423         self.m_button1 = wx.Button( self, wx.ID_ANY, u"Vérifier", wx.DefaultPosition, wx.DefaultSize, 0 )
424         fgSizer1.Add( self.m_button1, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
425         
426         bSizer1.Add( fgSizer1, 1, wx.EXPAND, 5 )
427         if sys.platform == 'win32' :
428             bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
429             
430             msg = u"""Mémoire maximum allouée
431     à R (en Mo)"""
432             self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
433             self.m_staticText7.Wrap( -1 )
434             bSizer2.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
435             
436             self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
437             bSizer2.Add( self.m_checkBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
438             
439             self.m_spinCtrl1 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 32, 16000, 1535 )
440             bSizer2.Add( self.m_spinCtrl1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
441             
442             self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
443             bSizer2.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
444             
445             bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
446             self.m_checkBox1.Bind( wx.EVT_CHECKBOX, self.oncheckmem )
447
448         bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
449         bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
450         self.text8 = wx.StaticText( self, wx.ID_ANY, u"Utiliser svdlibc", wx.DefaultPosition, wx.DefaultSize, 0 )
451         self.text8.Wrap( -1 )
452         fgSizer1.Add( self.text8, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
453         self.check_svdc = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
454         bSizer4.Add( self.check_svdc, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
455         bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )
456         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(250, -1), fileMode = 2, fileMask = '*')
457         bSizer3.Add( self.fbb, 0, wx.EXPAND, 5 )
458         self.fbb.SetLabel(u"Chemin : ")
459         fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ),  wx.ID_ANY, wx.ALL, 5)
460         fgSizer1.Add( bSizer3, 0,  wx.ALIGN_RIGHT|wx.ALL, 5 )
461
462         Rpath_text =  wx.StaticText( self, wx.ID_ANY, u"Chemin de R", wx.DefaultPosition, wx.DefaultSize, 0 )
463         Rpath_text.Wrap( -1 )
464         fgSizer1.Add( Rpath_text, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
465         fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ),  wx.ID_ANY, wx.ALL, 5)
466         self.Rpath_value = filebrowse.FileBrowseButton(self, -1, size=(350, -1), fileMode = 2, fileMask = '*')
467         self.Rpath_value.SetLabel(u'Chemin : ')
468         fgSizer1.Add( self.Rpath_value, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
469
470         mirror_text =  wx.StaticText( self, wx.ID_ANY, u"Miroir de R par défaut", wx.DefaultPosition, wx.DefaultSize, 0 )
471         mirror_text.Wrap( -1 )
472         fgSizer1.Add( mirror_text, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
473         fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ),  wx.ID_ANY, wx.ALL, 5)
474         self.mirror_value = wx.TextCtrl( self, wx.ID_ANY, u'http://cran.univ-lyon1.fr', wx.DefaultPosition, wx.Size( 300,30 ), 0 ) 
475         fgSizer1.Add( self.mirror_value, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
476
477
478         m_sdbSizer1 = wx.StdDialogButtonSizer()
479         self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
480         m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
481         self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
482         m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
483         m_sdbSizer1.Realize();
484         bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
485         
486         self.SetSizer( bSizer1 )
487         self.Layout()
488         bSizer1.Fit( self )
489         
490         self.Centre( wx.BOTH )
491         
492         # Connect Events
493         self.m_sdbSizer1OK.Bind( wx.EVT_BUTTON, self.OnValid )
494         self.m_button1.Bind( wx.EVT_BUTTON, parent.OnVerif )
495         self.check_svdc.Bind( wx.EVT_CHECKBOX, self.OnSVDC )
496         self.__set_properties()
497
498     def __set_properties(self):
499         self.SetTitle(u"Préférences")
500         if self.parent.pref.getboolean('iramuteq', 'sound'): val1 = 0
501         else : val1 = 1
502         self.m_radioBox1.SetSelection(val1)
503         if self.parent.pref.getboolean('iramuteq', 'checkupdate') : val2 = 0
504         else : val2 = 1
505         self.m_radioBox2.SetSelection(val2)
506         if sys.platform == 'win32' :
507             if self.parent.pref.getboolean('iramuteq', 'R_mem') :
508                 self.m_checkBox1.SetValue(True)
509                 self.m_spinCtrl1.Enable(True)
510                 self.m_spinCtrl1.SetValue(self.parent.pref.getint('iramuteq', 'R_max_mem'))
511             else :
512                 self.m_checkBox1.SetValue(False)
513                 self.m_spinCtrl1.Enable(False)
514         if self.parent.pref.getboolean('iramuteq', 'libsvdc') : 
515             self.check_svdc.SetValue(True)
516             self.fbb.SetValue(self.parent.pref.get('iramuteq', 'libsvdc_path'))
517         else :
518             self.check_svdc.SetValue(False)
519             self.fbb.SetValue(self.parent.pref.get('iramuteq', 'libsvdc_path'))
520             self.fbb.Enable(False)
521         self.Rpath_value.SetValue(self.parent.PathPath.get('PATHS', 'rpath'))
522         self.mirror_value.SetValue(self.parent.pref.get('iramuteq', 'rmirror'))
523         
524     def oncheckmem(self, evt):
525         if self.m_checkBox1.GetValue() :
526             self.m_spinCtrl1.Enable(True)
527         else :
528             self.m_spinCtrl1.Enable(False)
529
530     def OnSVDC(self, evt):
531         if self.check_svdc.GetValue() :
532             self.fbb.Enable(True)
533         else :
534             self.fbb.Enable(False)
535
536     def OnValid(self, event):
537         parent = self.parent
538         if self.m_radioBox1.GetSelection() == 0 : valsound = 'true'
539         else :  valsound = 'false'
540         parent.pref.set('iramuteq', 'sound', valsound)
541         if self.m_radioBox2.GetSelection() == 0 : valcheck = 'true'
542         else :  valcheck = 'false'
543         parent.pref.set('iramuteq', 'checkupdate', valcheck)
544         if sys.platform == 'win32' :
545             if self.m_checkBox1.GetValue() :
546                 parent.pref.set('iramuteq', 'R_mem', 'true')
547                 parent.pref.set('iramuteq', 'R_max_mem', str(self.m_spinCtrl1.GetValue()))
548             else :
549                 parent.pref.set('iramuteq', 'R_mem', 'false')
550         if self.check_svdc.GetValue() :
551             parent.pref.set('iramuteq', 'libsvdc', 'true')
552         else :
553             parent.pref.set('iramuteq', 'libsvdc', 'false')
554         parent.pref.set('iramuteq', 'libsvdc_path', self.fbb.GetValue())
555         self.parent.pref.set('iramuteq', 'rmirror', self.mirror_value.GetValue())
556         file = open(parent.ConfigPath['preferences'], 'w')
557         parent.pref.write(file)
558         file.close()
559         self.parent.PathPath.set('PATHS', 'rpath', self.Rpath_value.GetValue())
560         with open(self.parent.ConfigPath['path'], 'w') as f:
561             self.parent.PathPath.write(f)
562         self.Close()
563
564 class PrefGraph(wx.Dialog):
565     def __init__(self, parent, ID, paramgraph, title = '', size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE):
566         pre = wx.PreDialog()
567         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
568         pre.Create(parent, ID, title, pos, size, style)
569         self.PostCreate(pre)
570         self.parent = parent
571         self.paramgraph=paramgraph
572         self.labeltype = wx.StaticText(self, -1, u'Type de graph')
573         if self.paramgraph['clnb'] <= 3 :
574             choix = [u'2D']
575         else :
576             choix=[u'2D' ,u'3D']
577         self.choicetype = wx.Choice(self, -1, (100,50), choices=choix)
578         self.label_1 = wx.StaticText(self, -1, u'Largeur')
579         self.spin1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=100, max=5000)
580         self.label_2 = wx.StaticText(self, -1, u'Hauteur')
581         self.spin2 = wx.SpinCtrl(self, -1, '', size = (100,30), min=100, max=5000)
582         self.label_what = wx.StaticText(self, -1, u'Représentation')
583         self.choice1 = wx.Choice(self, -1, (100,50), choices=[u'coordonnées' ,u'corrélation'])
584         self.label_qui = wx.StaticText(self, -1, u'Variables')
585         self.choice2 = wx.Choice(self, -1, (100,50), choices=[u'actives' ,u'supplémentaires', u'étoilées', 'classes'])
586         self.label_3 = wx.StaticText(self, -1, u'Taille du texte')
587         self.spin3 = wx.SpinCtrl(self, -1, '', size = (100,30), min=1, max=20)
588         txt = u"""Prendre les x premiers points"""
589         self.label_4 = wx.StaticText(self, -1, txt)
590         self.check1 = wx.CheckBox(self, -1)
591         self.spin_nb = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)
592         txt = u"""Limiter le nombre de points 
593 par le chi2 de liaison aux classes"""
594         self.label_5 = wx.StaticText(self, -1, txt)
595         self.check2 = wx.CheckBox(self, -1)
596         self.spin_chi = wx.SpinCtrl(self, -1, '',size = (100,30),  min=2, max=1000)
597         self.label_6 = wx.StaticText(self, -1, u'Eliminer les recouvrements')
598         self.check3 = wx.CheckBox(self, -1)
599         txt = u"""Taille du texte proportionnel
600 à la masse de la forme"""
601         self.label_7 = wx.StaticText(self, -1, txt)
602         self.check4 = wx.CheckBox(self, -1)
603         self.label_min = wx.StaticText(self, -1, 'min')
604         self.spin_min = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
605         self.label_max = wx.StaticText(self, -1, 'max')
606         self.spin_max = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
607         txt = u"""Taille du texte proportionnel
608 au chi2 d'association de la forme"""
609         self.label_tchi = wx.StaticText(self, -1, txt)
610         self.check_tchi = wx.CheckBox(self, -1)
611         self.label_min_tchi = wx.StaticText(self, -1, 'min')
612         self.spin_min_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
613         self.label_max_tchi = wx.StaticText(self, -1, 'max')
614         self.spin_max_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
615         self.label_8 = wx.StaticText(self, -1, 'Facteur x :')
616         self.spin_f1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
617         self.label_9 = wx.StaticText(self, -1, 'Facteur y :')
618         self.spin_f2 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
619         self.label_f3 = wx.StaticText(self, -1, 'Facteur z :')
620         self.spin_f3 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
621         self.label_sphere = wx.StaticText(self, -1, u"Transparence des sphères")
622         self.slider_sphere = wx.Slider(self, -1, 10, 1, 100, size = (255,-1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
623
624         self.label_film = wx.StaticText(self, -1, 'Faire un film')
625         self.film = wx.CheckBox(self, -1)
626                
627         self.btnsizer = wx.StdDialogButtonSizer()
628         if wx.Platform != "__WXMSW__":
629             btn = wx.ContextHelpButton(self)
630             self.btnsizer.AddButton(btn)
631         btn = wx.Button(self, wx.ID_OK)
632         btn.SetHelpText("Ok")
633         btn.SetDefault()
634         self.btnsizer.AddButton(btn)
635         btn = wx.Button(self, wx.ID_CANCEL)
636         btn.SetHelpText("Annuler")
637         self.btnsizer.AddButton(btn)
638         self.btnsizer.Realize()
639         
640         self.Bind(wx.EVT_CHECKBOX, self.OnCheck1, self.check1)
641         self.Bind(wx.EVT_CHECKBOX, self.OnCheck2, self.check2)
642         self.Bind(wx.EVT_CHECKBOX, self.OnNorm, self.check4)
643         self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi)
644         self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype)
645         self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2)
646         self.__set_properties()
647         self.OnNorm(wx.EVT_CHECKBOX)
648         self.OnCheckTchi(wx.EVT_CHECKBOX)
649         self.__do_layout()
650
651     def __set_properties(self):
652         self.choicetype.SetSelection(self.paramgraph['typegraph'])
653         if self.paramgraph['typegraph'] == 0 :
654             self.film.Enable(False)
655             self.spin_f3.Enable(False)
656             self.slider_sphere.Enable(False)
657         self.choice1.SetSelection(self.paramgraph['what'])
658         self.choice2.SetSelection(self.paramgraph['qui'])
659         self.spin_chi.SetValue(self.paramgraph['select_nb'])
660         self.spin_nb.SetValue(self.paramgraph['select_chi'])
661         self.spin1.SetValue(self.paramgraph['width'])
662         self.spin2.SetValue(self.paramgraph['height'])
663         self.spin3.SetValue(self.paramgraph['taillecar'])
664         self.spin_nb.SetValue(self.paramgraph['select_nb'])
665         self.spin_chi.SetValue(self.paramgraph['select_chi'])
666         self.check1.SetValue(self.paramgraph['do_select_nb'])
667         self.check2.SetValue(self.paramgraph['do_select_chi'])
668         self.check3.SetValue(self.paramgraph['over'])
669         if self.paramgraph['do_select_nb'] :
670             self.spin_nb.Enable(True)
671             self.spin_chi.Enable(False)
672         else :
673             self.spin_nb.Enable(False)
674         self.check4.SetValue(self.paramgraph['cex_txt'])
675         self.spin_min.SetValue(self.paramgraph['txt_min'])
676         self.spin_max.SetValue(self.paramgraph['txt_max'])
677         self.check_tchi.SetValue(self.paramgraph['tchi'])
678         self.spin_min_tchi.SetValue(self.paramgraph['tchi_min'])
679         self.spin_max_tchi.SetValue(self.paramgraph['tchi_max'])
680
681         if self.paramgraph['do_select_chi'] :
682             self.spin_nb.Enable(False)
683             self.spin_chi.Enable(True)    
684         else :
685             self.spin_chi.Enable(False)            
686         self.spin_f1.SetValue(self.paramgraph['facteur'][0])
687         self.spin_f2.SetValue(self.paramgraph['facteur'][1])
688         self.spin_f3.SetValue(self.paramgraph['facteur'][2])
689         self.slider_sphere.SetValue(self.paramgraph['alpha'])
690
691     def __do_layout(self):
692         sizer_2 = wx.BoxSizer(wx.VERTICAL)
693         fsizer = wx.FlexGridSizer(12,2,0,5)
694         grid_min = wx.FlexGridSizer(1, 2, 0, 0)
695         grid_max = wx.FlexGridSizer(1, 2, 0, 0)
696         grid_minmax = wx.FlexGridSizer(1, 2, 0, 0)
697         grid_min_tchi = wx.FlexGridSizer(1, 2, 0, 0)
698         grid_max_tchi = wx.FlexGridSizer(1, 2, 0, 0)
699         grid_minmax_tchi = wx.FlexGridSizer(1, 2, 0, 0)
700
701         sizer_3 = wx.BoxSizer(wx.VERTICAL)
702         
703         fsizer.Add(self.labeltype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
704         fsizer.Add(self.choicetype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
705         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
706         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
707
708         fsizer.Add(self.label_what, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
709         fsizer.Add(self.choice1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
710         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
711         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
712         
713         fsizer.Add(self.label_qui, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
714         fsizer.Add(self.choice2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
715         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
716         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)              
717         
718         sizer_h1 = wx.BoxSizer(wx.HORIZONTAL)
719         sizer_h1.Add(self.label_1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
720         sizer_h1.Add(self.spin1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
721         fsizer.Add(sizer_h1, 0, wx.ALL, 5)
722         sizer_h2 = wx.BoxSizer(wx.HORIZONTAL)
723         sizer_h2.Add(self.label_2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
724         sizer_h2.Add(self.spin2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
725         fsizer.Add(sizer_h2, 0, wx.ALL, 5)
726         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
727         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
728         
729         fsizer.Add(self.label_3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
730         fsizer.Add(self.spin3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)        
731         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
732         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
733         
734         fsizer.Add(self.label_4, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
735         sizer_nb = wx.BoxSizer(wx.HORIZONTAL)
736         sizer_nb.Add(self.check1, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
737         sizer_nb.Add(self.spin_nb, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
738         fsizer.Add(sizer_nb, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
739         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
740         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
741         
742         fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
743         sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
744         sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
745         sizer_chi.Add(self.spin_chi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
746         fsizer.Add(sizer_chi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
747         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
748         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
749         
750         fsizer.Add(self.label_6, 0,  wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL| wx.ADJUST_MINSIZE, 5)
751         fsizer.Add(self.check3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
752         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
753         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
754         
755         sizer_2.Add(fsizer, 0, wx.EXPAND, 0)
756         
757         bsizer_1 = wx.FlexGridSizer(3,3,0,0)
758         bsizer_1.Add(self.label_7, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
759         bsizer_1.Add(self.check4, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
760         grid_min.Add(self.label_min, 0,wx.ALL |  wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
761         grid_min.Add(self.spin_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
762         grid_max.Add(self.label_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
763         grid_max.Add(self.spin_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
764         grid_minmax.Add(grid_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
765         grid_minmax.Add(grid_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
766
767         bsizer_1.Add(grid_minmax, 0, wx.ALL, 5)
768
769         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
770         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
771         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)        
772
773         bsizer_1.Add(self.label_tchi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
774         bsizer_1.Add(self.check_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
775         grid_min_tchi.Add(self.label_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
776         grid_min_tchi.Add(self.spin_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
777         grid_max_tchi.Add(self.label_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
778         grid_max_tchi.Add(self.spin_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
779         grid_minmax_tchi.Add(grid_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
780         grid_minmax_tchi.Add(grid_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
781         
782         bsizer_1.Add(grid_minmax_tchi, 0,  wx.ALL, 5)
783         sizer_2.Add(bsizer_1, 0, wx.EXPAND, 5)
784         
785         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
786         
787         sizer_f = wx.BoxSizer(wx.HORIZONTAL)
788         sizer_f.Add(self.label_8, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
789         sizer_f.Add(self.spin_f1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
790         
791         sizer_f.Add(self.label_9, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
792         sizer_f.Add(self.spin_f2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
793
794         sizer_f.Add(self.label_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
795         sizer_f.Add(self.spin_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
796         sizer_2.Add(sizer_f, 0, wx.EXPAND, 5)
797         
798         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 5)
799         
800         fsizer2 = wx.FlexGridSizer(2,2,0,0)
801         fsizer2.Add(self.label_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
802         fsizer2.Add(self.slider_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
803         fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
804         fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
805
806         fsizer2.Add(self.label_film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
807         fsizer2.Add(self.film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
808         sizer_2.Add(fsizer2, 0, wx.EXPAND, 5)
809         sizer_2.Add(self.btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
810         self.SetSizer(sizer_2)
811         sizer_2.Fit(self)
812         self.Layout()
813         
814     def OnCheck1(self,event):
815         if self.check1.GetValue() :
816             self.check2.SetValue(False)
817             self.spin_chi.Enable(False)
818             self.spin_nb.Enable(True)
819         else : 
820             self.spin_nb.Enable(False)
821             
822     def OnCheck2(self,event):
823         if self.check2.GetValue() :
824            self.check1.SetValue(False)
825            self.spin_nb.Enable(False)
826            self.spin_chi.Enable(True)
827         else :
828            self.spin_chi.Enable(False) 
829
830     def OnNorm(self, event):
831         if not self.check4.GetValue() :
832             self.spin_min.Disable()
833             self.spin_max.Disable()
834         else :
835             self.spin_min.Enable(True)
836             self.spin_max.Enable(True)
837             self.check_tchi.SetValue(False)
838             self.OnCheckTchi(wx.EVT_CHECKBOX)
839
840     def OnCheckTchi(self, evt) :
841         if not self.check_tchi.GetValue() :
842             self.spin_min_tchi.Disable()
843             self.spin_max_tchi.Disable()
844         else :
845             self.spin_min_tchi.Enable(True)
846             self.spin_max_tchi.Enable(True)
847             self.check4.SetValue(False)
848             self.OnNorm(wx.EVT_CHECKBOX)
849
850     def On3D(self, event) :
851         if event.GetString() == u'3D' :
852             self.film.Enable(True)
853             self.spin_f3.Enable(True)
854             self.slider_sphere.Enable(True)
855         else :
856             self.film.Enable(False)
857             self.spin_f3.Enable(False)
858             self.slider_sphere.Enable(False)
859     
860     def OnPass(self,evt) :
861         if evt.GetString() != u'actives' :
862             self.check4.SetValue(False)
863             self.check4.Enable(False)
864             self.OnNorm(wx.EVT_CHECKBOX)
865         else :
866             self.check4.Enable()
867             
868 class PrefSimi ( wx.Dialog ):
869     
870     def __init__( self, parent, ID, paramsimi, indices ):
871         wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Paramètres", pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.DEFAULT_DIALOG_STYLE )
872         self.parent = parent
873         self.paramsimi=paramsimi
874         self.indices = indices
875
876         
877         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
878         
879         fgSizer5 = wx.FlexGridSizer( 0, 3, 0, 0 )
880         fgSizer5.SetFlexibleDirection( wx.BOTH )
881         fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
882         
883         fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
884         fgSizer3.SetFlexibleDirection( wx.BOTH )
885         fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
886         
887         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les colonnes", wx.DefaultPosition, wx.DefaultSize, 0 )
888         self.m_staticText1.Wrap( -1 )
889         fgSizer3.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
890         
891         self.check_colch = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
892         fgSizer3.Add( self.check_colch, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
893         
894         self.m_staticline29 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
895         fgSizer3.Add( self.m_staticline29, 0, wx.EXPAND, 5 )
896         
897         self.m_staticline291 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
898         fgSizer3.Add( self.m_staticline291, 0, wx.EXPAND, 5 )
899         if not self.paramsimi['first'] :
900  
901             self.m_staticText271 = wx.StaticText( self, wx.ID_ANY, u"Utiliser les coordonnées\nprécédentes", wx.DefaultPosition, wx.DefaultSize, 0 )
902             self.m_staticText271.Wrap( -1 )
903             fgSizer3.Add( self.m_staticText271, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
904         
905             self.check_coord = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
906             fgSizer3.Add( self.check_coord, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
907         
908             self.m_staticline36 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
909             fgSizer3.Add( self.m_staticline36, 0, wx.EXPAND, 5 )
910         
911             self.m_staticline37 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
912             fgSizer3.Add( self.m_staticline37, 0, wx.EXPAND, 5 )
913         
914         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Indice", wx.DefaultPosition, wx.DefaultSize, 0 )
915         self.m_staticText3.Wrap( -1 )
916         fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
917         
918         choice1Choices = []
919         self.choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.indices, 0 )
920         self.choice1.SetSelection( 0 )
921         fgSizer3.Add( self.choice1, 0, wx.ALL, 5 )
922         
923         self.m_staticline293 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
924         fgSizer3.Add( self.m_staticline293, 0, wx.EXPAND, 5 )
925         
926         self.m_staticline292 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
927         fgSizer3.Add( self.m_staticline292, 0, wx.EXPAND, 5 )
928         
929         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Layout", wx.DefaultPosition, wx.DefaultSize, 0 )
930         self.m_staticText4.Wrap( -1 )
931         fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
932         
933         choice2Choices = [u"random", u"cercle", u"fruchterman reingold", u"kamada kawai", u"graphopt"]
934         self.choice2 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice2Choices, 0 )
935         self.choice2.SetSelection( 0 )
936         fgSizer3.Add( self.choice2, 0, wx.ALL, 5 )
937         
938         self.m_staticline294 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
939         fgSizer3.Add( self.m_staticline294, 0, wx.EXPAND, 5 )
940         
941         self.m_staticline295 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
942         fgSizer3.Add( self.m_staticline295, 0, wx.EXPAND, 5 )
943         
944         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Type de graph", wx.DefaultPosition, wx.DefaultSize, 0 )
945         self.m_staticText5.Wrap( -1 )
946         fgSizer3.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
947         
948         choice3Choices = [u"dynamique", u"statique", u"3D"]
949         self.choice3 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice3Choices, 0 )
950         self.choice3.SetSelection( 0 )
951         fgSizer3.Add( self.choice3, 0, wx.ALL, 5 )
952         
953         self.m_staticline296 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
954         fgSizer3.Add( self.m_staticline296, 0, wx.EXPAND, 5 )
955         
956         self.m_staticline297 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
957         fgSizer3.Add( self.m_staticline297, 0, wx.EXPAND, 5 )
958         
959         self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Arbre maximum", wx.DefaultPosition, wx.DefaultSize, 0 )
960         self.m_staticText8.Wrap( -1 )
961         fgSizer3.Add( self.m_staticText8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
962         
963         self.check1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
964         fgSizer3.Add( self.check1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
965         
966         self.m_staticline298 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
967         fgSizer3.Add( self.m_staticline298, 0, wx.EXPAND, 5 )
968         
969         self.m_staticline299 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
970         fgSizer3.Add( self.m_staticline299, 0, wx.EXPAND, 5 )
971         
972         self.m_staticText91 = wx.StaticText( self, wx.ID_ANY, u"Graph à seuil", wx.DefaultPosition, wx.DefaultSize, 0 )
973         self.m_staticText91.Wrap( -1 )
974         fgSizer3.Add( self.m_staticText91, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
975         
976         bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
977         
978         self.check_seuil = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
979         bSizer21.Add( self.check_seuil, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
980         
981         self.spin_seuil = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 10000, 1 )
982         bSizer21.Add( self.spin_seuil, 0, wx.ALL, 5 )
983         
984         fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
985         
986         self.m_staticline2910 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
987         fgSizer3.Add( self.m_staticline2910, 0, wx.EXPAND, 5 )
988         
989         self.m_staticline2911 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
990         fgSizer3.Add( self.m_staticline2911, 0, wx.EXPAND, 5 )
991         
992         self.m_staticText19 = wx.StaticText( self, wx.ID_ANY, u"Texte sur les sommets", wx.DefaultPosition, wx.DefaultSize, 0 )
993         self.m_staticText19.Wrap( -1 )
994         fgSizer3.Add( self.m_staticText19, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
995         
996         self.check_vlab = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
997         fgSizer3.Add( self.check_vlab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
998         
999         self.m_staticline2912 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1000         fgSizer3.Add( self.m_staticline2912, 0, wx.EXPAND, 5 )
1001         
1002         self.m_staticline2913 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1003         fgSizer3.Add( self.m_staticline2913, 0, wx.EXPAND, 5 )
1004         
1005         self.m_staticText20 = wx.StaticText( self, wx.ID_ANY, u"Indices sur les arêtes", wx.DefaultPosition, wx.DefaultSize, 0 )
1006         self.m_staticText20.Wrap( -1 )
1007         fgSizer3.Add( self.m_staticText20, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1008         
1009         self.check_elab = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1010         fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1011         
1012         self.m_staticline2914 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1013         fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
1014         
1015         self.m_staticline2915 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1016         fgSizer3.Add( self.m_staticline2915, 0, wx.EXPAND, 5 )
1017         
1018         self.m_staticText27 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
1019         self.m_staticText27.Wrap( -1 )
1020         fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1021         
1022         self.spin_cex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
1023         fgSizer3.Add( self.spin_cex, 0, wx.ALL, 5 )
1024         
1025         self.m_staticline2916 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1026         fgSizer3.Add( self.m_staticline2916, 0, wx.EXPAND, 5 )
1027         
1028         self.m_staticline2917 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1029         fgSizer3.Add( self.m_staticline2917, 0, wx.EXPAND, 5 )
1030         
1031         if 'bystar' in self.paramsimi :
1032             self.m_staticText40 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner une variable", wx.DefaultPosition, wx.DefaultSize, 0 )
1033             self.m_staticText40.Wrap( -1 )
1034             fgSizer3.Add( self.m_staticText40, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1035             
1036             self.check_bystar = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1037             fgSizer3.Add( self.check_bystar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1038             
1039             self.m_staticline3200 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1040             fgSizer3.Add( self.m_staticline3200, 0, wx.EXPAND, 5 )
1041             self.m_staticline3201 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1042             fgSizer3.Add( self.m_staticline3201, 0, wx.EXPAND, 5 )
1043
1044         fgSizer5.Add( fgSizer3, 1, wx.EXPAND, 5 )
1045         
1046         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_VERTICAL )
1047         self.m_staticline5.SetForegroundColour( wx.Colour( 0, 0, 0 ) )
1048         
1049         fgSizer5.Add( self.m_staticline5, 0, wx.EXPAND|wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
1050         
1051         fgSizer51 = wx.FlexGridSizer( 0, 2, 0, 0 )
1052         fgSizer51.SetFlexibleDirection( wx.BOTH )
1053         fgSizer51.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1054         
1055         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du graphique", wx.DefaultPosition, wx.DefaultSize, 0 )
1056         self.m_staticText6.Wrap( -1 )
1057         fgSizer51.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1058         
1059         fgSizer31 = wx.FlexGridSizer( 0, 2, 0, 0 )
1060         fgSizer31.SetFlexibleDirection( wx.BOTH )
1061         fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1062         
1063         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
1064         self.m_staticText9.Wrap( -1 )
1065         fgSizer31.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1066         
1067         self.spin_height = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
1068         fgSizer31.Add( self.spin_height, 0, wx.ALL, 5 )
1069         
1070         self.m_staticText10 = wx.StaticText( self, wx.ID_ANY, u"largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
1071         self.m_staticText10.Wrap( -1 )
1072         fgSizer31.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1073         
1074         self.spin_width = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
1075         fgSizer31.Add( self.spin_width, 0, wx.ALL, 5 )
1076         
1077         fgSizer51.Add( fgSizer31, 1, wx.EXPAND, 5 )
1078         
1079         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1080         fgSizer51.Add( self.m_staticline3, 0, wx.EXPAND, 5 )
1081         
1082         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1083         fgSizer51.Add( self.m_staticline4, 0, wx.EXPAND, 5 )
1084         
1085         self.m_staticText101 = wx.StaticText( self, wx.ID_ANY, u"Taille des sommets \nproportionnelle à l'effectif\n(les scores sont normalisés)", wx.DefaultPosition, wx.DefaultSize, 0 )
1086         self.m_staticText101.Wrap( -1 )
1087         fgSizer51.Add( self.m_staticText101, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1088         
1089         bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
1090         
1091         bSizer9 = wx.BoxSizer( wx.VERTICAL )
1092         
1093         self.check2 = wx.CheckBox( self, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
1094         bSizer9.Add( self.check2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1095         
1096         if 'sfromchi' in self.paramsimi :
1097             self.checki = wx.CheckBox( self, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
1098             bSizer9.Add( self.checki, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1099         
1100         bSizer7.Add( bSizer9, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
1101         
1102         fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 )
1103         fgSizer7.SetFlexibleDirection( wx.BOTH )
1104         fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1105         
1106         self.m_staticText11 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1107         self.m_staticText11.Wrap( -1 )
1108         fgSizer7.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1109         
1110         self.spin_tvmin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1111         fgSizer7.Add( self.spin_tvmin, 0, wx.ALL, 5 )
1112         
1113         self.m_staticText12 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1114         self.m_staticText12.Wrap( -1 )
1115         fgSizer7.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1116         
1117         self.spin_tvmax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1118         fgSizer7.Add( self.spin_tvmax, 0, wx.ALL, 5 )
1119         
1120         bSizer7.Add( fgSizer7, 1, wx.EXPAND, 5 )
1121         
1122         fgSizer51.Add( bSizer7, 1, wx.EXPAND, 5 )
1123         
1124         self.m_staticline31 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1125         fgSizer51.Add( self.m_staticline31, 0, wx.EXPAND, 5 )
1126         
1127         self.m_staticline32 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1128         fgSizer51.Add( self.m_staticline32, 0, wx.EXPAND, 5 )
1129         
1130         self.m_staticText1011 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte des sommets \nproportionnelle à l'effectif\n(les scores sont normalisés)", wx.DefaultPosition, wx.DefaultSize, 0 )
1131         self.m_staticText1011.Wrap( -1 )
1132         fgSizer51.Add( self.m_staticText1011, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1133         
1134         bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
1135         
1136         bSizer8 = wx.BoxSizer( wx.VERTICAL )
1137         
1138         self.check_vcex = wx.CheckBox( self, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
1139         bSizer8.Add( self.check_vcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1140         if 'cexfromchi' in self.paramsimi :
1141         
1142             self.checkit = wx.CheckBox( self, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
1143             bSizer8.Add( self.checkit, 0, wx.ALL, 5 )
1144         
1145         bSizer71.Add( bSizer8, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
1146         
1147         fgSizer71 = wx.FlexGridSizer( 0, 2, 0, 0 )
1148         fgSizer71.SetFlexibleDirection( wx.BOTH )
1149         fgSizer71.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1150         
1151         self.m_staticText111 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1152         self.m_staticText111.Wrap( -1 )
1153         fgSizer71.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1154         
1155         self.spin_vcexmin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1156         fgSizer71.Add( self.spin_vcexmin, 0, wx.ALL, 5 )
1157         
1158         self.m_staticText121 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1159         self.m_staticText121.Wrap( -1 )
1160         fgSizer71.Add( self.m_staticText121, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1161         
1162         self.spin_vcexmax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1163         fgSizer71.Add( self.spin_vcexmax, 0, wx.ALL, 5 )
1164         
1165         bSizer71.Add( fgSizer71, 1, wx.EXPAND, 5 )
1166         
1167         fgSizer51.Add( bSizer71, 1, wx.EXPAND, 5 )
1168         
1169         self.m_staticline321 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1170         fgSizer51.Add( self.m_staticline321, 0, wx.EXPAND, 5 )
1171         
1172         self.m_staticline322 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1173         fgSizer51.Add( self.m_staticline322, 0, wx.EXPAND, 5 )
1174         
1175         self.m_staticText10111 = wx.StaticText( self, wx.ID_ANY, u"Largeur des arêtes\nproportionnelle à l'indice", wx.DefaultPosition, wx.DefaultSize, 0 )
1176         self.m_staticText10111.Wrap( -1 )
1177         fgSizer51.Add( self.m_staticText10111, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1178         
1179         bSizer711 = wx.BoxSizer( wx.HORIZONTAL )
1180         
1181         self.check3 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1182         bSizer711.Add( self.check3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1183         
1184         fgSizer711 = wx.FlexGridSizer( 0, 2, 0, 0 )
1185         fgSizer711.SetFlexibleDirection( wx.BOTH )
1186         fgSizer711.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1187         
1188         self.m_staticText1111 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1189         self.m_staticText1111.Wrap( -1 )
1190         fgSizer711.Add( self.m_staticText1111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1191         
1192         self.spin_temin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1193         fgSizer711.Add( self.spin_temin, 0, wx.ALL, 5 )
1194         
1195         self.m_staticText1211 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1196         self.m_staticText1211.Wrap( -1 )
1197         fgSizer711.Add( self.m_staticText1211, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1198         
1199         self.spin_temax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1200         fgSizer711.Add( self.spin_temax, 0, wx.ALL, 5 )
1201         
1202         bSizer711.Add( fgSizer711, 1, wx.EXPAND, 5 )
1203         
1204         fgSizer51.Add( bSizer711, 1, wx.EXPAND, 5 )
1205         
1206         self.m_staticline33 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1207         fgSizer51.Add( self.m_staticline33, 0, wx.EXPAND, 5 )
1208         
1209         self.m_staticline34 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1210         fgSizer51.Add( self.m_staticline34, 0, wx.EXPAND, 5 )
1211         
1212         self.m_staticText28 = wx.StaticText( self, wx.ID_ANY, u"Gradiant de gris sur les textes en fonction \nde l'effectif (du chi2) (0=noir; 1=blanc)", wx.DefaultPosition, wx.DefaultSize, 0 )
1213         self.m_staticText28.Wrap( -1 )
1214         fgSizer51.Add( self.m_staticText28, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1215         
1216         bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
1217         
1218         self.m_checkBox14 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1219         bSizer10.Add( self.m_checkBox14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1220         
1221         bSizer11 = wx.BoxSizer( wx.VERTICAL )
1222         
1223         bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
1224         
1225         self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1226         self.m_staticText31.Wrap( -1 )
1227         bSizer12.Add( self.m_staticText31, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1228         
1229         self.m_spinCtrl14 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10, 0 )
1230         bSizer12.Add( self.m_spinCtrl14, 0, wx.ALL, 5 )
1231         
1232         bSizer11.Add( bSizer12, 1, wx.EXPAND, 5 )
1233         
1234         bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
1235         
1236         self.m_staticText32 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1237         self.m_staticText32.Wrap( -1 )
1238         bSizer13.Add( self.m_staticText32, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1239         
1240         self.m_spinCtrl15 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10, 10 )
1241         bSizer13.Add( self.m_spinCtrl15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1242         
1243         bSizer11.Add( bSizer13, 1, wx.EXPAND, 5 )
1244         
1245         bSizer10.Add( bSizer11, 1, wx.EXPAND, 5 )
1246         
1247         fgSizer51.Add( bSizer10, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
1248         
1249         self.m_staticline3311 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1250         fgSizer51.Add( self.m_staticline3311, 0, wx.EXPAND |wx.ALL, 5 )
1251         
1252         self.m_staticline33111 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1253         fgSizer51.Add( self.m_staticline33111, 0, wx.EXPAND |wx.ALL, 5 )
1254         bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
1255         
1256         self.m_staticText21 = wx.StaticText( self, wx.ID_ANY, u"Couleur des sommets", wx.DefaultPosition, wx.DefaultSize, 0 )
1257         self.m_staticText21.Wrap( -1 )
1258         bSizer5.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1259         
1260         self.cols = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.Colour( 255, 0, 0 ), wx.DefaultPosition, wx.Size( 10,10 ), wx.CLRP_DEFAULT_STYLE )
1261         bSizer5.Add( self.cols, 0, wx.ALL, 5 )
1262         
1263         fgSizer51.Add( bSizer5, 1, wx.EXPAND, 5 )
1264         
1265         bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
1266         
1267         self.m_staticText22 = wx.StaticText( self, wx.ID_ANY, u"Couleur des arêtes", wx.DefaultPosition, wx.DefaultSize, 0 )
1268         self.m_staticText22.Wrap( -1 )
1269         bSizer6.Add( self.m_staticText22, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1270         
1271         self.cola = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.Colour( 208, 208, 208 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
1272         bSizer6.Add( self.cola, 0, wx.ALL, 5 )
1273         
1274         fgSizer51.Add( bSizer6, 1, wx.EXPAND, 5 )
1275         
1276         self.m_staticline331 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1277         fgSizer51.Add( self.m_staticline331, 0, wx.EXPAND, 5 )
1278         
1279         self.m_staticline332 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1280         fgSizer51.Add( self.m_staticline332, 0, wx.EXPAND, 5 )
1281         
1282         self.m_staticText23 = wx.StaticText( self, wx.ID_ANY, u"Taille des sommets unique", wx.DefaultPosition, wx.DefaultSize, 0 )
1283         self.m_staticText23.Wrap( -1 )
1284         fgSizer51.Add( self.m_staticText23, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1285         
1286         bSizer72 = wx.BoxSizer( wx.HORIZONTAL )
1287         
1288         self.check_s_size = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1289         bSizer72.Add( self.check_s_size, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1290         
1291         self.spin_tv = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
1292         bSizer72.Add( self.spin_tv, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1293         
1294         fgSizer51.Add( bSizer72, 1, wx.EXPAND, 5 )
1295         
1296         self.m_staticline333 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1297         fgSizer51.Add( self.m_staticline333, 0, wx.EXPAND, 5 )
1298         
1299         self.m_staticline334 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1300         fgSizer51.Add( self.m_staticline334, 0, wx.EXPAND, 5 )
1301         
1302         self.m_staticText24 = wx.StaticText( self, wx.ID_ANY, u"Transparence des sphères", wx.DefaultPosition, wx.DefaultSize, 0 )
1303         self.m_staticText24.Wrap( -1 )
1304         fgSizer51.Add( self.m_staticText24, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1305         
1306         self.slider_sphere = wx.Slider( self, wx.ID_ANY, 10, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL|wx.SL_LABELS )
1307         fgSizer51.Add( self.slider_sphere, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
1308         
1309         self.m_staticline335 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1310         fgSizer51.Add( self.m_staticline335, 0, wx.EXPAND, 5 )
1311         
1312         self.m_staticline336 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1313         fgSizer51.Add( self.m_staticline336, 0, wx.EXPAND, 5 )
1314         
1315         self.m_staticText25 = wx.StaticText( self, wx.ID_ANY, u"Faire un film", wx.DefaultPosition, wx.DefaultSize, 0 )
1316         self.m_staticText25.Wrap( -1 )
1317         fgSizer51.Add( self.m_staticText25, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1318         
1319         self.film = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1320         fgSizer51.Add( self.film, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1321         
1322         self.m_staticline2918 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1323         fgSizer51.Add( self.m_staticline2918, 0, wx.EXPAND, 5 )
1324         
1325         self.m_staticline2919 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1326         fgSizer51.Add( self.m_staticline2919, 0, wx.EXPAND, 5 )
1327         
1328         
1329         fgSizer51.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
1330         
1331         m_sdbSizer2 = wx.StdDialogButtonSizer()
1332         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1333         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1334         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1335         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1336         m_sdbSizer2.Realize();
1337         fgSizer51.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
1338         
1339         fgSizer5.Add( fgSizer51, 1, wx.EXPAND, 5 )
1340         
1341         self.SetSizer( fgSizer5 )
1342         self.__set_properties()
1343
1344         self.Layout()
1345         fgSizer5.Fit( self )
1346         
1347         self.Centre( wx.BOTH )
1348         
1349         # Connect Events
1350         if not self.paramsimi['first'] :
1351             self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
1352         self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
1353         self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
1354         if 'cexfromchi' in self.paramsimi :
1355             self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
1356         if 'sfromchi' in self.paramsimi :
1357             self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
1358         self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
1359         self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
1360
1361     def __set_properties(self):
1362         self.choice1.SetSelection(self.paramsimi['coeff'])
1363         self.choice2.SetSelection(self.paramsimi['layout'])
1364         self.choice3.SetSelection(self.paramsimi['type_graph'])
1365         if self.paramsimi['type'] != 2 :
1366             self.film.Enable(False)
1367             self.slider_sphere.Enable(False)
1368         else :
1369             self.film.Enable(True)
1370             self.slider_sphere.Enable(True)
1371         self.check1.SetValue(self.paramsimi['arbremax'])
1372         self.check_vlab.SetValue(self.paramsimi['label_v'])
1373         self.check_elab.SetValue(self.paramsimi['label_e'])
1374         self.check2.SetValue(self.paramsimi['tvprop'])
1375         self.spin_tv.SetValue(self.paramsimi['coeff_tv_nb'])
1376         self.check_s_size.SetValue(self.paramsimi['coeff_tv'])
1377         self.spin_tvmin.SetValue(self.paramsimi['tvmin'])
1378         self.spin_tvmax.SetValue(self.paramsimi['tvmax'])
1379         self.check3.SetValue(self.paramsimi['coeff_te'])
1380         self.spin_temin.SetValue(self.paramsimi['coeff_temin'])
1381         self.spin_temax.SetValue(self.paramsimi['coeff_temax'])
1382         self.check_vcex.SetValue(self.paramsimi['vcex'])
1383         self.spin_vcexmin.SetValue(self.paramsimi['vcexmin'])
1384         self.spin_vcexmax.SetValue(self.paramsimi['vcexmax'])
1385         self.spin_cex.SetValue(self.paramsimi['cex'])
1386         self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
1387         self.spin_seuil.SetValue(self.paramsimi['seuil'])
1388         self.cols.SetColour(self.paramsimi['cols'])
1389         self.cola.SetColour(self.paramsimi['cola'])
1390         self.spin_width.SetValue(self.paramsimi['width'])
1391         self.spin_height.SetValue(self.paramsimi['height'])
1392         if 'cexfromchi' in self.paramsimi :
1393             self.checkit.SetValue(self.paramsimi['cexfromchi'])
1394         if 'sfromchi' in self.paramsimi :
1395             self.checki.SetValue(self.paramsimi['sfromchi'])
1396         if not self.paramsimi['first'] :
1397             self.check_coord.SetValue(self.paramsimi['keep_coord'])
1398             self.OnKeepCoords(wx.EVT_CHECKBOX)
1399         if self.paramsimi.get('bystar', False) :
1400             self.check_bystar.SetValue(True)
1401             self.stars = self.paramsimi['stars']
1402         self.slider_sphere.SetValue(self.paramsimi['alpha'])
1403         self.film.SetValue(self.paramsimi['film'])
1404
1405     def OnCheck_s_size(self, evt):
1406         if self.check_s_size.GetValue() :
1407             if 'cexfromchi' in self.paramsimi :
1408                 self.checki.SetValue(False)
1409             self.check2.SetValue(False)
1410             self.spin_tvmin.Enable(False)
1411             self.spin_tvmax.Enable(False)
1412             self.spin_tv.Enable(True)
1413         else :
1414             self.check2.SetValue(True)
1415             self.spin_tvmin.Enable(True)
1416             self.spin_tvmax.Enable(True)
1417             self.spin_tv.Enable(False)
1418
1419     def OnCheck2(self, evt):
1420         if self.check2.GetValue():
1421             self.check_s_size.SetValue(False)
1422             if 'cexfromchi' in self.paramsimi :
1423                 self.checki.SetValue(False)
1424             self.spin_tvmin.Enable(True)
1425             self.spin_tvmax.Enable(True)
1426             self.spin_tv.Enable(False)
1427         else :
1428             self.check_s_size.SetValue(True)
1429             self.spin_tvmin.Enable(False)
1430             self.spin_tvmax.Enable(False)
1431             self.spin_tv.Enable(True)
1432
1433     def OnChecki(self, evt):
1434         if 'sfromchi' in self.paramsimi :
1435             if self.checki.GetValue() :
1436                 self.check_s_size.SetValue(False)
1437                 self.check2.SetValue(False)
1438                 self.spin_tvmin.Enable(True)
1439                 self.spin_tvmax.Enable(True)
1440                 self.spin_tv.Enable(False)
1441             else :
1442                 self.check_s_size.SetValue(True)
1443                 #self.check2.SetValue(True)
1444                 self.spin_tvmin.Enable(False)
1445                 self.spin_tvmax.Enable(False)
1446                 self.spin_tv.Enable(True)
1447
1448     def OnCheckit(self,evt) :
1449         if 'cexfromchi' in self.paramsimi :
1450             if self.checkit.GetValue() :
1451                 if self.check_vcex.GetValue() :
1452                     self.check_vcex.SetValue(False)
1453
1454     def OnCheck_vcex(self, evt):
1455         if self.check_vcex.GetValue() :
1456             if 'checkit' in dir(self) :
1457                 if self.checkit.GetValue() :
1458                     self.checkit.SetValue(False)
1459     
1460     def OnChangeType(self, event) :
1461         if event.GetInt() != 1 :
1462             self.spin_width.Enable(False)
1463             self.spin_height.Enable(False)
1464         else :
1465             self.spin_width.Enable(True)
1466             self.spin_height.Enable(True)
1467         if event.GetInt() != 2 :
1468             self.film.Enable(False)
1469             self.slider_sphere.Enable(False)
1470         else :
1471             self.film.Enable(True)
1472             self.slider_sphere.Enable(True)
1473
1474     def OnKeepCoords(self, event):
1475         if self.check_coord.GetValue() :
1476             self.choice1.SetSelection(self.paramsimi['coeff'])
1477             self.choice2.SetSelection(self.paramsimi['layout'])
1478             self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
1479             self.spin_seuil.SetValue(self.paramsimi['seuil'])
1480             self.choice1.Disable()
1481             self.choice2.Disable()
1482             self.check_seuil.Disable()
1483             self.spin_seuil.Disable()
1484             self.check_colch.SetValue(False)
1485             self.check_colch.Disable()
1486         else :
1487             self.choice1.Enable(True)
1488             self.choice2.Enable(True)
1489             self.check_seuil.Enable(True)
1490             self.spin_seuil.Enable(True)
1491             self.check_colch.Enable(True)
1492
1493 class SelectColDial ( wx.Dialog ):
1494     
1495     def __init__( self, parent ):
1496         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 )
1497         
1498         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1499         
1500         self.bSizer2 = wx.BoxSizer( wx.VERTICAL )
1501         
1502         #self.m_checkList2 = wx.CheckListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ['r','t','y'], 0 ) 
1503         #bSizer2.Add( self.m_checkList2, 2, wx.ALL|wx.EXPAND, 5 )
1504         
1505         self.m_sdbSizer2 = wx.StdDialogButtonSizer()
1506         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1507         #m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1508         #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1509         #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1510         #m_sdbSizer2.Realize();
1511         #self.bSizer2.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
1512         
1513         self.SetSizer( self.bSizer2 )
1514         self.Layout()
1515         
1516         self.Centre( wx.BOTH )
1517     
1518     def __del__( self ):
1519         pass
1520
1521 class PrefExport(wx.Dialog):
1522     def __init__(self, parent, *args, **kwds):
1523         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1524         wx.Dialog.__init__(self, *args, **kwds)
1525         self.fileout = ""
1526         self.parent = parent
1527         sizer = wx.BoxSizer(wx.VERTICAL)
1528         box = wx.BoxSizer(wx.HORIZONTAL)
1529         box3 = wx.BoxSizer(wx.HORIZONTAL)
1530         self.label_lem = wx.StaticText(self, -1, u"Corpus Lemmatisé")
1531         box3.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1532         self.radio_lem = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1533         box3.Add(self.radio_lem, 0, wx.ALIGN_RIGHT, 5)
1534         sizer.Add(box3, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1535         self.label_txt = wx.StaticText(self, -1, u"Exporter pour...")
1536         box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1537         self.radio_type = wx.RadioBox(self, -1, u"", choices=['IRaMuTeQ/ALCESTE', 'Lexico'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1538         box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1539         sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1540         box2 = wx.BoxSizer(wx.HORIZONTAL)
1541         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1542         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1543         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
1544         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1545         self.fbb.SetLabel("")
1546         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1547
1548         btnsizer = wx.StdDialogButtonSizer()
1549         btn = wx.Button(self, wx.ID_CANCEL)
1550         btnsizer.AddButton(btn)
1551         btn_ok = wx.Button(self, wx.ID_OK)
1552         btn_ok.SetDefault()
1553         btnsizer.AddButton(btn_ok)
1554         btnsizer.Realize()
1555         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1556         self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1557         self.SetSizer(sizer)
1558         sizer.Fit(self)        
1559
1560     def check_file(self, evt) :
1561         if evt.GetId() == wx.ID_OK :
1562             if os.path.exists(self.fbb.GetValue()):
1563                 dlg = wx.MessageDialog(self, u"%s\nCe fichier existe, continuer quand même ?" % self.fbb.GetValue(), 'ATTENTION', wx.NO | wx.YES | wx.ICON_WARNING)
1564                 dlg.CenterOnParent()
1565                 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
1566                     self.EndModal(wx.ID_OK)
1567             else :
1568                  self.EndModal(wx.ID_OK)
1569         else :
1570             self.EndModal(wx.ID_CANCEL)
1571
1572 class PrefProfTypes(wx.Dialog):
1573     def __init__(self, parent, *args, **kwds):
1574         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1575         wx.Dialog.__init__(self, parent, *args, **kwds)
1576         self.fileout = ""
1577         self.parent = parent
1578         sizer = wx.BoxSizer(wx.VERTICAL)
1579         box = wx.BoxSizer(wx.HORIZONTAL)
1580         box3 = wx.BoxSizer(wx.HORIZONTAL)
1581         self.label_txt = wx.StaticText(self, -1, u"Préférences")
1582         box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1583         self.radio_type = wx.RadioBox(self, -1, u"", choices=['comme ALCESTE', 'comme Lexico'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1584         box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1585         sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1586         box2 = wx.BoxSizer(wx.HORIZONTAL)
1587         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1588         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1589         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
1590         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1591         self.fbb.SetLabel("")
1592         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1593
1594         btnsizer = wx.StdDialogButtonSizer()
1595         btn = wx.Button(self, wx.ID_CANCEL)
1596         btnsizer.AddButton(btn)
1597         btn_ok = wx.Button(self, wx.ID_OK)
1598         btn_ok.SetDefault()
1599         btnsizer.AddButton(btn_ok)
1600         btnsizer.Realize()
1601         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1602         #self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1603         self.SetSizer(sizer)
1604         sizer.Fit(self)
1605
1606 class PrefSimpleFile(wx.Dialog):
1607     def __init__(self, parent, *args, **kwds):
1608         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1609         if 'mask' in kwds :
1610             self.mask = kwds['mask']
1611             del(kwds['mask'])
1612         else : self.mask = '*.*'
1613         wx.Dialog.__init__(self, *args, **kwds)
1614         self.fileout = ""
1615         self.parent = parent
1616         sizer = wx.BoxSizer(wx.VERTICAL)
1617         box2 = wx.BoxSizer(wx.HORIZONTAL)
1618         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1619         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1620         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2, fileMask = self.mask)
1621         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1622         self.fbb.SetLabel("")
1623         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1624
1625         btnsizer = wx.StdDialogButtonSizer()
1626         btn = wx.Button(self, wx.ID_CANCEL)
1627         btnsizer.AddButton(btn)
1628         btn_ok = wx.Button(self, wx.ID_OK)
1629         btn_ok.SetDefault()
1630         btnsizer.AddButton(btn_ok)
1631         btnsizer.Realize()
1632         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1633         self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1634         self.SetSizer(sizer)
1635         sizer.Fit(self)        
1636
1637     def check_file(self, evt) :
1638         if evt.GetId() == wx.ID_OK :
1639             if os.path.exists(self.fbb.GetValue()):
1640                 dlg = wx.MessageDialog(self, u"%s\nCe fichier existe, continuer quand même ?" % self.fbb.GetValue(), 'ATTENTION', wx.NO | wx.YES | wx.ICON_WARNING)
1641                 dlg.CenterOnParent()
1642                 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
1643                     self.EndModal(wx.ID_OK)
1644             else :
1645                  self.EndModal(wx.ID_OK)
1646         else :
1647             self.EndModal(wx.ID_CANCEL)
1648
1649
1650 class StatDialog(wx.Dialog):
1651     def __init__(self, parent, *args, **kwds):
1652         kwds['style'] = wx.DEFAULT_DIALOG_STYLE 
1653         wx.Dialog.__init__(self, *args, **kwds)
1654         self.fileout = ""
1655         self.parent = parent
1656         #box = wx.BoxSizer(wx.HORIZONTAL)
1657         self.label_lem = wx.StaticText(self, -1, u"Lemmatisation")
1658         self.radio_lem = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1659         #sizer.Add(box, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1660         #box2 = wx.BoxSizer(wx.HORIZONTAL)
1661         #self.txt_exp = wx.StaticText(self, -1, u"Utiliser le Dict. des expressions")
1662         #self.exp = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1663         #self.label_uce =  wx.StaticText(self, -1, u"Construire des UCE")
1664         #self.check_uce = wx.CheckBox(self, -1)
1665         #txt = """Nombre d'occurrences par uce"""
1666         #self.label_occuce = wx.StaticText(self, -1, txt)
1667         #self.spin_ctrl_4 = wx.SpinCtrl(self, -1, "",size = (100,30), min=10, max=1000, initial = 35)
1668         #txt = u"""Fréquence minimum d'une forme
1669 #analysée (0 = non utilisé)"""
1670         #self.label_8 = wx.StaticText(self, -1, txt)
1671         #self.spin_ctrl_5 = wx.SpinCtrl(self, -1, "",size = (100,30), min=0, max=1000, initial=0)
1672         #self.label_max_actives =  wx.StaticText(self, -1, u"Nombre maximum de formes analysées")
1673         #self.spin_max_actives = wx.SpinCtrl(self, -1, "",size = (100,30), min=20, max=10000, initial=1500)
1674         self.label_4 = wx.StaticText(self, -1, u"Configuration des clés d'analyse")
1675         self.button_5 = wx.Button(self, wx.ID_PREFERENCES, "")
1676
1677         #self.Bind(wx.EVT_CHECKBOX, self.OnCheckUce, self.check_uce)
1678         #self.Bind(wx.EVT_SPINCTRL, self.OnSpin, self.spin_ctrl_5)
1679         self.Bind(wx.EVT_BUTTON, self.OnKeys, self.button_5)
1680         self.__do_layout()
1681         self.__set_properties()
1682
1683     def __do_layout(self) :
1684         first = wx.BoxSizer(wx.VERTICAL)
1685         sizer = wx.FlexGridSizer(4,2,0,0)
1686         sizer.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1687         sizer.Add(self.radio_lem, 0, wx.ALIGN_LEFT, 5)
1688         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1689         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1690         #sizer.Add(self.txt_exp, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1691         #sizer.Add(self.exp, 0, wx.ALIGN_RIGHT, 5)
1692         #sizer.Add(self.label_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1693         #sizer.Add(self.check_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1694         #sizer.Add(self.label_occuce, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1695         #sizer.Add(self.spin_ctrl_4, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1696         #sizer.Add(self.label_8, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1697         #sizer.Add(self.spin_ctrl_5, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1698         #sizer.Add(self.label_max_actives, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1699         #sizer.Add(self.spin_max_actives, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1700         sizer.Add(self.label_4, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1701         sizer.Add(self.button_5, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1702         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1703         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1704         #sizer.Add(box2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1705         first.Add(sizer, 0, wx.ALL, 5)
1706         btnsizer = wx.StdDialogButtonSizer()
1707         btn = wx.Button(self, wx.ID_CANCEL)
1708         btnsizer.AddButton(btn)
1709         btn_ok = wx.Button(self, wx.ID_OK)
1710         btn_ok.SetDefault()
1711         btnsizer.AddButton(btn_ok)
1712         btnsizer.Realize()
1713         first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1714         self.SetSizer(first)
1715         first.Fit(self)
1716
1717     def __set_properties(self) :
1718         self.SetTitle(u'Préférences')
1719         #self.spin_ctrl_4.Enable(False)
1720         #self.spin_ctrl_5.Enable(False)
1721         #self.spin_max_actives.Enable(False)
1722
1723 #    def OnCheckUce(self, evt) :
1724 #        if self.check_uce.GetValue() :
1725 #            self.spin_ctrl_4.Enable(True)
1726 #            self.spin_ctrl_5.Enable(True)
1727 #            if self.spin_ctrl_5.GetValue() > 0 :
1728 #                self.spin_max_actives.Enable(False)
1729 #            else :
1730 #                self.spin_max_actives.Enable(True)
1731 #        else :
1732 #            self.spin_ctrl_4.Enable(False)
1733 #            self.spin_ctrl_5.Enable(False)
1734 #            self.spin_max_actives.Enable(False)
1735
1736 #    def OnSpin(self, evt) :
1737 #        if self.spin_ctrl_5.GetValue() > 0 :
1738 #            self.spin_max_actives.Enable(False)
1739 #        else :
1740 #            self.spin_max_actives.Enable(True)
1741
1742     def OnKeys(self, evt):
1743         dial = AlcOptFrame(self.parent, self)
1744         dial.CenterOnParent()
1745         val = dial.ShowModal()
1746
1747 class LexDialog( wx.Dialog ):
1748     
1749     def __init__( self, parent ):
1750         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1751         
1752         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1753         
1754         bSizer2 = wx.BoxSizer( wx.VERTICAL )
1755         
1756         fgSizer2 = wx.FlexGridSizer( 2, 2, 0, 0 )
1757         fgSizer2.SetFlexibleDirection( wx.BOTH )
1758         fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1759         
1760         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Lemmatisation", wx.DefaultPosition, wx.DefaultSize, 0 )
1761         self.m_staticText9.Wrap( -1 )
1762         fgSizer2.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3 )
1763         
1764         m_radioBox2Choices = [ u"oui", u"non" ]
1765         self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
1766         self.m_radioBox2.SetSelection( 0 )
1767         fgSizer2.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 3 )
1768         
1769 #        self.m_staticText10 = wx.StaticText( self, wx.ID_ANY, u"Utiliser le Dict. des expressions", wx.DefaultPosition, wx.DefaultSize, 0 )
1770 #        self.m_staticText10.Wrap( -1 )
1771 #        fgSizer2.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3 )
1772 #        
1773 #        m_radioBox21Choices = [ u"oui", u"non" ]
1774 #        self.m_radioBox21 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox21Choices, 1, wx.RA_SPECIFY_COLS )
1775 #        self.m_radioBox21.SetSelection( 0 )
1776 #        fgSizer2.Add( self.m_radioBox21, 0, wx.ALIGN_RIGHT|wx.ALL, 3 )
1777 #        bSizer2.Add( fgSizer2, 1, wx.EXPAND, 5 )
1778         
1779         btnsizer = wx.StdDialogButtonSizer()
1780         btn = wx.Button(self, wx.ID_CANCEL)
1781         btnsizer.AddButton(btn)
1782         btn_ok = wx.Button( self, wx.ID_OK)
1783         btn_ok.SetDefault()
1784         btnsizer.AddButton(btn_ok)
1785         btnsizer.Realize()
1786
1787         bSizer2.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1788         self.SetSizer( bSizer2 )
1789         self.Layout()
1790         bSizer2.Fit( self )
1791         self.Centre( wx.BOTH )
1792
1793 class PrefUCECarac(wx.Dialog):
1794     def __init__(self, parent, *args, **kwds):
1795         kwds['style'] = wx.DEFAULT_DIALOG_STYLE 
1796         kwds['title'] = u"UCE caractéristiques"
1797         wx.Dialog.__init__(self, *args, **kwds)
1798         self.parent = parent
1799         first = wx.BoxSizer(wx.VERTICAL)
1800         sizer = wx.FlexGridSizer(2,2,0,0)
1801         self.label_type = wx.StaticText(self, -1, u"Score de classement")
1802         sizer.Add(self.label_type, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1803         self.radio_type = wx.RadioBox(self, -1, u"", choices=[u'absolu (somme des chi2 des formes marquées de l\'UCE)', u'relatif (moyenne des chi2 des formes marquées de l\'UCE)'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1804         sizer.Add(self.radio_type, 0, wx.ALIGN_RIGHT, 5)
1805         self.txt_eff = wx.StaticText(self, -1, u"Nombre d\'UCE maximum")
1806         sizer.Add(self.txt_eff, 0, wx.ALIGN_CENTRE, 5)
1807         self.spin_eff = wx.SpinCtrl(self, -1, '', size = (100, 30), min = 1, max = 100000, initial = 50)
1808         sizer.Add(self.spin_eff, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1809         first.Add(sizer, 0, wx.ALL, 5)
1810         btnsizer = wx.StdDialogButtonSizer()
1811         btn = wx.Button(self, wx.ID_CANCEL)
1812         btnsizer.AddButton(btn)
1813         btn_ok = wx.Button(self, wx.ID_OK)
1814         btn_ok.SetDefault()
1815         btnsizer.AddButton(btn_ok)
1816         btnsizer.Realize()
1817         first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1818         self.SetSizer(first)
1819         first.Fit(self)
1820
1821 class PrefSegProf(wx.Dialog) :
1822     def __init__( self, parent ):
1823         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Profils des segments répétés", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1824         
1825         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1826         bSizer1 = wx.BoxSizer( wx.VERTICAL )
1827         txt = u"ATTENTION : le calcul des profils des segments répétés\npeut être très long sur les corpus importants"
1828         self.label = wx.StaticText( self, wx.ID_ANY, txt, wx.DefaultPosition, wx.DefaultSize, 0 ) 
1829         bSizer1.Add( self.label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5 )
1830
1831         fgSizer1 = wx.FlexGridSizer( 2, 2, 0, 0 )
1832         fgSizer1.SetFlexibleDirection( wx.BOTH )
1833         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1834         
1835         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Corpus lemmatisé", wx.DefaultPosition, wx.DefaultSize, 0 )
1836         self.m_staticText1.Wrap( -1 )
1837         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1838         
1839         box_lemChoices = [ u"oui", u"non" ]
1840         self.box_lem = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, box_lemChoices, 1, wx.RA_SPECIFY_COLS )
1841         self.box_lem.SetSelection( 1 )
1842         fgSizer1.Add( self.box_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1843         #self.box_lem.Enable(False)
1844         
1845         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Taille minimum des segments", wx.DefaultPosition, wx.DefaultSize, 0 )
1846         self.m_staticText3.Wrap( -1 )
1847         fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1848         
1849         self.spin_min = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 2 )
1850         self.spin_min.SetValue(2)
1851         fgSizer1.Add( self.spin_min, 0, wx.ALL, 5 )
1852         
1853         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Taille maximum des segments", wx.DefaultPosition, wx.DefaultSize, 0 )
1854         self.m_staticText4.Wrap( -1 )
1855         fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1856         
1857         self.spin_max = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 10 )
1858         self.spin_max.SetValue(10)
1859         fgSizer1.Add( self.spin_max, 0, wx.ALL, 5 )
1860         
1861         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Effectif minimum d'un segment retenu", wx.DefaultPosition, wx.DefaultSize, 0 )
1862         self.m_staticText5.Wrap( -1 )
1863         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1864         
1865         self.spin_eff = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 4, 1000, 4 )
1866         self.spin_eff.SetValue(4)
1867         fgSizer1.Add( self.spin_eff, 0, wx.ALL, 5 )
1868         
1869         bSizer1.Add( fgSizer1, 1, wx.EXPAND, 5 )
1870         btnsizer = wx.StdDialogButtonSizer()
1871         btn = wx.Button(self, wx.ID_CANCEL)
1872         btnsizer.AddButton(btn)
1873         btn_ok = wx.Button(self, wx.ID_OK)
1874         btn_ok.SetDefault()
1875         btnsizer.AddButton(btn_ok)
1876         btnsizer.Realize()
1877         bSizer1.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1878
1879         self.SetSizer( bSizer1 )
1880         self.Layout()
1881         bSizer1.Fit( self )
1882         
1883         self.Centre( wx.BOTH )
1884
1885 class PrefQuestAlc ( wx.Dialog ):
1886     
1887     def __init__( self, parent, sim = False):
1888         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u'Classification', pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1889         
1890         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1891         
1892         #---------------------------------------------------------------
1893         #self.content = parent.content[:]
1894         self.header = parent.tableau.get_colnames()
1895         labels = [val for val in self.header]
1896         self.labels_tot = labels
1897         self.varsup = []
1898         self.sim = sim
1899         #---------------------------------------------------------------
1900         bSizer2 = wx.BoxSizer( wx.VERTICAL )
1901         
1902         fgSizer1 = wx.FlexGridSizer( 2, 2, 0, 0 )
1903         fgSizer1.SetFlexibleDirection( wx.BOTH )
1904         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1905
1906         if not self.sim :
1907             self.lab_format = wx.StaticText( self, wx.ID_ANY, u"Le corpus est formaté", wx.DefaultPosition, wx.DefaultSize, 0 )
1908             self.lab_format.Wrap( -1 )
1909             fgSizer1.Add( self.lab_format, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1910         
1911             m_radioBox1Choices = [ u"oui", u"non" ]
1912             self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
1913             self.m_radioBox1.SetSelection( 0 )
1914             fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1915         
1916         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Variables actives (min = 3) :", wx.DefaultPosition, wx.DefaultSize, 0 )
1917         self.m_staticText3.Wrap( -1 )
1918         fgSizer1.Add( self.m_staticText3, 0, wx.ALL, 5 )
1919         
1920         self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Variables illustratives (min = 1):", wx.DefaultPosition, wx.DefaultSize, 0 )
1921         self.m_staticText2.Wrap( -1 )
1922         fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
1923         
1924         self.ListActive = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels,  wx.LB_EXTENDED )
1925         self.ListActive.SetMinSize( wx.Size( 300,250 ) )
1926         
1927         fgSizer1.Add( self.ListActive, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1928         
1929         self.ListSup = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels, wx.LB_EXTENDED )
1930         self.ListSup.SetMinSize( wx.Size( 300,250 ) )
1931         
1932         fgSizer1.Add( self.ListSup, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1933         
1934         self.but_suiv = wx.Button( self, wx.ID_ANY, u"Suivant", wx.DefaultPosition, wx.DefaultSize, 0 )
1935         fgSizer1.Add( self.but_suiv, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1936         
1937         self.but_prec = wx.Button( self, wx.ID_ANY, u"Précédent", wx.DefaultPosition, wx.DefaultSize, 0 )
1938         fgSizer1.Add( self.but_prec, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1939         
1940         if not sim :
1941             self.lab_nbcl = wx.StaticText( self, wx.ID_ANY, u"Nombre de classes terminales de la phase 1", wx.DefaultPosition, wx.DefaultSize, 0 )
1942             self.lab_nbcl.Wrap( -1 )
1943             fgSizer1.Add( self.lab_nbcl, 0, wx.ALL, 5 )
1944             
1945             self.spin_nbcl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 100, 10 )
1946             self.spin_nbcl.SetValue(10)
1947             self.spin_nbcl.SetMinSize( wx.Size( 100,30 ) )
1948             
1949             fgSizer1.Add( self.spin_nbcl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1950             
1951             self.lab_mincl = wx.StaticText( self, wx.ID_ANY, u"Effectif minimum d'une classe (2 = automatique)", wx.DefaultPosition, wx.DefaultSize, 0 )
1952             self.lab_mincl.Wrap( -1 )
1953             fgSizer1.Add( self.lab_mincl, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1954             
1955             self.spin_mincl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 1000, 0 )
1956             self.spin_mincl.SetValue(2)
1957             self.spin_mincl.SetMinSize( wx.Size( 100,30 ) )
1958             
1959             fgSizer1.Add( self.spin_mincl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1960             
1961         bSizer2.Add( fgSizer1, 1, wx.EXPAND, 5 )
1962         
1963         m_sdbSizer2 = wx.StdDialogButtonSizer()
1964         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1965         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1966         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1967         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1968         m_sdbSizer2.Realize();
1969         bSizer2.Add( m_sdbSizer2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1970         
1971         self.SetSizer( bSizer2 )
1972         self.Layout()
1973         bSizer2.Fit( self )
1974         
1975         self.Centre( wx.BOTH )
1976         
1977         if not self.sim :
1978             self.ListActive.Enable(False)
1979             self.ListSup.Enable(False)
1980             self.but_suiv.Enable(False)
1981             self.but_prec.Enable(False)
1982         else :
1983             self.ListSup.Enable(False)
1984             self.but_prec.Enable(False)
1985         
1986         # Connect Events
1987         if not self.sim :
1988             self.m_radioBox1.Bind( wx.EVT_RADIOBOX, self.onformat )
1989         self.but_suiv.Bind(wx.EVT_BUTTON, self.onsuivant)
1990         self.but_prec.Bind(wx.EVT_BUTTON, self.onprec)
1991         self.m_sdbSizer2OK.Bind(wx.EVT_BUTTON, self.onvalid)
1992
1993     def __del__( self ):
1994         pass
1995     
1996     # Virtual event handlers, overide them in your derived class
1997     def onformat( self, event ):
1998         if self.m_radioBox1.GetSelection() == 0 :
1999             self.ListActive.Enable(False)
2000             self.ListSup.Enable(False)
2001             self.but_suiv.Enable(False)
2002             self.m_sdbSizer2OK.Enable(True)
2003         else :
2004             self.ListActive.Enable(True)
2005             self.but_suiv.Enable(True)
2006             self.m_sdbSizer2OK.Enable(False)
2007         
2008     def onsuivant(self, evt) :
2009         actives = list(self.ListActive.GetSelections())
2010         actives.sort()
2011         if len(actives)>=3 and len(actives) != len(self.header) :
2012             self.hindices = []
2013             self.nactives = []
2014             compt = 0
2015             header = self.header[:]
2016             for i in range(0, len(header)):
2017                 self.hindices.append(i)
2018             for i in actives :
2019                 self.nactives.append(i)
2020                 header.pop(i - compt)
2021                 self.hindices.pop(i - compt)
2022                 compt += 1
2023             self.labels = [val for val in header]
2024             self.ListSup.Clear()
2025             for i in header :
2026                 self.ListSup.Append(i)
2027                         
2028             self.ListActive.Enable(False)    
2029             self.ListSup.Enable(True)
2030             self.but_suiv.Enable(False)
2031             self.but_prec.Enable(True)
2032             if not self.sim :
2033                 self.m_sdbSizer2OK.Enable(True)
2034
2035     def onprec(self, evt) :
2036         self.ListActive.Enable(True)    
2037         self.ListSup.Enable(False)
2038         self.but_suiv.Enable(True)
2039         self.but_prec.Enable(False)
2040         if not self.sim :
2041             self.m_sdbSizer2OK.Enable(False)
2042
2043     def onvalid(self, evt) :
2044         for i in self.ListSup.GetSelections() :
2045             self.varsup.append(self.hindices[i])
2046         if not self.sim :
2047             if len(self.varsup) >= 1 or self.m_radioBox1.GetSelection() == 0 :
2048                 evt.Skip()
2049         else :
2050             if len(self.varsup) >= 1 :
2051                 evt.Skip()
2052
2053 class FindInCluster(wx.Frame):
2054     def __init__(self, parent, id, result, style = wx.DEFAULT_FRAME_STYLE):
2055         # begin wxGlade: MyFrame.__init__
2056         wx.Frame.__init__(self, parent, id)
2057         self.spanel =  wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL)
2058         self.sizer1 = wx.FlexGridSizer(len(result)+1,4,0,0)
2059         self.parent = parent
2060         self.formes = {}
2061         txt =  [u'forme',u'classe',u'chi2',u'voir']
2062         for val in txt :
2063             self.sizer1.Add( wx.StaticText(self.spanel, -1, val), 0, wx.ALL, 5)
2064         for val in txt :
2065             self.sizer1.Add(wx.StaticLine(self.spanel, -1), 0, wx.ALL, 5)
2066         for i,val in enumerate(result) :
2067             forme = val[0]
2068             cl = val[1]
2069             chi = val[2]
2070             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2071             siz = wx.BoxSizer(wx.VERTICAL)
2072             txt = wx.StaticText(pan, -1, forme)
2073             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2074             pan.SetSizer(siz)
2075             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2076             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2077             siz = wx.BoxSizer(wx.VERTICAL)
2078             txt = wx.StaticText(pan, -1, str(cl))
2079             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2080             pan.SetSizer(siz)
2081             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2082             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2083             siz = wx.BoxSizer(wx.VERTICAL)
2084             txt = wx.StaticText(pan, -1, str(chi))
2085             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2086             pan.SetSizer(siz)
2087             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2088             idbut = wx.NewId()
2089             self.formes[idbut] = [forme, cl]
2090             but = wx.Button(self.spanel, idbut, u"voir")
2091             self.sizer1.Add(but, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2092             self.Bind(wx.EVT_BUTTON, self.showitem, but)
2093         self.button_1 = wx.Button(self, -1, "Fermer")
2094         self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1)
2095         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
2096         self.__set_properties()
2097         self.__do_layout()
2098         # end wxGlade
2099     
2100     def __set_properties(self):
2101         self.SetTitle(u'Résultats')
2102         self.spanel.EnableScrolling(True,True)
2103         #self.panel_1.SetSize((1000,1000))
2104         self.spanel.SetScrollRate(20, 20)
2105         h = 60 * len(self.formes)
2106         if h > 600 :
2107             h = 600
2108         if h < 150 :
2109             h = 150
2110         self.SetSize(wx.Size(400,h))
2111
2112     def __do_layout(self):
2113         # begin wxGlade: MyFrame.__do_layout
2114         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2115         sizer_2 = wx.BoxSizer(wx.VERTICAL)
2116         self.spanel.SetSizer(self.sizer1)
2117         sizer_1.Add(self.spanel, 4, wx.EXPAND, 0)
2118         sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
2119         #sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
2120         self.SetAutoLayout(True)
2121         self.SetSizer(sizer_1)
2122         self.Layout()
2123         # end wxGlade
2124
2125     def showitem(self, evt) :
2126         idb = evt.GetEventObject().GetId()
2127         nb = self.parent.nb
2128         profile = nb.GetPage(nb.GetSelection())
2129         cl = self.formes[idb][1] - 1
2130         forme = self.formes[idb][0]
2131         profile.ProfNB.SetSelection(cl)
2132         UnSelectList(profile.ProfNB.GetPage(cl).list)
2133         datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).list.GetItemCount())])
2134         profile.ProfNB.GetPage(cl).list.SetItemState(datas[self.formes[idb][0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2135         profile.ProfNB.GetPage(cl).list.Focus(datas[forme])
2136         profile.ProfNB.GetPage(cl).list.SetFocus()
2137
2138     def OnCloseMe(self, evt) :
2139         self.Close(True)
2140
2141     def OnCloseWindow(self, evt):
2142         self.Destroy()
2143
2144 class SearchDial ( wx.Dialog ):
2145     
2146     def __init__( self, parent, listctrl, col, shown):
2147         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2148         self.parent = parent
2149         self.listctrl = listctrl
2150         self.col = col
2151         self.shown = shown
2152         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2153         
2154         bSizer1 = wx.BoxSizer( wx.VERTICAL )
2155         
2156         self.search = wx.SearchCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
2157         self.search.ShowSearchButton( True )
2158         self.search.ShowCancelButton( True )
2159         bSizer1.Add( self.search, 0, wx.ALL, 5 )
2160         sizer2 = wx.BoxSizer(wx.HORIZONTAL)
2161         self.backward = wx.Button(self, wx.ID_BACKWARD, u"Précédent")
2162         self.forward = wx.Button(self, wx.ID_FORWARD, u"Suivant")
2163         sizer2.Add(self.backward, 0, wx.ALL, 5)
2164         sizer2.Add(self.forward, 0, wx.ALL, 5)
2165         bSizer1.Add( sizer2, 0, wx.ALL, 5 )
2166
2167         self.SetSizer( bSizer1 )
2168         self.Layout()
2169         bSizer1.Fit( self )
2170         self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnSearch, self.search)
2171         self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel, self.search)
2172         self.Bind(wx.EVT_TEXT_ENTER, self.OnSearch, self.search)
2173         self.Bind(wx.EVT_BUTTON, self.onforward, self.forward)
2174         self.Bind(wx.EVT_BUTTON, self.onbackward, self.backward)
2175         self.search.SetFocus()
2176         self.forward.Enable(False)
2177         self.backward.Enable(False)
2178
2179         self.Centre( wx.BOTH )
2180     
2181     def __del__( self ):
2182         pass
2183
2184     def OnSearch(self, evt):
2185         UnSelectList(self.listctrl.list)
2186         search_word = self.search.GetValue()
2187         if search_word.strip() != '' :
2188             formes = [self.listctrl.getColumnText(i, self.col) for i in range(self.listctrl.list.GetItemCount())]
2189             if search_word.endswith(u'*') :
2190                 search_word = search_word[0:-1]
2191                 result = [j for j, forme in enumerate(formes) if forme.startswith(search_word)]
2192             else :
2193                 result = [j for j, forme in enumerate(formes) if forme == search_word]
2194             if result == [] :
2195                 self.noresult()
2196             elif self.shown == True :
2197                 self.showitems(result)
2198             else :
2199                 self.showresult(result)
2200         else :
2201             self.Destroy()
2202
2203     
2204     def showitems(self, items) :
2205         if len(items) == 1 :
2206             self.listctrl.list.SetItemState(items[0], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2207             self.listctrl.list.Focus(items[0])
2208             self.listctrl.list.SetFocus()
2209             self.Destroy()
2210         else :
2211             for i in items :
2212                 self.listctrl.list.SetItemState(i, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2213             self.listctrl.list.Focus(items[0])
2214             self.listctrl.list.SetFocus()
2215             self.forward.Enable(True)
2216             self.backward.Enable(False)
2217             self.items = items
2218             self.forwitem = 1
2219             self.backitem = -1
2220     
2221     def showresult(self, result) :
2222         toshow = [self.listctrl.itemDataMap[int(self.listctrl.getColumnText(i,0))] for i in result]
2223         proflist = [[[line[1], i+1, val] for i, val in enumerate(line[2:]) if val>=2] for line in toshow]
2224         #FIXME: intervenir en aval en virant les forme avec chi<2
2225         if proflist != [[]] :
2226             proflist = [val for line in proflist for val in line if line !=[]]
2227             nb = self.parent.parent.nb
2228             profile = nb.GetPage(nb.GetSelection())
2229             first_forme = proflist[0]
2230             cl = first_forme[1] - 1
2231             profile.ProfNB.SetSelection(cl)
2232             profile.ProfNB.GetPage(cl).list.SetFocus()
2233             UnSelectList(profile.ProfNB.GetPage(cl).list)
2234             datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).list.GetItemCount())])
2235             profile.ProfNB.GetPage(cl).list.SetItemState(datas[first_forme[0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2236             profile.ProfNB.GetPage(cl).list.Focus(datas[first_forme[0]])
2237             profile.ProfNB.GetPage(cl).list.SetFocus()
2238             if len(proflist) == 1 :
2239                 self.Destroy()
2240             else :
2241                 SearchResult = FindInCluster(self.parent.parent, -1, proflist)
2242                 SearchResult.Show()
2243                 self.Destroy()
2244         else :
2245             self.noresult()
2246
2247     def onforward(self, evt) :
2248         self.listctrl.list.Focus(self.items[self.forwitem])
2249         self.listctrl.list.SetFocus()
2250         self.forwitem += 1
2251         if self.forwitem == len(self.items) :
2252             self.forward.Enable(False)
2253             self.backward.Enable(True)
2254             self.backitem += 1
2255         else :
2256             self.backitem += 1
2257             self.backward.Enable(True)
2258
2259     def onbackward(self, evt) :
2260         self.listctrl.list.Focus(self.items[self.backitem])
2261         self.listctrl.list.SetFocus()
2262         self.backitem -= 1
2263         if self.backitem == -1 :
2264             self.forwitem -= 1
2265             self.forward.Enable(True)
2266             self.backward.Enable(False)
2267         else :
2268             self.forwitem -= 1
2269             self.forward.Enable(True)
2270
2271     def noresult(self) :
2272         msg = u"Forme absente"
2273         dial = wx.MessageDialog(self, 'Forme absente','Forme absente', wx.OK | wx.ICON_INFORMATION)
2274         dial.CenterOnParent()
2275         dial.ShowModal()
2276         dial.Destroy()
2277
2278     def OnCancel(self, evt) :
2279         self.search.Clear()
2280
2281 def UnSelectList(liste) :
2282     if liste.GetFirstSelected() != -1 :
2283         last = liste.GetFirstSelected()
2284         liste.Select(liste.GetFirstSelected(), False)
2285         while liste.GetNextSelected(last) != -1 :
2286              last = liste.GetNextSelected(last)
2287              liste.Select(liste.GetFirstSelected(),False)
2288
2289
2290 class OptLexi(wx.Dialog):
2291     def __init__(self, *args, **kwds):
2292         # begin wxGlade: MyDialog.__init__
2293         kwds["style"] = wx.DEFAULT_DIALOG_STYLE
2294         wx.Dialog.__init__(self, *args, **kwds)
2295         self.listet = None
2296         self.variables = None
2297         self.labellem =  wx.StaticText(self, -1, u"Lemmatisation : ")
2298         self.checklem = wx.CheckBox(self, -1)
2299         self.label_var =  wx.StaticText(self, -1, u"Sélection par :")
2300         self.choice = wx.Choice(self, -1, (100,50), choices = [u'variables', u'modalités'])
2301         self.label1 =  wx.StaticText(self, -1, u"Choix")
2302         self.list_box_1 = wx.ListBox(self, -1, choices=[],  size = wx.Size( 150,200 ), style=wx.LB_EXTENDED | wx.LB_HSCROLL)
2303         self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
2304         self.button_1 = wx.Button(self, wx.ID_OK, "")
2305         self.label_indice =  wx.StaticText(self, -1, u"indice")
2306         self.choice_indice =  wx.Choice(self, -1, (100,50), choices = [u'loi hypergéométique', u'chi2'])
2307         self.label = wx.StaticText(self, -1, u"effectif minimum")
2308         self.spin = wx.SpinCtrl(self, -1, min = 1, max = 10000)
2309         self.Bind(wx.EVT_CHOICE, self.onselect, self.choice)
2310         self.__set_properties()
2311         self.__do_layout()
2312         # end wxGlade
2313
2314     def __set_properties(self):
2315         # begin wxGlade: MyDialog.__set_properties
2316         self.SetTitle("Choix des variables")
2317         self.spin.SetValue(10)
2318         self.choice.SetSelection(0)
2319         #self.SetMinSize(wx.Size(300, 400))
2320         # end wxGlade
2321
2322     def __do_layout(self):
2323         # begin wxGlade: MyDialog.__do_layout
2324         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2325         sizer_2 = wx.FlexGridSizer(2,2,0,0)
2326         sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
2327         sizer_2.Add(self.labellem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2328         sizer_2.Add(self.checklem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2329         sizer_2.Add(self.label_var, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2330         sizer_2.Add(self.choice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2331         sizer_2.Add(self.label1, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2332         sizer_2.Add(self.list_box_1, 0, wx.ALIGN_RIGHT, 3)
2333         sizer_3.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2334         sizer_3.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2335         sizer_2.Add(self.label_indice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2336         sizer_2.Add(self.choice_indice, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2337         sizer_2.Add(self.label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2338         sizer_2.Add(self.spin, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
2339         sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 3)
2340         sizer_1.Add(sizer_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_RIGHT, 3)
2341         self.SetSizer(sizer_1)
2342         sizer_1.Fit(self)
2343         self.Layout()
2344         self.Centre()
2345
2346     def onselect(self, evt):
2347         self.list_box_1.Clear()
2348         if self.choice.GetSelection() == 0 :
2349             for var in self.variables :
2350                 self.list_box_1.Append(var)
2351         else :
2352             for et in self.listet :
2353                 self.list_box_1.Append(et)
2354
2355
2356 class PrefDendro ( wx.Dialog ):
2357     
2358     def __init__( self, parent, param ):
2359         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Dendrogramme", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2360         self.param = param
2361         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2362         
2363         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2364         fgSizer1.SetFlexibleDirection( wx.BOTH )
2365         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2366         
2367         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Taille de l'image", wx.DefaultPosition, wx.DefaultSize, 0 )
2368         self.m_staticText1.Wrap( -1 )
2369         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2370         
2371         bSizer2 = wx.BoxSizer( wx.VERTICAL )
2372         
2373         bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
2374         
2375         self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
2376         self.m_staticText2.Wrap( -1 )
2377         bSizer3.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2378         
2379         self.m_spinCtrl1 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
2380         bSizer3.Add( self.m_spinCtrl1, 0, wx.ALL, 5 )
2381         
2382         bSizer2.Add( bSizer3, 1, wx.EXPAND, 5 )
2383         
2384         bSizer31 = wx.BoxSizer( wx.HORIZONTAL )
2385         
2386         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
2387         self.m_staticText3.Wrap( -1 )
2388         bSizer31.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2389         
2390         self.m_spinCtrl2 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
2391         bSizer31.Add( self.m_spinCtrl2, 0, wx.ALL, 5 )
2392         
2393         bSizer2.Add( bSizer31, 1, wx.EXPAND, 5 )
2394         
2395         fgSizer1.Add( bSizer2, 1, wx.EXPAND, 5 )
2396         
2397         self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2398         fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
2399         
2400         self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2401         fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
2402         
2403         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Type de dendrogramme", wx.DefaultPosition, wx.DefaultSize, 0 )
2404         self.m_staticText4.Wrap( -1 )
2405         fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2406         
2407         m_choice1Choices = [ u"phylogram", u"cladogram", u"fan", u"unrooted", u"radial" ]
2408         self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice1Choices, 0 )
2409         self.m_choice1.SetSelection( 0 )
2410         fgSizer1.Add( self.m_choice1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2411         
2412         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2413         fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
2414         
2415         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2416         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
2417         
2418         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Couleur ou noir et blanc", wx.DefaultPosition, wx.DefaultSize, 0 )
2419         self.m_staticText5.Wrap( -1 )
2420         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2421         
2422         m_radioBox1Choices = [ u"couleur", u"noir et blanc" ]
2423         self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
2424         self.m_radioBox1.SetSelection( 0 )
2425         fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2426         
2427         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2428         fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
2429         
2430         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2431         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
2432         
2433         bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
2434         
2435         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Ajouter la taille des classes", wx.DefaultPosition, wx.DefaultSize, 0 )
2436         self.m_staticText6.Wrap( -1 )
2437         bSizer4.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2438         
2439         self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2440         self.m_checkBox1.SetValue(True) 
2441         bSizer4.Add( self.m_checkBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2442         
2443         fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
2444         
2445         m_radioBox2Choices = [ u"camemberts", u"barres" ]
2446         self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
2447         self.m_radioBox2.SetSelection( 0 )
2448         fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2449         
2450         self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2451         fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
2452         
2453         self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2454         fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
2455         
2456         
2457         fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
2458         
2459         m_sdbSizer2 = wx.StdDialogButtonSizer()
2460         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
2461         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
2462         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
2463         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
2464         m_sdbSizer2.Realize();
2465         fgSizer1.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
2466         
2467         self.__set_properties()
2468         self.SetSizer( fgSizer1 )
2469         self.Layout()
2470         fgSizer1.Fit( self )
2471         
2472         self.Centre( wx.BOTH )
2473
2474     def __set_properties(self):
2475         self.m_spinCtrl2.SetValue(self.param['width'])
2476         self.m_spinCtrl1.SetValue(self.param['height'])
2477         self.m_choice1.SetSelection(self.param['type_dendro'])
2478         self.m_radioBox1.SetSelection(self.param['color_nb'])
2479         self.m_checkBox1.SetValue(self.param['taille_classe'])
2480         self.m_radioBox2.SetSelection(self.param['type_tclasse'])
2481     
2482     def __del__( self ):
2483         pass
2484
2485
2486 class PrefWordCloud ( wx.Dialog ):
2487     
2488     def __init__( self, parent ):
2489         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Préférences wordcloud", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2490         
2491         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2492         
2493         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2494         fgSizer1.SetFlexibleDirection( wx.BOTH )
2495         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2496         
2497         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 )
2498         self.m_staticText1.Wrap( -1 )
2499         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2500         
2501         self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 )
2502         fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2503         
2504         self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2505         fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
2506         
2507         self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2508         fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
2509         
2510         bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
2511         
2512         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
2513         self.m_staticText3.Wrap( -1 )
2514         bSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2515         
2516         self.spin_H = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
2517         bSizer1.Add( self.spin_H, 0, wx.ALL, 5 )
2518         
2519         fgSizer1.Add( bSizer1, 1, wx.EXPAND, 5 )
2520         
2521         bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
2522         
2523         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
2524         self.m_staticText4.Wrap( -1 )
2525         bSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2526         
2527         self.spin_L = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
2528         bSizer3.Add( self.spin_L, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2529         
2530         fgSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
2531         
2532         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2533         fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
2534         
2535         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2536         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
2537         
2538         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Nombre maximum de formes", wx.DefaultPosition, wx.DefaultSize, 0 )
2539         self.m_staticText5.Wrap( -1 )
2540         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2541         
2542         self.spin_maxword = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10000, 600 )
2543         fgSizer1.Add( self.spin_maxword, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2544         
2545         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2546         fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
2547         
2548         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2549         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
2550         
2551         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
2552         self.m_staticText6.Wrap( -1 )
2553         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2554         
2555         bSizer4 = wx.BoxSizer( wx.VERTICAL )
2556         
2557         bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
2558         
2559         self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Min", wx.DefaultPosition, wx.DefaultSize, 0 )
2560         self.m_staticText7.Wrap( -1 )
2561         bSizer5.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2562         
2563         self.spin_mincex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 5 )
2564         bSizer5.Add( self.spin_mincex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2565         
2566         bSizer4.Add( bSizer5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2567         
2568         bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
2569         
2570         self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Max", wx.DefaultPosition, wx.DefaultSize, 0 )
2571         self.m_staticText8.Wrap( -1 )
2572         bSizer6.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2573         
2574         self.spin_maxcex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 50 )
2575         bSizer6.Add( self.spin_maxcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2576         
2577         bSizer4.Add( bSizer6, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2578         
2579         fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
2580         
2581         self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2582         fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
2583         
2584         self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2585         fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
2586         
2587         bSizer61 = wx.BoxSizer( wx.HORIZONTAL )
2588         
2589         self.m_staticText81 = wx.StaticText( self, wx.ID_ANY, u"Couleur du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
2590         self.m_staticText81.Wrap( -1 )
2591         bSizer61.Add( self.m_staticText81, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2592         
2593         self.color_text = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
2594         bSizer61.Add( self.color_text, 0, wx.ALL, 5 )
2595         
2596         fgSizer1.Add( bSizer61, 1, wx.EXPAND, 5 )
2597         
2598         bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
2599         
2600         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Couleur du fond", wx.DefaultPosition, wx.DefaultSize, 0 )
2601         self.m_staticText9.Wrap( -1 )
2602         bSizer7.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2603         
2604         self.color_bg = wx.ColourPickerCtrl( self, wx.ID_ANY, (255,255,255), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
2605         bSizer7.Add( self.color_bg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2606         
2607         fgSizer1.Add( bSizer7, 1, wx.EXPAND, 5 )
2608         
2609         self.m_staticline9 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2610         fgSizer1.Add( self.m_staticline9, 0, wx.EXPAND |wx.ALL, 5 )
2611         
2612         self.m_staticline10 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2613         fgSizer1.Add( self.m_staticline10, 0, wx.EXPAND |wx.ALL, 5 )
2614
2615         fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
2616         
2617         m_sdbSizer1 = wx.StdDialogButtonSizer()
2618         self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2619         m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2620         self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2621         m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2622         m_sdbSizer1.Realize();
2623         fgSizer1.Add( m_sdbSizer1, 1, wx.EXPAND, 5 )
2624         
2625         self.SetSizer( fgSizer1 )
2626         self.Layout()
2627         fgSizer1.Fit( self )
2628         
2629         self.Centre( wx.BOTH )
2630     
2631     def __del__( self ):
2632         pass
2633     
2634 class PrefChi(sc.SizedDialog):
2635     def __init__(self, parent, ID, optionchi, title):
2636
2637         sc.SizedDialog.__init__(self, None, -1, u"Paramètres", 
2638                         style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
2639         pane = self.GetContentsPane()
2640         pane.SetSizerType("form")
2641         pane.SetSizerProps(border=("all",5))
2642         self.parent = parent
2643         self.optionchi = optionchi
2644         
2645
2646         self.label_obs = wx.StaticText(pane, -1, u'valeurs observée')
2647         self.check1 = wx.CheckBox(pane, -1)
2648  
2649         self.label_theo = wx.StaticText(pane, -1, u'valeurs théoriques')
2650         self.check2 = wx.CheckBox(pane, -1)
2651
2652         self.label_resi = wx.StaticText(pane, -1, u'residuals')
2653         self.check3 = wx.CheckBox(pane, -1)
2654
2655         self.label_contrib = wx.StaticText(pane, -1, u'contributions a posteriori')
2656         self.check4 = wx.CheckBox(pane, -1)
2657 #        self.label_graph = wx.StaticText(pane, -1, u'graphique')
2658 #        self.check8 = wx.CheckBox(pane, -1)
2659         self.label_pourcent = wx.StaticText(pane, -1, u'pourcentage total')
2660         self.check5 = wx.CheckBox(pane, -1)
2661
2662         self.label_prl = wx.StaticText(pane, -1, u'pourcentages en ligne')
2663         self.check6 = wx.CheckBox(pane, -1)
2664
2665         self.label_prc = wx.StaticText(pane, -1, u'pourcentages en colonne')
2666         self.check7 = wx.CheckBox(pane, -1)
2667
2668         self.label_graph = wx.StaticText(pane, -1, u'graphique')
2669         self.check8 = wx.CheckBox(pane, -1)
2670         
2671         self.label_graphbw = wx.StaticText(pane, -1, u'graphique en noir et blanc')
2672         self.checkbw = wx.CheckBox(pane, -1)
2673
2674         self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL))
2675
2676         self.__set_properties()
2677         self.Fit()
2678         self.SetMinSize(self.GetSize())
2679
2680     def __set_properties(self):
2681         self.check1.SetValue(self.optionchi['valobs'])
2682         self.check2.SetValue(self.optionchi['valtheo'])
2683         self.check3.SetValue(self.optionchi['resi'])
2684         self.check4.SetValue(self.optionchi['contrib'])
2685         self.check5.SetValue(self.optionchi['pourcent'])
2686         self.check6.SetValue(self.optionchi['pourcentl'])
2687         self.check7.SetValue(self.optionchi['pourcentc'])
2688         self.check8.SetValue(self.optionchi['graph'])
2689         self.checkbw.SetValue(self.optionchi['bw'])
2690
2691 class ChiDialog(wx.Dialog):
2692     def __init__(
2693             self, parent, ID, title, optionchi, size=wx.DefaultSize, pos=wx.DefaultPosition, 
2694             style=wx.DEFAULT_DIALOG_STYLE
2695             ):
2696
2697         pre = wx.PreDialog()
2698         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
2699         pre.Create(parent, ID, title, pos, size, style)
2700
2701         self.PostCreate(pre)
2702         self.parent = parent 
2703         self.optionchi = optionchi
2704         self.chiopt = False
2705         #self.Filename=parent.filename
2706         #self.content=parent.content[:]
2707         self.headers=parent.tableau.get_colnames()
2708         LABELLIST=[]
2709         
2710         for i in self.headers:
2711             if len(i)>60 :
2712                 LABELLIST.append(i[0:60])
2713             else:
2714                 LABELLIST.append(i)
2715         
2716         self.ListOK=[]
2717         self.LabelListOK=LABELLIST
2718  
2719         self.list_box_1 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2720         self.list_box_2 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2721         self.button_1 = wx.Button(self, wx.ID_OK)
2722         self.button_cancel = wx.Button(self, wx.ID_CANCEL)
2723         self.button_pref = wx.Button(self, wx.ID_PREFERENCES)
2724         self.__set_properties()
2725         self.__do_layout()
2726
2727         self.Bind(wx.EVT_LISTBOX, self.Select1, self.list_box_1)
2728         self.Bind(wx.EVT_BUTTON, self.onparam, self.button_pref)
2729         # end wxGlade
2730 #-------------------------------
2731     def __set_properties(self):
2732         # begin wxGlade: ConfChi2.__set_properties
2733         self.SetTitle(u"Sélection des variables")
2734
2735     def __do_layout(self):
2736         # begin wxGlade: ConfChi2.__do_layout
2737         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2738         sizer_2 = wx.BoxSizer(wx.VERTICAL)
2739         sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
2740         sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
2741         sizer_3.Add(self.list_box_1, 0, wx.EXPAND, 0)
2742         sizer_3.Add(self.list_box_2, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 0)
2743         sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
2744         sizer_4.Add(self.button_cancel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2745         sizer_4.Add(self.button_pref, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2746         sizer_4.Add(self.button_1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2747         sizer_2.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
2748         sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
2749         self.SetSizer(sizer_1)
2750         sizer_1.Fit(self)
2751         self.Layout()
2752         # end wxGlade
2753
2754     def Select1(self, event): # wxGlade: ConfChi2.<event_handler>
2755         event.Skip()
2756     
2757     
2758     def onparam(self,event):
2759         self.dial = PrefChi(self.parent, -1, self.optionchi, '')
2760         self.dial.CenterOnParent()
2761         self.chiopt = self.dial.ShowModal()
2762
2763 class CorpusPref ( wx.Dialog ):
2764     
2765     def __init__( self, parent, parametres ):
2766         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 )
2767         self.parent = parent 
2768         langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)']
2769         self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese']
2770         self.encodages = encodages
2771         ucimark = [u'****', u'0000']
2772         ucemethod = [u'charactères', u'occurrences', u'paragraphe']
2773
2774         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2775         
2776         bSizer1 = wx.BoxSizer( wx.VERTICAL )
2777         
2778         self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
2779         self.m_panel1 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2780         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2781         fgSizer1.SetFlexibleDirection( wx.BOTH )
2782         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2783         
2784         self.m_staticText7 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Corpus", wx.DefaultPosition, wx.DefaultSize, 0 )
2785         self.m_staticText7.Wrap( -1 )
2786         fgSizer1.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2787         
2788         self.txtpath = wx.StaticText( self.m_panel1, wx.ID_ANY, u"path", wx.DefaultPosition, wx.DefaultSize, 0 )
2789         self.txtpath.Wrap( -1 )
2790         fgSizer1.Add( self.txtpath, 0, wx.ALL, 5 )
2791         
2792         self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Encodage", wx.DefaultPosition, wx.DefaultSize, 0 )
2793         self.m_staticText1.Wrap( -1 )
2794         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2795         
2796         encodage_choicesChoices = [' - '.join(encodage) for encodage in self.encodages]
2797         self.encodage_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, encodage_choicesChoices, 0 )
2798         self.encodage_choices.SetSelection( 0 )
2799         fgSizer1.Add( self.encodage_choices, 0, wx.ALL, 5 )
2800         
2801         self.m_staticText2 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Langue", wx.DefaultPosition, wx.DefaultSize, 0 )
2802         self.m_staticText2.Wrap( -1 )
2803         fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2804         
2805         lang_choicesChoices = langues_n
2806         self.lang_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, lang_choicesChoices, 0 )
2807         self.lang_choices.SetSelection( 0 )
2808         fgSizer1.Add( self.lang_choices, 0, wx.ALL, 5 )
2809
2810         self.m_staticText3 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Répertoire en sortie", wx.DefaultPosition, wx.DefaultSize, 0 )
2811         self.m_staticText3.Wrap( -1 )
2812         fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2813         
2814         
2815         fgSizer41 = wx.FlexGridSizer( 0, 2, 0, 0 )
2816         fgSizer41.SetFlexibleDirection( wx.BOTH )
2817         fgSizer41.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2818         
2819         self.repout_choices = wx.TextCtrl( self.m_panel1, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0 )
2820         self.repout_choices.SetMinSize( wx.Size( 400,-1 ) )
2821         fgSizer41.Add( self.repout_choices, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2822         
2823         self.m_button1 = wx.Button( self.m_panel1, wx.ID_ANY, u"Modifier...", wx.DefaultPosition, wx.DefaultSize, 0 )
2824         fgSizer41.Add( self.m_button1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2825         
2826         fgSizer1.Add( fgSizer41, 1, wx.EXPAND, 5 )        
2827
2828         self.m_staticText12 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Marqueur d'UCI", wx.DefaultPosition, wx.DefaultSize, 0 )
2829         self.m_staticText12.Wrap( -1 )
2830         fgSizer1.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2831         
2832         ucimark_choicesChoices = ucimark
2833         self.ucimark_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ucimark_choicesChoices, 0 )
2834         self.ucimark_choices.SetSelection( 0 )
2835         fgSizer1.Add( self.ucimark_choices, 0, wx.ALL, 5 )
2836         
2837         self.m_staticText6 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Utiliser le dictionnaire des expressions", wx.DefaultPosition, wx.DefaultSize, 0 )
2838         self.m_staticText6.Wrap( -1 )
2839         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2840         
2841         self.check_expressions = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2842         self.check_expressions.SetValue(True) 
2843         fgSizer1.Add( self.check_expressions, 0, wx.ALL, 5 )
2844         
2845         self.m_staticText9 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Construire des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2846         self.m_staticText9.Wrap( -1 )
2847         fgSizer1.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2848         
2849         self.check_makeuce = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2850         self.check_makeuce.SetValue(True) 
2851         fgSizer1.Add( self.check_makeuce, 0, wx.ALL, 5 )
2852         
2853         self.m_staticText10 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mode de construction des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2854         self.m_staticText10.Wrap( -1 )
2855         fgSizer1.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2856         
2857         uce_modeChoices = ucemethod
2858         self.uce_mode = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, uce_modeChoices, 0 )
2859         self.uce_mode.SetSelection( 0 )
2860         fgSizer1.Add( self.uce_mode, 0, wx.ALL, 5 )
2861         
2862         self.m_staticText13 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Taille des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2863         self.m_staticText13.Wrap( -1 )
2864         fgSizer1.Add( self.m_staticText13, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2865         
2866         self.uce_size = wx.SpinCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 1000000, 40 )
2867         fgSizer1.Add( self.uce_size, 0, wx.ALL, 5 )
2868         
2869         
2870         self.m_panel1.SetSizer( fgSizer1 )
2871         self.m_panel1.Layout()
2872         fgSizer1.Fit( self.m_panel1 )
2873         self.m_notebook1.AddPage( self.m_panel1, u"Générale", True )
2874         self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2875         fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
2876         fgSizer3.SetFlexibleDirection( wx.BOTH )
2877         fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2878         
2879         self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Passer le corpus en minuscule", wx.DefaultPosition, wx.DefaultSize, 0 )
2880         self.m_staticText4.Wrap( -1 )
2881         fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2882         
2883         self.check_lower = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2884         self.check_lower.SetValue(True) 
2885         fgSizer3.Add( self.check_lower, 0, wx.ALL, 5 )
2886         
2887         self.m_staticText5 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Retirez les caractères en dehors cette liste", wx.DefaultPosition, wx.DefaultSize, 0 )
2888         self.m_staticText5.Wrap( -1 )
2889         fgSizer3.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2890         
2891         fgSizer4 = wx.FlexGridSizer( 0, 2, 0, 0 )
2892         fgSizer4.SetFlexibleDirection( wx.BOTH )
2893         fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2894         
2895         self.check_charact = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2896         self.check_charact.SetValue(True) 
2897         fgSizer4.Add( self.check_charact, 0, wx.ALL, 5 )
2898         
2899         self.txt_charact = wx.TextCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2900         self.txt_charact.SetMinSize( wx.Size( 200,-1 ) )
2901         
2902         fgSizer4.Add( self.txt_charact, 0, wx.ALL|wx.EXPAND, 5 )
2903         
2904         
2905         fgSizer3.Add( fgSizer4, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2906         
2907         self.m_staticText14 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Remplacer les apostrophes par des espaces", wx.DefaultPosition, wx.DefaultSize, 0 )
2908         self.m_staticText14.Wrap( -1 )
2909         fgSizer3.Add( self.m_staticText14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2910         
2911         self.check_apos = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2912         self.check_apos.SetValue(True) 
2913         fgSizer3.Add( self.check_apos, 0, wx.ALL, 5 )
2914         
2915         self.m_staticText15 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Remplacer les tirets par des espaces", wx.DefaultPosition, wx.DefaultSize, 0 )
2916         self.m_staticText15.Wrap( -1 )
2917         fgSizer3.Add( self.m_staticText15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2918         
2919         self.check_tirets = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2920         self.check_tirets.SetValue(True) 
2921         fgSizer3.Add( self.check_tirets, 0, wx.ALL, 5 )
2922         
2923         self.m_staticText17 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Conserver la ponctuation", wx.DefaultPosition, wx.DefaultSize, 0 )
2924         self.m_staticText17.Wrap( -1 )
2925         fgSizer3.Add( self.m_staticText17, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2926         
2927         self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2928         fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 )
2929
2930         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 )
2931         self.m_staticText16.Wrap( -1 )
2932         fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2933         
2934         self.check_tolist = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2935         fgSizer3.Add( self.check_tolist, 0, wx.ALL, 5 )
2936         
2937         
2938         self.m_panel2.SetSizer( fgSizer3 )
2939         self.m_panel2.Layout()
2940         fgSizer3.Fit( self.m_panel2 )
2941         self.m_notebook1.AddPage( self.m_panel2, u"Nettoyage", False )
2942         
2943         bSizer1.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
2944         
2945         m_sdbSizer1 = wx.StdDialogButtonSizer()
2946         self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2947         m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2948         self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2949         m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2950         m_sdbSizer1.Realize();
2951         
2952         bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
2953        
2954
2955         self.Bind(wx.EVT_BUTTON, self.OnChangeDir, self.m_button1)
2956         self.setparametres(parametres) 
2957         self.SetSizer( bSizer1 )
2958         self.Layout()
2959         bSizer1.Fit( self )
2960         
2961         self.Centre( wx.BOTH )
2962
2963     def OnChangeDir(self, evt) :
2964         dlg = wx.DirDialog(self.parent, u"Choisissez un répertoire", style = wx.DD_DEFAULT_STYLE)
2965         if dlg.ShowModal() == wx.ID_OK :
2966             self.repout_choices.SetValue(dlg.GetPath())
2967     
2968     def __del__( self ):
2969         pass
2970
2971     def setparametres(self, parametres) :
2972         self.encodage_choices.SetSelection(0)
2973         self.lang_choices.SetSelection(0)
2974         self.repout_choices.SetValue(parametres['pathout'])
2975         self.ucimark_choices.SetSelection(parametres['ucimark'])
2976         self.check_expressions.SetValue(parametres['expressions'])
2977         self.check_makeuce.SetValue(parametres['douce'])
2978         self.uce_mode.SetSelection(parametres['ucemethod'])
2979         self.uce_size.SetValue(parametres['ucesize'])
2980         self.check_lower.SetValue(parametres['lower'])
2981         #self.check_charact.SetValue(parametres['charact'])
2982         self.txt_charact.SetValue(parametres['keep_caract'])
2983         self.check_apos.SetValue(parametres['apos'])
2984         self.check_tirets.SetValue(parametres['tiret'])
2985         self.check_tolist.SetValue(parametres['tolist'])
2986         self.check_ponct.SetValue(parametres['keep_ponct'])
2987
2988     def doparametres(self) :
2989         parametres = {}
2990         parametres['encoding'] = self.encodages[self.encodage_choices.GetSelection()][0]
2991         parametres['lang'] = self.langues[self.lang_choices.GetSelection()]
2992         parametres['pathout'] = self.repout_choices.GetValue()
2993         parametres['ucimark'] = self.ucimark_choices.GetSelection()
2994         parametres['expressions'] = self.check_expressions.GetValue()
2995         parametres['douce'] =  self.check_makeuce.GetValue()
2996         parametres['ucemethod'] = self.uce_mode.GetSelection()
2997         parametres['ucesize'] = self.uce_size.GetValue()
2998         parametres['lower'] = self.check_lower.GetValue()
2999         parametres['charact'] = self.check_charact.GetValue()
3000         parametres['keep_caract'] = self.txt_charact.GetValue()
3001         parametres['apos'] = self.check_apos.GetValue()
3002         parametres['tiret'] = self.check_tirets.GetValue()
3003         parametres['tolist'] = self.check_tolist.GetValue()
3004         parametres['keep_ponct'] = self.check_ponct.GetValue()
3005         for val in parametres :
3006             if isinstance(parametres[val], bool) :
3007                 if parametres[val] :
3008                     parametres[val] = 1
3009                 else :
3010                     parametres[val] = 0
3011         return parametres