AFC
[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'Western Europe'], [u'utf-8',u'all languages'], [u'MacRoman',u'Western Europe'], [u'ascii', u'English'], [u'big5', u'Traditional Chinese'], [u'big5hkscs', u'Traditional Chinese'], [u'cp037', u'English'], [u'cp424', u'Hebrew'], [u'cp437', u'English'], [u'cp500', u'Western Europe'], [u'cp737', u'Greek'], [u'cp775', u'Baltic languages'], [u'cp850', u'Western Europe'], [u'cp852', u'Central and Eastern Europe'], [u'cp855', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp856', u'Hebrew'], [u'cp857', u'Turkish'], [u'cp860', u'Portuguese'], [u'cp861', u'Icelandic'], [u'cp862', u'Hebrew'], [u'cp863', u'Canadian'], [u'cp864', u'Arabic'], [u'cp865', u'Danish, Norwegian'], [u'cp866', u'Russian'], [u'cp869', u'Greek'], [u'cp874', u'Thai'], [u'cp875', u'Greek'], [u'cp932', u'Japanese'], [u'cp949', u'Korean'], [u'cp950', u'Traditional Chinese'], [u'cp1006', u'Urdu'], [u'cp1026', u'Turkish'], [u'cp1140', u'Western Europe'], [u'cp1250', u'Central and Eastern Europe'], [u'cp1251', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'cp1253', u'Greek'], [u'cp1254', u'Turkish'], [u'cp1255', u'Hebrew'], [u'cp1256', u'Arabic'], [u'cp1257', u'Baltic languages'], [u'cp1258', u'Vietnamese'], [u'euc_jp', u'Japanese'], [u'euc_jis_2004', u'Japanese'], [u'euc_jisx0213', u'Japanese'], [u'euc_kr', u'Korean'], [u'gb2312', u'Simplified Chinese'], [u'gbk', u'Unified Chinese'], [u'gb18030', u'Unified Chinese'], [u'hz', u'Simplified Chinese'], [u'iso2022_jp', u'Japanese'], [u'iso2022_jp_1', u'Japanese'], [u'iso2022_jp_2', u'Jp, K, S C, WE, G'], [u'iso2022_jp_2004', u'Japanese'], [u'iso2022_jp_3', u'Japanese'], [u'iso2022_jp_ext', u'Japanese'], [u'iso2022_kr', u'Korean'], [u'latin_1', u'West Europe'], [u'iso8859_2', u'Central and Eastern Europe'], [u'iso8859_3', u'Esperanto, Maltese'], [u'iso8859_4', u'Baltic languages'], [u'iso8859_5', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'iso8859_6', u'Arabic'], [u'iso8859_7', u'Greek'], [u'iso8859_8', u'Hebrew'], [u'iso8859_9', u'Turkish'], [u'iso8859_10', u'Nordic languages'], [u'iso8859_13', u'Baltic languages'], [u'iso8859_14', u'Celtic languages'], [u'iso8859_15', u'Western Europe'], [u'iso8859_16', u'South-Eastern Europe'], [u'johab', u'Korean'], [u'koi8_r', u'Russian'], [u'koi8_u', u'Ukrainian'], [u'mac_cyrillic', u'Bulg, Byelorus, Mace, Rus, Serb'], [u'mac_greek', u'Greek'], [u'mac_iceland', u'Icelandic'], [u'mac_latin2', u'Central and Eastern Europe'], [u'mac_turkish', u'Turkish'], [u'ptcp154', u'Kazakh'], [u'shift_jis', u'Japanese'], [u'shift_jis_2004', u'Japanese'], [u'shift_jisx0213', u'Japanese'], [u'utf_32', u'all languages'], [u'utf_32_be', u'all languages'], [u'utf_32_le', u'all languages'], [u'utf_16', u'all languages'], [u'utf_16_be', u'all languages (BMP only)'], [u'utf_16_le', u'all languages (BMP only)'], [u'utf_7', u'all languages'], [u'utf_8_sig', u'all languages']]
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"""Prendre les x premiers points par classe"""
593         self.label_chic = wx.StaticText(self, -1, txt)
594         self.check_chic = wx.CheckBox(self, -1)
595         self.spin_nbchic = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)        
596         txt = u"""Limiter le nombre de points 
597 par le chi2 de liaison aux classes"""
598         self.label_5 = wx.StaticText(self, -1, txt)
599         self.check2 = wx.CheckBox(self, -1)
600         self.spin_chi = wx.SpinCtrl(self, -1, '',size = (100,30),  min=2, max=1000)
601         self.label_6 = wx.StaticText(self, -1, u'Eliminer les recouvrements')
602         self.check3 = wx.CheckBox(self, -1)
603         txt = u"""Taille du texte proportionnel
604 à la masse de la forme"""
605         self.label_7 = wx.StaticText(self, -1, txt)
606         self.check4 = wx.CheckBox(self, -1)
607         self.label_min = wx.StaticText(self, -1, 'min')
608         self.spin_min = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
609         self.label_max = wx.StaticText(self, -1, 'max')
610         self.spin_max = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
611         txt = u"""Taille du texte proportionnel
612 au chi2 d'association de la forme"""
613         self.label_tchi = wx.StaticText(self, -1, txt)
614         self.check_tchi = wx.CheckBox(self, -1)
615         self.label_min_tchi = wx.StaticText(self, -1, 'min')
616         self.spin_min_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
617         self.label_max_tchi = wx.StaticText(self, -1, 'max')
618         self.spin_max_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
619         self.label_8 = wx.StaticText(self, -1, 'Facteur x :')
620         self.spin_f1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
621         self.label_9 = wx.StaticText(self, -1, 'Facteur y :')
622         self.spin_f2 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
623         self.label_f3 = wx.StaticText(self, -1, 'Facteur z :')
624         self.spin_f3 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
625         self.label_sphere = wx.StaticText(self, -1, u"Transparence des sphères")
626         self.slider_sphere = wx.Slider(self, -1, 10, 1, 100, size = (255,-1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
627
628         self.label_film = wx.StaticText(self, -1, 'Faire un film')
629         self.film = wx.CheckBox(self, -1)
630                
631         self.btnsizer = wx.StdDialogButtonSizer()
632         if wx.Platform != "__WXMSW__":
633             btn = wx.ContextHelpButton(self)
634             self.btnsizer.AddButton(btn)
635         btn = wx.Button(self, wx.ID_OK)
636         btn.SetHelpText("Ok")
637         btn.SetDefault()
638         self.btnsizer.AddButton(btn)
639         btn = wx.Button(self, wx.ID_CANCEL)
640         btn.SetHelpText("Annuler")
641         self.btnsizer.AddButton(btn)
642         self.btnsizer.Realize()
643         
644         self.Bind(wx.EVT_CHECKBOX, self.OnCheck1, self.check1)
645         self.Bind(wx.EVT_CHECKBOX, self.OnCheck2, self.check2)
646         self.Bind(wx.EVT_CHECKBOX, self.OnNorm, self.check4)
647         self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi)
648         self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype)
649         self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2)
650         self.Bind(wx.EVT_CHECKBOX, self.OnCheckChic, self.check_chic)
651         self.__set_properties()
652         self.OnNorm(wx.EVT_CHECKBOX)
653         self.OnCheckTchi(wx.EVT_CHECKBOX)
654         self.__do_layout()
655
656     def __set_properties(self):
657         self.choicetype.SetSelection(self.paramgraph['typegraph'])
658         if self.paramgraph['typegraph'] == 0 :
659             self.film.Enable(False)
660             self.spin_f3.Enable(False)
661             self.slider_sphere.Enable(False)
662         self.choice1.SetSelection(self.paramgraph['what'])
663         self.choice2.SetSelection(self.paramgraph['qui'])
664         self.spin_chi.SetValue(self.paramgraph['select_nb'])
665         self.spin_nb.SetValue(self.paramgraph['select_chi'])
666         self.spin1.SetValue(self.paramgraph['width'])
667         self.spin2.SetValue(self.paramgraph['height'])
668         self.spin3.SetValue(self.paramgraph['taillecar'])
669         self.spin_nb.SetValue(self.paramgraph['select_nb'])
670         self.spin_chi.SetValue(self.paramgraph['select_chi'])
671         self.spin_nbchic.SetValue(self.paramgraph['nbchic'])
672         self.check1.SetValue(self.paramgraph['do_select_nb'])
673         self.check2.SetValue(self.paramgraph['do_select_chi'])
674         self.check_chic.SetValue(self.paramgraph['do_select_chi_classe'])
675         self.check3.SetValue(self.paramgraph['over'])
676         if self.paramgraph['do_select_nb'] :
677             self.spin_nb.Enable(True)
678             self.spin_chi.Enable(False)
679             self.spin_nbchic.Enable(False)
680         elif self.paramgraph['do_select_chi_classe'] :
681             self.spin_nb.Enable(False)
682             self.spin_chi.Enable(False)
683             self.spin_nbchic.Enable(True)
684         elif self.paramgraph['do_select_chi'] :
685             self.spin_nb.Enable(False)
686             self.spin_chi.Enable(True)
687             self.spin_nbchic.Enable(False)
688         else :
689             self.spin_nb.Enable(False)
690             self.spin_chi.Enable(False)
691             self.spin_nbchic.Enable(False)
692
693             
694         self.check4.SetValue(self.paramgraph['cex_txt'])
695         self.spin_min.SetValue(self.paramgraph['txt_min'])
696         self.spin_max.SetValue(self.paramgraph['txt_max'])
697         self.check_tchi.SetValue(self.paramgraph['tchi'])
698         self.spin_min_tchi.SetValue(self.paramgraph['tchi_min'])
699         self.spin_max_tchi.SetValue(self.paramgraph['tchi_max'])
700
701         self.spin_f1.SetValue(self.paramgraph['facteur'][0])
702         self.spin_f2.SetValue(self.paramgraph['facteur'][1])
703         self.spin_f3.SetValue(self.paramgraph['facteur'][2])
704         self.slider_sphere.SetValue(self.paramgraph['alpha'])
705
706     def __do_layout(self):
707         sizer_2 = wx.BoxSizer(wx.VERTICAL)
708         fsizer = wx.FlexGridSizer(12,2,0,5)
709         grid_min = wx.FlexGridSizer(1, 2, 0, 0)
710         grid_max = wx.FlexGridSizer(1, 2, 0, 0)
711         grid_minmax = wx.FlexGridSizer(1, 2, 0, 0)
712         grid_min_tchi = wx.FlexGridSizer(1, 2, 0, 0)
713         grid_max_tchi = wx.FlexGridSizer(1, 2, 0, 0)
714         grid_minmax_tchi = wx.FlexGridSizer(1, 2, 0, 0)
715
716         sizer_3 = wx.BoxSizer(wx.VERTICAL)
717         
718         fsizer.Add(self.labeltype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
719         fsizer.Add(self.choicetype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
720         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
721         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
722
723         fsizer.Add(self.label_what, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
724         fsizer.Add(self.choice1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
725         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
726         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
727         
728         fsizer.Add(self.label_qui, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
729         fsizer.Add(self.choice2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
730         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
731         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)              
732         
733         sizer_h1 = wx.BoxSizer(wx.HORIZONTAL)
734         sizer_h1.Add(self.label_1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
735         sizer_h1.Add(self.spin1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
736         fsizer.Add(sizer_h1, 0, wx.ALL, 5)
737         sizer_h2 = wx.BoxSizer(wx.HORIZONTAL)
738         sizer_h2.Add(self.label_2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
739         sizer_h2.Add(self.spin2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
740         fsizer.Add(sizer_h2, 0, wx.ALL, 5)
741         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
742         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
743         
744         fsizer.Add(self.label_3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
745         fsizer.Add(self.spin3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)        
746         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
747         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
748         
749         fsizer.Add(self.label_4, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
750         sizer_nb = wx.BoxSizer(wx.HORIZONTAL)
751         sizer_nb.Add(self.check1, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
752         sizer_nb.Add(self.spin_nb, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
753         fsizer.Add(sizer_nb, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
754         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
755         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
756         
757         fsizer.Add(self.label_chic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
758         sizer_nbchic = wx.BoxSizer(wx.HORIZONTAL)
759         sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
760         sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
761         fsizer.Add(sizer_nbchic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
762         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
763         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
764
765         fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
766         sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
767         sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
768         sizer_chi.Add(self.spin_chi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
769         fsizer.Add(sizer_chi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
770         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
771         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
772         
773         fsizer.Add(self.label_6, 0,  wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL| wx.ADJUST_MINSIZE, 5)
774         fsizer.Add(self.check3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
775         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
776         fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
777         
778         sizer_2.Add(fsizer, 0, wx.EXPAND, 0)
779         
780         bsizer_1 = wx.FlexGridSizer(3,3,0,0)
781         bsizer_1.Add(self.label_7, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
782         bsizer_1.Add(self.check4, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
783         grid_min.Add(self.label_min, 0,wx.ALL |  wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
784         grid_min.Add(self.spin_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
785         grid_max.Add(self.label_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
786         grid_max.Add(self.spin_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
787         grid_minmax.Add(grid_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
788         grid_minmax.Add(grid_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
789
790         bsizer_1.Add(grid_minmax, 0, wx.ALL, 5)
791
792         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
793         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
794         bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)        
795
796         bsizer_1.Add(self.label_tchi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
797         bsizer_1.Add(self.check_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
798         grid_min_tchi.Add(self.label_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
799         grid_min_tchi.Add(self.spin_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
800         grid_max_tchi.Add(self.label_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
801         grid_max_tchi.Add(self.spin_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
802         grid_minmax_tchi.Add(grid_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
803         grid_minmax_tchi.Add(grid_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
804         
805         bsizer_1.Add(grid_minmax_tchi, 0,  wx.ALL, 5)
806         sizer_2.Add(bsizer_1, 0, wx.EXPAND, 5)
807         
808         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0) 
809         
810         sizer_f = wx.BoxSizer(wx.HORIZONTAL)
811         sizer_f.Add(self.label_8, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
812         sizer_f.Add(self.spin_f1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
813         
814         sizer_f.Add(self.label_9, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
815         sizer_f.Add(self.spin_f2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
816
817         sizer_f.Add(self.label_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
818         sizer_f.Add(self.spin_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
819         sizer_2.Add(sizer_f, 0, wx.EXPAND, 5)
820         
821         sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 5)
822         
823         fsizer2 = wx.FlexGridSizer(2,2,0,0)
824         fsizer2.Add(self.label_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
825         fsizer2.Add(self.slider_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
826         fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
827         fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
828
829         fsizer2.Add(self.label_film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
830         fsizer2.Add(self.film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
831         sizer_2.Add(fsizer2, 0, wx.EXPAND, 5)
832         sizer_2.Add(self.btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
833         self.SetSizer(sizer_2)
834         sizer_2.Fit(self)
835         self.Layout()
836         
837     def OnCheck1(self, event):
838         if self.check1.GetValue() :
839             self.check2.SetValue(False)
840             self.check_chic.SetValue(False)
841             self.spin_chi.Enable(False)
842             self.spin_nb.Enable(True)
843             self.spin_nbchic.Enable(False)
844         else : 
845             self.spin_nb.Enable(False)
846             
847     def OnCheck2(self, event):
848         if self.check2.GetValue() :
849             self.check1.SetValue(False)
850             self.check_chic.SetValue(False)
851             self.spin_chi.Enable(True)
852             self.spin_nb.Enable(False)
853             self.spin_nbchic.Enable(False)
854         else :
855            self.spin_chi.Enable(False) 
856
857     def OnCheckChic(self, event) :
858         if self.check_chic.GetValue() :
859             self.check1.SetValue(False)
860             self.check2.SetValue(False)
861             self.spin_chi.Enable(False)
862             self.spin_nb.Enable(False)
863             self.spin_nbchic.Enable(True)
864         else :
865             self.spin_nbchic.Enable(False)
866
867     def OnNorm(self, event):
868         if not self.check4.GetValue() :
869             self.spin_min.Disable()
870             self.spin_max.Disable()
871         else :
872             self.spin_min.Enable(True)
873             self.spin_max.Enable(True)
874             self.check_tchi.SetValue(False)
875             self.OnCheckTchi(wx.EVT_CHECKBOX)
876
877     def OnCheckTchi(self, evt) :
878         if not self.check_tchi.GetValue() :
879             self.spin_min_tchi.Disable()
880             self.spin_max_tchi.Disable()
881         else :
882             self.spin_min_tchi.Enable(True)
883             self.spin_max_tchi.Enable(True)
884             self.check4.SetValue(False)
885             self.OnNorm(wx.EVT_CHECKBOX)
886
887     def On3D(self, event) :
888         if event.GetString() == u'3D' :
889             self.film.Enable(True)
890             self.spin_f3.Enable(True)
891             self.slider_sphere.Enable(True)
892         else :
893             self.film.Enable(False)
894             self.spin_f3.Enable(False)
895             self.slider_sphere.Enable(False)
896     
897     def OnPass(self,evt) :
898         if evt.GetString() != u'actives' :
899             self.check4.SetValue(False)
900             self.check4.Enable(False)
901             self.OnNorm(wx.EVT_CHECKBOX)
902         else :
903             self.check4.Enable()
904             
905 class PrefSimi ( wx.Dialog ):
906     
907     def __init__( self, parent, ID, paramsimi, indices ):
908         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 )
909         self.parent = parent
910         self.paramsimi=paramsimi
911         self.indices = indices
912
913         
914         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
915         
916         fgSizer5 = wx.FlexGridSizer( 0, 3, 0, 0 )
917         fgSizer5.SetFlexibleDirection( wx.BOTH )
918         fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
919         
920         fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
921         fgSizer3.SetFlexibleDirection( wx.BOTH )
922         fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
923         
924         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les colonnes", wx.DefaultPosition, wx.DefaultSize, 0 )
925         self.m_staticText1.Wrap( -1 )
926         fgSizer3.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
927         
928         self.check_colch = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
929         fgSizer3.Add( self.check_colch, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
930         
931         self.m_staticline29 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
932         fgSizer3.Add( self.m_staticline29, 0, wx.EXPAND, 5 )
933         
934         self.m_staticline291 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
935         fgSizer3.Add( self.m_staticline291, 0, wx.EXPAND, 5 )
936         if not self.paramsimi['first'] :
937  
938             self.m_staticText271 = wx.StaticText( self, wx.ID_ANY, u"Utiliser les coordonnées\nprécédentes", wx.DefaultPosition, wx.DefaultSize, 0 )
939             self.m_staticText271.Wrap( -1 )
940             fgSizer3.Add( self.m_staticText271, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
941         
942             self.check_coord = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
943             fgSizer3.Add( self.check_coord, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
944         
945             self.m_staticline36 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
946             fgSizer3.Add( self.m_staticline36, 0, wx.EXPAND, 5 )
947         
948             self.m_staticline37 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
949             fgSizer3.Add( self.m_staticline37, 0, wx.EXPAND, 5 )
950         
951         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Indice", wx.DefaultPosition, wx.DefaultSize, 0 )
952         self.m_staticText3.Wrap( -1 )
953         fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
954         
955         choice1Choices = []
956         self.choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.indices, 0 )
957         self.choice1.SetSelection( 0 )
958         fgSizer3.Add( self.choice1, 0, wx.ALL, 5 )
959         
960         self.m_staticline293 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
961         fgSizer3.Add( self.m_staticline293, 0, wx.EXPAND, 5 )
962         
963         self.m_staticline292 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
964         fgSizer3.Add( self.m_staticline292, 0, wx.EXPAND, 5 )
965         
966         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Layout", wx.DefaultPosition, wx.DefaultSize, 0 )
967         self.m_staticText4.Wrap( -1 )
968         fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
969         
970         choice2Choices = [u"random", u"cercle", u"fruchterman reingold", u"kamada kawai", u"graphopt"]
971         self.choice2 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice2Choices, 0 )
972         self.choice2.SetSelection( 0 )
973         fgSizer3.Add( self.choice2, 0, wx.ALL, 5 )
974         
975         self.m_staticline294 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
976         fgSizer3.Add( self.m_staticline294, 0, wx.EXPAND, 5 )
977         
978         self.m_staticline295 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
979         fgSizer3.Add( self.m_staticline295, 0, wx.EXPAND, 5 )
980         
981         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Type de graph", wx.DefaultPosition, wx.DefaultSize, 0 )
982         self.m_staticText5.Wrap( -1 )
983         fgSizer3.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
984         
985         choice3Choices = [u"dynamique", u"statique", u"3D"]
986         self.choice3 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice3Choices, 0 )
987         self.choice3.SetSelection( 0 )
988         fgSizer3.Add( self.choice3, 0, wx.ALL, 5 )
989         
990         self.m_staticline296 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
991         fgSizer3.Add( self.m_staticline296, 0, wx.EXPAND, 5 )
992         
993         self.m_staticline297 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
994         fgSizer3.Add( self.m_staticline297, 0, wx.EXPAND, 5 )
995         
996         self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Arbre maximum", wx.DefaultPosition, wx.DefaultSize, 0 )
997         self.m_staticText8.Wrap( -1 )
998         fgSizer3.Add( self.m_staticText8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
999         
1000         self.check1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1001         fgSizer3.Add( self.check1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1002         
1003         self.m_staticline298 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1004         fgSizer3.Add( self.m_staticline298, 0, wx.EXPAND, 5 )
1005         
1006         self.m_staticline299 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1007         fgSizer3.Add( self.m_staticline299, 0, wx.EXPAND, 5 )
1008         
1009         self.m_staticText91 = wx.StaticText( self, wx.ID_ANY, u"Graph à seuil", wx.DefaultPosition, wx.DefaultSize, 0 )
1010         self.m_staticText91.Wrap( -1 )
1011         fgSizer3.Add( self.m_staticText91, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1012         
1013         bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
1014         
1015         self.check_seuil = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1016         bSizer21.Add( self.check_seuil, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1017         
1018         self.spin_seuil = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 10000, 1 )
1019         bSizer21.Add( self.spin_seuil, 0, wx.ALL, 5 )
1020         
1021         fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
1022         
1023         self.m_staticline2910 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1024         fgSizer3.Add( self.m_staticline2910, 0, wx.EXPAND, 5 )
1025         
1026         self.m_staticline2911 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1027         fgSizer3.Add( self.m_staticline2911, 0, wx.EXPAND, 5 )
1028         
1029         self.m_staticText19 = wx.StaticText( self, wx.ID_ANY, u"Texte sur les sommets", wx.DefaultPosition, wx.DefaultSize, 0 )
1030         self.m_staticText19.Wrap( -1 )
1031         fgSizer3.Add( self.m_staticText19, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1032         
1033         self.check_vlab = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1034         fgSizer3.Add( self.check_vlab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1035         
1036         self.m_staticline2912 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1037         fgSizer3.Add( self.m_staticline2912, 0, wx.EXPAND, 5 )
1038         
1039         self.m_staticline2913 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1040         fgSizer3.Add( self.m_staticline2913, 0, wx.EXPAND, 5 )
1041         
1042         self.m_staticText20 = wx.StaticText( self, wx.ID_ANY, u"Indices sur les arêtes", wx.DefaultPosition, wx.DefaultSize, 0 )
1043         self.m_staticText20.Wrap( -1 )
1044         fgSizer3.Add( self.m_staticText20, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1045         
1046         self.check_elab = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1047         fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1048         
1049         self.m_staticline2914 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1050         fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
1051         
1052         self.m_staticline2915 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1053         fgSizer3.Add( self.m_staticline2915, 0, wx.EXPAND, 5 )
1054         
1055         self.m_staticText27 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
1056         self.m_staticText27.Wrap( -1 )
1057         fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1058         
1059         self.spin_cex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
1060         fgSizer3.Add( self.spin_cex, 0, wx.ALL, 5 )
1061         
1062         self.m_staticline2916 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1063         fgSizer3.Add( self.m_staticline2916, 0, wx.EXPAND, 5 )
1064         
1065         self.m_staticline2917 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1066         fgSizer3.Add( self.m_staticline2917, 0, wx.EXPAND, 5 )
1067         
1068         if 'bystar' in self.paramsimi :
1069             self.m_staticText40 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner une variable", wx.DefaultPosition, wx.DefaultSize, 0 )
1070             self.m_staticText40.Wrap( -1 )
1071             fgSizer3.Add( self.m_staticText40, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1072             
1073             self.check_bystar = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1074             fgSizer3.Add( self.check_bystar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1075             
1076             self.m_staticline3200 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1077             fgSizer3.Add( self.m_staticline3200, 0, wx.EXPAND, 5 )
1078             self.m_staticline3201 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1079             fgSizer3.Add( self.m_staticline3201, 0, wx.EXPAND, 5 )
1080
1081         fgSizer5.Add( fgSizer3, 1, wx.EXPAND, 5 )
1082         
1083         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_VERTICAL )
1084         self.m_staticline5.SetForegroundColour( wx.Colour( 0, 0, 0 ) )
1085         
1086         fgSizer5.Add( self.m_staticline5, 0, wx.EXPAND|wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 5 )
1087         
1088         fgSizer51 = wx.FlexGridSizer( 0, 2, 0, 0 )
1089         fgSizer51.SetFlexibleDirection( wx.BOTH )
1090         fgSizer51.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1091         
1092         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du graphique", wx.DefaultPosition, wx.DefaultSize, 0 )
1093         self.m_staticText6.Wrap( -1 )
1094         fgSizer51.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1095         
1096         fgSizer31 = wx.FlexGridSizer( 0, 2, 0, 0 )
1097         fgSizer31.SetFlexibleDirection( wx.BOTH )
1098         fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1099         
1100         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
1101         self.m_staticText9.Wrap( -1 )
1102         fgSizer31.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1103         
1104         self.spin_height = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
1105         fgSizer31.Add( self.spin_height, 0, wx.ALL, 5 )
1106         
1107         self.m_staticText10 = wx.StaticText( self, wx.ID_ANY, u"largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
1108         self.m_staticText10.Wrap( -1 )
1109         fgSizer31.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1110         
1111         self.spin_width = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
1112         fgSizer31.Add( self.spin_width, 0, wx.ALL, 5 )
1113         
1114         fgSizer51.Add( fgSizer31, 1, wx.EXPAND, 5 )
1115         
1116         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1117         fgSizer51.Add( self.m_staticline3, 0, wx.EXPAND, 5 )
1118         
1119         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1120         fgSizer51.Add( self.m_staticline4, 0, wx.EXPAND, 5 )
1121         
1122         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 )
1123         self.m_staticText101.Wrap( -1 )
1124         fgSizer51.Add( self.m_staticText101, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1125         
1126         bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
1127         
1128         bSizer9 = wx.BoxSizer( wx.VERTICAL )
1129         
1130         self.check2 = wx.CheckBox( self, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
1131         bSizer9.Add( self.check2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1132         
1133         if 'sfromchi' in self.paramsimi :
1134             self.checki = wx.CheckBox( self, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
1135             bSizer9.Add( self.checki, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1136         
1137         bSizer7.Add( bSizer9, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
1138         
1139         fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 )
1140         fgSizer7.SetFlexibleDirection( wx.BOTH )
1141         fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1142         
1143         self.m_staticText11 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1144         self.m_staticText11.Wrap( -1 )
1145         fgSizer7.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1146         
1147         self.spin_tvmin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1148         fgSizer7.Add( self.spin_tvmin, 0, wx.ALL, 5 )
1149         
1150         self.m_staticText12 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1151         self.m_staticText12.Wrap( -1 )
1152         fgSizer7.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1153         
1154         self.spin_tvmax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1155         fgSizer7.Add( self.spin_tvmax, 0, wx.ALL, 5 )
1156         
1157         bSizer7.Add( fgSizer7, 1, wx.EXPAND, 5 )
1158         
1159         fgSizer51.Add( bSizer7, 1, wx.EXPAND, 5 )
1160         
1161         self.m_staticline31 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1162         fgSizer51.Add( self.m_staticline31, 0, wx.EXPAND, 5 )
1163         
1164         self.m_staticline32 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1165         fgSizer51.Add( self.m_staticline32, 0, wx.EXPAND, 5 )
1166         
1167         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 )
1168         self.m_staticText1011.Wrap( -1 )
1169         fgSizer51.Add( self.m_staticText1011, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1170         
1171         bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
1172         
1173         bSizer8 = wx.BoxSizer( wx.VERTICAL )
1174         
1175         self.check_vcex = wx.CheckBox( self, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
1176         bSizer8.Add( self.check_vcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1177         if 'cexfromchi' in self.paramsimi :
1178         
1179             self.checkit = wx.CheckBox( self, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
1180             bSizer8.Add( self.checkit, 0, wx.ALL, 5 )
1181         
1182         bSizer71.Add( bSizer8, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
1183         
1184         fgSizer71 = wx.FlexGridSizer( 0, 2, 0, 0 )
1185         fgSizer71.SetFlexibleDirection( wx.BOTH )
1186         fgSizer71.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1187         
1188         self.m_staticText111 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1189         self.m_staticText111.Wrap( -1 )
1190         fgSizer71.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1191         
1192         self.spin_vcexmin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1193         fgSizer71.Add( self.spin_vcexmin, 0, wx.ALL, 5 )
1194         
1195         self.m_staticText121 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1196         self.m_staticText121.Wrap( -1 )
1197         fgSizer71.Add( self.m_staticText121, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1198         
1199         self.spin_vcexmax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1200         fgSizer71.Add( self.spin_vcexmax, 0, wx.ALL, 5 )
1201         
1202         bSizer71.Add( fgSizer71, 1, wx.EXPAND, 5 )
1203         
1204         fgSizer51.Add( bSizer71, 1, wx.EXPAND, 5 )
1205         
1206         self.m_staticline321 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1207         fgSizer51.Add( self.m_staticline321, 0, wx.EXPAND, 5 )
1208         
1209         self.m_staticline322 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1210         fgSizer51.Add( self.m_staticline322, 0, wx.EXPAND, 5 )
1211         
1212         self.m_staticText10111 = wx.StaticText( self, wx.ID_ANY, u"Largeur des arêtes\nproportionnelle à l'indice", wx.DefaultPosition, wx.DefaultSize, 0 )
1213         self.m_staticText10111.Wrap( -1 )
1214         fgSizer51.Add( self.m_staticText10111, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1215         
1216         bSizer711 = wx.BoxSizer( wx.HORIZONTAL )
1217         
1218         self.check3 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1219         bSizer711.Add( self.check3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1220         
1221         fgSizer711 = wx.FlexGridSizer( 0, 2, 0, 0 )
1222         fgSizer711.SetFlexibleDirection( wx.BOTH )
1223         fgSizer711.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1224         
1225         self.m_staticText1111 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1226         self.m_staticText1111.Wrap( -1 )
1227         fgSizer711.Add( self.m_staticText1111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1228         
1229         self.spin_temin = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1230         fgSizer711.Add( self.spin_temin, 0, wx.ALL, 5 )
1231         
1232         self.m_staticText1211 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1233         self.m_staticText1211.Wrap( -1 )
1234         fgSizer711.Add( self.m_staticText1211, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1235         
1236         self.spin_temax = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
1237         fgSizer711.Add( self.spin_temax, 0, wx.ALL, 5 )
1238         
1239         bSizer711.Add( fgSizer711, 1, wx.EXPAND, 5 )
1240         
1241         fgSizer51.Add( bSizer711, 1, wx.EXPAND, 5 )
1242         
1243         self.m_staticline33 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1244         fgSizer51.Add( self.m_staticline33, 0, wx.EXPAND, 5 )
1245         
1246         self.m_staticline34 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1247         fgSizer51.Add( self.m_staticline34, 0, wx.EXPAND, 5 )
1248         
1249         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 )
1250         self.m_staticText28.Wrap( -1 )
1251         fgSizer51.Add( self.m_staticText28, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1252         
1253         bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
1254         
1255         self.m_checkBox14 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1256         bSizer10.Add( self.m_checkBox14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1257         
1258         bSizer11 = wx.BoxSizer( wx.VERTICAL )
1259         
1260         bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
1261         
1262         self.m_staticText31 = wx.StaticText( self, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
1263         self.m_staticText31.Wrap( -1 )
1264         bSizer12.Add( self.m_staticText31, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1265         
1266         self.m_spinCtrl14 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10, 0 )
1267         bSizer12.Add( self.m_spinCtrl14, 0, wx.ALL, 5 )
1268         
1269         bSizer11.Add( bSizer12, 1, wx.EXPAND, 5 )
1270         
1271         bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
1272         
1273         self.m_staticText32 = wx.StaticText( self, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
1274         self.m_staticText32.Wrap( -1 )
1275         bSizer13.Add( self.m_staticText32, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1276         
1277         self.m_spinCtrl15 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10, 10 )
1278         bSizer13.Add( self.m_spinCtrl15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1279         
1280         bSizer11.Add( bSizer13, 1, wx.EXPAND, 5 )
1281         
1282         bSizer10.Add( bSizer11, 1, wx.EXPAND, 5 )
1283         
1284         fgSizer51.Add( bSizer10, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
1285         
1286         self.m_staticline3311 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1287         fgSizer51.Add( self.m_staticline3311, 0, wx.EXPAND |wx.ALL, 5 )
1288         
1289         self.m_staticline33111 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1290         fgSizer51.Add( self.m_staticline33111, 0, wx.EXPAND |wx.ALL, 5 )
1291         bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
1292         
1293         self.m_staticText21 = wx.StaticText( self, wx.ID_ANY, u"Couleur des sommets", wx.DefaultPosition, wx.DefaultSize, 0 )
1294         self.m_staticText21.Wrap( -1 )
1295         bSizer5.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1296         
1297         self.cols = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.Colour( 255, 0, 0 ), wx.DefaultPosition, wx.Size( 10,10 ), wx.CLRP_DEFAULT_STYLE )
1298         bSizer5.Add( self.cols, 0, wx.ALL, 5 )
1299         
1300         fgSizer51.Add( bSizer5, 1, wx.EXPAND, 5 )
1301         
1302         bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
1303         
1304         self.m_staticText22 = wx.StaticText( self, wx.ID_ANY, u"Couleur des arêtes", wx.DefaultPosition, wx.DefaultSize, 0 )
1305         self.m_staticText22.Wrap( -1 )
1306         bSizer6.Add( self.m_staticText22, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1307         
1308         self.cola = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.Colour( 208, 208, 208 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
1309         bSizer6.Add( self.cola, 0, wx.ALL, 5 )
1310         
1311         fgSizer51.Add( bSizer6, 1, wx.EXPAND, 5 )
1312         
1313         self.m_staticline331 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1314         fgSizer51.Add( self.m_staticline331, 0, wx.EXPAND, 5 )
1315         
1316         self.m_staticline332 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1317         fgSizer51.Add( self.m_staticline332, 0, wx.EXPAND, 5 )
1318         
1319         self.m_staticText23 = wx.StaticText( self, wx.ID_ANY, u"Taille des sommets unique", wx.DefaultPosition, wx.DefaultSize, 0 )
1320         self.m_staticText23.Wrap( -1 )
1321         fgSizer51.Add( self.m_staticText23, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1322         
1323         bSizer72 = wx.BoxSizer( wx.HORIZONTAL )
1324         
1325         self.check_s_size = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1326         bSizer72.Add( self.check_s_size, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1327         
1328         self.spin_tv = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
1329         bSizer72.Add( self.spin_tv, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1330         
1331         fgSizer51.Add( bSizer72, 1, wx.EXPAND, 5 )
1332         
1333         self.m_staticline333 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1334         fgSizer51.Add( self.m_staticline333, 0, wx.EXPAND, 5 )
1335         
1336         self.m_staticline334 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1337         fgSizer51.Add( self.m_staticline334, 0, wx.EXPAND, 5 )
1338         
1339         self.m_staticText24 = wx.StaticText( self, wx.ID_ANY, u"Transparence des sphères", wx.DefaultPosition, wx.DefaultSize, 0 )
1340         self.m_staticText24.Wrap( -1 )
1341         fgSizer51.Add( self.m_staticText24, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1342         
1343         self.slider_sphere = wx.Slider( self, wx.ID_ANY, 10, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL|wx.SL_LABELS )
1344         fgSizer51.Add( self.slider_sphere, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
1345         
1346         self.m_staticline335 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1347         fgSizer51.Add( self.m_staticline335, 0, wx.EXPAND, 5 )
1348         
1349         self.m_staticline336 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1350         fgSizer51.Add( self.m_staticline336, 0, wx.EXPAND, 5 )
1351         
1352         self.m_staticText25 = wx.StaticText( self, wx.ID_ANY, u"Faire un film", wx.DefaultPosition, wx.DefaultSize, 0 )
1353         self.m_staticText25.Wrap( -1 )
1354         fgSizer51.Add( self.m_staticText25, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1355         
1356         self.film = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1357         fgSizer51.Add( self.film, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
1358         
1359         self.m_staticline2918 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1360         fgSizer51.Add( self.m_staticline2918, 0, wx.EXPAND, 5 )
1361         
1362         self.m_staticline2919 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1363         fgSizer51.Add( self.m_staticline2919, 0, wx.EXPAND, 5 )
1364         
1365         
1366         fgSizer51.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
1367         
1368         m_sdbSizer2 = wx.StdDialogButtonSizer()
1369         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1370         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1371         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1372         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1373         m_sdbSizer2.Realize();
1374         fgSizer51.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
1375         
1376         fgSizer5.Add( fgSizer51, 1, wx.EXPAND, 5 )
1377         
1378         self.SetSizer( fgSizer5 )
1379         self.__set_properties()
1380
1381         self.Layout()
1382         fgSizer5.Fit( self )
1383         
1384         self.Centre( wx.BOTH )
1385         
1386         # Connect Events
1387         if not self.paramsimi['first'] :
1388             self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
1389         self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
1390         self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
1391         if 'cexfromchi' in self.paramsimi :
1392             self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
1393         if 'sfromchi' in self.paramsimi :
1394             self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
1395         self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
1396         self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
1397
1398     def __set_properties(self):
1399         self.choice1.SetSelection(self.paramsimi['coeff'])
1400         self.choice2.SetSelection(self.paramsimi['layout'])
1401         self.choice3.SetSelection(self.paramsimi['type_graph'])
1402         if self.paramsimi['type'] != 2 :
1403             self.film.Enable(False)
1404             self.slider_sphere.Enable(False)
1405         else :
1406             self.film.Enable(True)
1407             self.slider_sphere.Enable(True)
1408         self.check1.SetValue(self.paramsimi['arbremax'])
1409         self.check_vlab.SetValue(self.paramsimi['label_v'])
1410         self.check_elab.SetValue(self.paramsimi['label_e'])
1411         self.check2.SetValue(self.paramsimi['tvprop'])
1412         self.spin_tv.SetValue(self.paramsimi['coeff_tv_nb'])
1413         self.check_s_size.SetValue(self.paramsimi['coeff_tv'])
1414         self.spin_tvmin.SetValue(self.paramsimi['tvmin'])
1415         self.spin_tvmax.SetValue(self.paramsimi['tvmax'])
1416         self.check3.SetValue(self.paramsimi['coeff_te'])
1417         self.spin_temin.SetValue(self.paramsimi['coeff_temin'])
1418         self.spin_temax.SetValue(self.paramsimi['coeff_temax'])
1419         self.check_vcex.SetValue(self.paramsimi['vcex'])
1420         self.spin_vcexmin.SetValue(self.paramsimi['vcexmin'])
1421         self.spin_vcexmax.SetValue(self.paramsimi['vcexmax'])
1422         self.spin_cex.SetValue(self.paramsimi['cex'])
1423         self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
1424         self.spin_seuil.SetValue(self.paramsimi['seuil'])
1425         self.cols.SetColour(self.paramsimi['cols'])
1426         self.cola.SetColour(self.paramsimi['cola'])
1427         self.spin_width.SetValue(self.paramsimi['width'])
1428         self.spin_height.SetValue(self.paramsimi['height'])
1429         if 'cexfromchi' in self.paramsimi :
1430             self.checkit.SetValue(self.paramsimi['cexfromchi'])
1431         if 'sfromchi' in self.paramsimi :
1432             self.checki.SetValue(self.paramsimi['sfromchi'])
1433         if not self.paramsimi['first'] :
1434             self.check_coord.SetValue(self.paramsimi['keep_coord'])
1435             self.OnKeepCoords(wx.EVT_CHECKBOX)
1436         if self.paramsimi.get('bystar', False) :
1437             self.check_bystar.SetValue(True)
1438             self.stars = self.paramsimi['stars']
1439         self.slider_sphere.SetValue(self.paramsimi['alpha'])
1440         self.film.SetValue(self.paramsimi['film'])
1441
1442     def OnCheck_s_size(self, evt):
1443         if self.check_s_size.GetValue() :
1444             if 'cexfromchi' in self.paramsimi :
1445                 self.checki.SetValue(False)
1446             self.check2.SetValue(False)
1447             self.spin_tvmin.Enable(False)
1448             self.spin_tvmax.Enable(False)
1449             self.spin_tv.Enable(True)
1450         else :
1451             self.check2.SetValue(True)
1452             self.spin_tvmin.Enable(True)
1453             self.spin_tvmax.Enable(True)
1454             self.spin_tv.Enable(False)
1455
1456     def OnCheck2(self, evt):
1457         if self.check2.GetValue():
1458             self.check_s_size.SetValue(False)
1459             if 'cexfromchi' in self.paramsimi :
1460                 self.checki.SetValue(False)
1461             self.spin_tvmin.Enable(True)
1462             self.spin_tvmax.Enable(True)
1463             self.spin_tv.Enable(False)
1464         else :
1465             self.check_s_size.SetValue(True)
1466             self.spin_tvmin.Enable(False)
1467             self.spin_tvmax.Enable(False)
1468             self.spin_tv.Enable(True)
1469
1470     def OnChecki(self, evt):
1471         if 'sfromchi' in self.paramsimi :
1472             if self.checki.GetValue() :
1473                 self.check_s_size.SetValue(False)
1474                 self.check2.SetValue(False)
1475                 self.spin_tvmin.Enable(True)
1476                 self.spin_tvmax.Enable(True)
1477                 self.spin_tv.Enable(False)
1478             else :
1479                 self.check_s_size.SetValue(True)
1480                 #self.check2.SetValue(True)
1481                 self.spin_tvmin.Enable(False)
1482                 self.spin_tvmax.Enable(False)
1483                 self.spin_tv.Enable(True)
1484
1485     def OnCheckit(self,evt) :
1486         if 'cexfromchi' in self.paramsimi :
1487             if self.checkit.GetValue() :
1488                 if self.check_vcex.GetValue() :
1489                     self.check_vcex.SetValue(False)
1490
1491     def OnCheck_vcex(self, evt):
1492         if self.check_vcex.GetValue() :
1493             if 'checkit' in dir(self) :
1494                 if self.checkit.GetValue() :
1495                     self.checkit.SetValue(False)
1496     
1497     def OnChangeType(self, event) :
1498         if event.GetInt() != 1 :
1499             self.spin_width.Enable(False)
1500             self.spin_height.Enable(False)
1501         else :
1502             self.spin_width.Enable(True)
1503             self.spin_height.Enable(True)
1504         if event.GetInt() != 2 :
1505             self.film.Enable(False)
1506             self.slider_sphere.Enable(False)
1507         else :
1508             self.film.Enable(True)
1509             self.slider_sphere.Enable(True)
1510
1511     def OnKeepCoords(self, event):
1512         if self.check_coord.GetValue() :
1513             self.choice1.SetSelection(self.paramsimi['coeff'])
1514             self.choice2.SetSelection(self.paramsimi['layout'])
1515             self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
1516             self.spin_seuil.SetValue(self.paramsimi['seuil'])
1517             self.choice1.Disable()
1518             self.choice2.Disable()
1519             self.check_seuil.Disable()
1520             self.spin_seuil.Disable()
1521             self.check_colch.SetValue(False)
1522             self.check_colch.Disable()
1523         else :
1524             self.choice1.Enable(True)
1525             self.choice2.Enable(True)
1526             self.check_seuil.Enable(True)
1527             self.spin_seuil.Enable(True)
1528             self.check_colch.Enable(True)
1529
1530 class SelectColDial ( wx.Dialog ):
1531     
1532     def __init__( self, parent ):
1533         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.Size( 400,500 ), style = wx.DEFAULT_DIALOG_STYLE )
1534         
1535         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1536         
1537         self.bSizer2 = wx.BoxSizer( wx.VERTICAL )
1538         
1539         #self.m_checkList2 = wx.CheckListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ['r','t','y'], 0 ) 
1540         #bSizer2.Add( self.m_checkList2, 2, wx.ALL|wx.EXPAND, 5 )
1541         
1542         self.m_sdbSizer2 = wx.StdDialogButtonSizer()
1543         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1544         #m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1545         #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1546         #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1547         #m_sdbSizer2.Realize();
1548         #self.bSizer2.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
1549         
1550         self.SetSizer( self.bSizer2 )
1551         self.Layout()
1552         
1553         self.Centre( wx.BOTH )
1554     
1555     def __del__( self ):
1556         pass
1557
1558 class PrefExport(wx.Dialog):
1559     def __init__(self, parent, *args, **kwds):
1560         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1561         wx.Dialog.__init__(self, *args, **kwds)
1562         self.fileout = ""
1563         self.parent = parent
1564         sizer = wx.BoxSizer(wx.VERTICAL)
1565         box = wx.BoxSizer(wx.HORIZONTAL)
1566         box3 = wx.BoxSizer(wx.HORIZONTAL)
1567         self.label_lem = wx.StaticText(self, -1, u"Corpus Lemmatisé")
1568         box3.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1569         self.radio_lem = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1570         box3.Add(self.radio_lem, 0, wx.ALIGN_RIGHT, 5)
1571         sizer.Add(box3, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1572         self.label_txt = wx.StaticText(self, -1, u"Exporter pour...")
1573         box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1574         self.radio_type = wx.RadioBox(self, -1, u"", choices=['IRaMuTeQ/ALCESTE', 'Lexico'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1575         box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1576         sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1577         box2 = wx.BoxSizer(wx.HORIZONTAL)
1578         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1579         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1580         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
1581         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1582         self.fbb.SetLabel("")
1583         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1584
1585         btnsizer = wx.StdDialogButtonSizer()
1586         btn = wx.Button(self, wx.ID_CANCEL)
1587         btnsizer.AddButton(btn)
1588         btn_ok = wx.Button(self, wx.ID_OK)
1589         btn_ok.SetDefault()
1590         btnsizer.AddButton(btn_ok)
1591         btnsizer.Realize()
1592         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1593         self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1594         self.SetSizer(sizer)
1595         sizer.Fit(self)        
1596
1597     def check_file(self, evt) :
1598         if evt.GetId() == wx.ID_OK :
1599             if os.path.exists(self.fbb.GetValue()):
1600                 dlg = wx.MessageDialog(self, u"%s\nCe fichier existe, continuer quand même ?" % self.fbb.GetValue(), 'ATTENTION', wx.NO | wx.YES | wx.ICON_WARNING)
1601                 dlg.CenterOnParent()
1602                 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
1603                     self.EndModal(wx.ID_OK)
1604             else :
1605                  self.EndModal(wx.ID_OK)
1606         else :
1607             self.EndModal(wx.ID_CANCEL)
1608
1609 class PrefProfTypes(wx.Dialog):
1610     def __init__(self, parent, *args, **kwds):
1611         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1612         wx.Dialog.__init__(self, parent, *args, **kwds)
1613         self.fileout = ""
1614         self.parent = parent
1615         sizer = wx.BoxSizer(wx.VERTICAL)
1616         box = wx.BoxSizer(wx.HORIZONTAL)
1617         box3 = wx.BoxSizer(wx.HORIZONTAL)
1618         self.label_txt = wx.StaticText(self, -1, u"Préférences")
1619         box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1620         self.radio_type = wx.RadioBox(self, -1, u"", choices=['comme ALCESTE', 'comme Lexico'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1621         box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1622         sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1623         box2 = wx.BoxSizer(wx.HORIZONTAL)
1624         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1625         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1626         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
1627         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1628         self.fbb.SetLabel("")
1629         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1630
1631         btnsizer = wx.StdDialogButtonSizer()
1632         btn = wx.Button(self, wx.ID_CANCEL)
1633         btnsizer.AddButton(btn)
1634         btn_ok = wx.Button(self, wx.ID_OK)
1635         btn_ok.SetDefault()
1636         btnsizer.AddButton(btn_ok)
1637         btnsizer.Realize()
1638         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1639         #self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1640         self.SetSizer(sizer)
1641         sizer.Fit(self)
1642
1643 class PrefSimpleFile(wx.Dialog):
1644     def __init__(self, parent, *args, **kwds):
1645         kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE 
1646         if 'mask' in kwds :
1647             self.mask = kwds['mask']
1648             del(kwds['mask'])
1649         else : self.mask = '*.*'
1650         wx.Dialog.__init__(self, *args, **kwds)
1651         self.fileout = ""
1652         self.parent = parent
1653         sizer = wx.BoxSizer(wx.VERTICAL)
1654         box2 = wx.BoxSizer(wx.HORIZONTAL)
1655         self.txt2 = wx.StaticText(self, -1, u"Fichier en sortie")
1656         box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1657         self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2, fileMask = self.mask)
1658         box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1659         self.fbb.SetLabel("")
1660         sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1661
1662         btnsizer = wx.StdDialogButtonSizer()
1663         btn = wx.Button(self, wx.ID_CANCEL)
1664         btnsizer.AddButton(btn)
1665         btn_ok = wx.Button(self, wx.ID_OK)
1666         btn_ok.SetDefault()
1667         btnsizer.AddButton(btn_ok)
1668         btnsizer.Realize()
1669         sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1670         self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1671         self.SetSizer(sizer)
1672         sizer.Fit(self)        
1673
1674     def check_file(self, evt) :
1675         if evt.GetId() == wx.ID_OK :
1676             if os.path.exists(self.fbb.GetValue()):
1677                 dlg = wx.MessageDialog(self, u"%s\nCe fichier existe, continuer quand même ?" % self.fbb.GetValue(), 'ATTENTION', wx.NO | wx.YES | wx.ICON_WARNING)
1678                 dlg.CenterOnParent()
1679                 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
1680                     self.EndModal(wx.ID_OK)
1681             else :
1682                  self.EndModal(wx.ID_OK)
1683         else :
1684             self.EndModal(wx.ID_CANCEL)
1685
1686
1687 class StatDialog(wx.Dialog):
1688     def __init__(self, parent, *args, **kwds):
1689         kwds['style'] = wx.DEFAULT_DIALOG_STYLE 
1690         wx.Dialog.__init__(self, *args, **kwds)
1691         self.fileout = ""
1692         self.parent = parent
1693         #box = wx.BoxSizer(wx.HORIZONTAL)
1694         self.label_lem = wx.StaticText(self, -1, u"Lemmatisation")
1695         self.radio_lem = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1696         #sizer.Add(box, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1697         #box2 = wx.BoxSizer(wx.HORIZONTAL)
1698         #self.txt_exp = wx.StaticText(self, -1, u"Utiliser le Dict. des expressions")
1699         #self.exp = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1700         #self.label_uce =  wx.StaticText(self, -1, u"Construire des UCE")
1701         #self.check_uce = wx.CheckBox(self, -1)
1702         #txt = """Nombre d'occurrences par uce"""
1703         #self.label_occuce = wx.StaticText(self, -1, txt)
1704         #self.spin_ctrl_4 = wx.SpinCtrl(self, -1, "",size = (100,30), min=10, max=1000, initial = 35)
1705         #txt = u"""Fréquence minimum d'une forme
1706 #analysée (0 = non utilisé)"""
1707         #self.label_8 = wx.StaticText(self, -1, txt)
1708         #self.spin_ctrl_5 = wx.SpinCtrl(self, -1, "",size = (100,30), min=0, max=1000, initial=0)
1709         #self.label_max_actives =  wx.StaticText(self, -1, u"Nombre maximum de formes analysées")
1710         #self.spin_max_actives = wx.SpinCtrl(self, -1, "",size = (100,30), min=20, max=10000, initial=1500)
1711         self.label_4 = wx.StaticText(self, -1, u"Configuration des clés d'analyse")
1712         self.button_5 = wx.Button(self, wx.ID_PREFERENCES, "")
1713
1714         #self.Bind(wx.EVT_CHECKBOX, self.OnCheckUce, self.check_uce)
1715         #self.Bind(wx.EVT_SPINCTRL, self.OnSpin, self.spin_ctrl_5)
1716         self.Bind(wx.EVT_BUTTON, self.OnKeys, self.button_5)
1717         self.__do_layout()
1718         self.__set_properties()
1719
1720     def __do_layout(self) :
1721         first = wx.BoxSizer(wx.VERTICAL)
1722         sizer = wx.FlexGridSizer(4,2,0,0)
1723         sizer.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1724         sizer.Add(self.radio_lem, 0, wx.ALIGN_LEFT, 5)
1725         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1726         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1727         #sizer.Add(self.txt_exp, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1728         #sizer.Add(self.exp, 0, wx.ALIGN_RIGHT, 5)
1729         #sizer.Add(self.label_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1730         #sizer.Add(self.check_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1731         #sizer.Add(self.label_occuce, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1732         #sizer.Add(self.spin_ctrl_4, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1733         #sizer.Add(self.label_8, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1734         #sizer.Add(self.spin_ctrl_5, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1735         #sizer.Add(self.label_max_actives, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1736         #sizer.Add(self.spin_max_actives, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1737         sizer.Add(self.label_4, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1738         sizer.Add(self.button_5, 0,  wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1739         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1740         sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1741         #sizer.Add(box2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1742         first.Add(sizer, 0, wx.ALL, 5)
1743         btnsizer = wx.StdDialogButtonSizer()
1744         btn = wx.Button(self, wx.ID_CANCEL)
1745         btnsizer.AddButton(btn)
1746         btn_ok = wx.Button(self, wx.ID_OK)
1747         btn_ok.SetDefault()
1748         btnsizer.AddButton(btn_ok)
1749         btnsizer.Realize()
1750         first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1751         self.SetSizer(first)
1752         first.Fit(self)
1753
1754     def __set_properties(self) :
1755         self.SetTitle(u'Préférences')
1756         #self.spin_ctrl_4.Enable(False)
1757         #self.spin_ctrl_5.Enable(False)
1758         #self.spin_max_actives.Enable(False)
1759
1760 #    def OnCheckUce(self, evt) :
1761 #        if self.check_uce.GetValue() :
1762 #            self.spin_ctrl_4.Enable(True)
1763 #            self.spin_ctrl_5.Enable(True)
1764 #            if self.spin_ctrl_5.GetValue() > 0 :
1765 #                self.spin_max_actives.Enable(False)
1766 #            else :
1767 #                self.spin_max_actives.Enable(True)
1768 #        else :
1769 #            self.spin_ctrl_4.Enable(False)
1770 #            self.spin_ctrl_5.Enable(False)
1771 #            self.spin_max_actives.Enable(False)
1772
1773 #    def OnSpin(self, evt) :
1774 #        if self.spin_ctrl_5.GetValue() > 0 :
1775 #            self.spin_max_actives.Enable(False)
1776 #        else :
1777 #            self.spin_max_actives.Enable(True)
1778
1779     def OnKeys(self, evt):
1780         dial = AlcOptFrame(self.parent, self)
1781         dial.CenterOnParent()
1782         val = dial.ShowModal()
1783
1784 class LexDialog( wx.Dialog ):
1785     
1786     def __init__( self, parent ):
1787         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1788         
1789         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1790         
1791         bSizer2 = wx.BoxSizer( wx.VERTICAL )
1792         
1793         fgSizer2 = wx.FlexGridSizer( 2, 2, 0, 0 )
1794         fgSizer2.SetFlexibleDirection( wx.BOTH )
1795         fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1796         
1797         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Lemmatisation", wx.DefaultPosition, wx.DefaultSize, 0 )
1798         self.m_staticText9.Wrap( -1 )
1799         fgSizer2.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3 )
1800         
1801         m_radioBox2Choices = [ u"oui", u"non" ]
1802         self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
1803         self.m_radioBox2.SetSelection( 0 )
1804         fgSizer2.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 3 )
1805         
1806 #        self.m_staticText10 = wx.StaticText( self, wx.ID_ANY, u"Utiliser le Dict. des expressions", wx.DefaultPosition, wx.DefaultSize, 0 )
1807 #        self.m_staticText10.Wrap( -1 )
1808 #        fgSizer2.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 3 )
1809 #        
1810 #        m_radioBox21Choices = [ u"oui", u"non" ]
1811 #        self.m_radioBox21 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox21Choices, 1, wx.RA_SPECIFY_COLS )
1812 #        self.m_radioBox21.SetSelection( 0 )
1813 #        fgSizer2.Add( self.m_radioBox21, 0, wx.ALIGN_RIGHT|wx.ALL, 3 )
1814 #        bSizer2.Add( fgSizer2, 1, wx.EXPAND, 5 )
1815         
1816         btnsizer = wx.StdDialogButtonSizer()
1817         btn = wx.Button(self, wx.ID_CANCEL)
1818         btnsizer.AddButton(btn)
1819         btn_ok = wx.Button( self, wx.ID_OK)
1820         btn_ok.SetDefault()
1821         btnsizer.AddButton(btn_ok)
1822         btnsizer.Realize()
1823
1824         bSizer2.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1825         self.SetSizer( bSizer2 )
1826         self.Layout()
1827         bSizer2.Fit( self )
1828         self.Centre( wx.BOTH )
1829
1830 class PrefUCECarac(wx.Dialog):
1831     def __init__(self, parent, *args, **kwds):
1832         kwds['style'] = wx.DEFAULT_DIALOG_STYLE 
1833         kwds['title'] = u"UCE caractéristiques"
1834         wx.Dialog.__init__(self, *args, **kwds)
1835         self.parent = parent
1836         first = wx.BoxSizer(wx.VERTICAL)
1837         sizer = wx.FlexGridSizer(2,2,0,0)
1838         self.label_type = wx.StaticText(self, -1, u"Score de classement")
1839         sizer.Add(self.label_type, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1840         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)
1841         sizer.Add(self.radio_type, 0, wx.ALIGN_RIGHT, 5)
1842         self.txt_eff = wx.StaticText(self, -1, u"Nombre d\'UCE maximum")
1843         sizer.Add(self.txt_eff, 0, wx.ALIGN_CENTRE, 5)
1844         self.spin_eff = wx.SpinCtrl(self, -1, '', size = (100, 30), min = 1, max = 100000, initial = 50)
1845         sizer.Add(self.spin_eff, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1846         first.Add(sizer, 0, wx.ALL, 5)
1847         btnsizer = wx.StdDialogButtonSizer()
1848         btn = wx.Button(self, wx.ID_CANCEL)
1849         btnsizer.AddButton(btn)
1850         btn_ok = wx.Button(self, wx.ID_OK)
1851         btn_ok.SetDefault()
1852         btnsizer.AddButton(btn_ok)
1853         btnsizer.Realize()
1854         first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1855         self.SetSizer(first)
1856         first.Fit(self)
1857
1858 class PrefSegProf(wx.Dialog) :
1859     def __init__( self, parent ):
1860         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 )
1861         
1862         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1863         bSizer1 = wx.BoxSizer( wx.VERTICAL )
1864         txt = u"ATTENTION : le calcul des profils des segments répétés\npeut être très long sur les corpus importants"
1865         self.label = wx.StaticText( self, wx.ID_ANY, txt, wx.DefaultPosition, wx.DefaultSize, 0 ) 
1866         bSizer1.Add( self.label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5 )
1867
1868         fgSizer1 = wx.FlexGridSizer( 2, 2, 0, 0 )
1869         fgSizer1.SetFlexibleDirection( wx.BOTH )
1870         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1871         
1872         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Corpus lemmatisé", wx.DefaultPosition, wx.DefaultSize, 0 )
1873         self.m_staticText1.Wrap( -1 )
1874         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1875         
1876         box_lemChoices = [ u"oui", u"non" ]
1877         self.box_lem = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, box_lemChoices, 1, wx.RA_SPECIFY_COLS )
1878         self.box_lem.SetSelection( 1 )
1879         fgSizer1.Add( self.box_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1880         #self.box_lem.Enable(False)
1881         
1882         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Taille minimum des segments", wx.DefaultPosition, wx.DefaultSize, 0 )
1883         self.m_staticText3.Wrap( -1 )
1884         fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1885         
1886         self.spin_min = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 2 )
1887         self.spin_min.SetValue(2)
1888         fgSizer1.Add( self.spin_min, 0, wx.ALL, 5 )
1889         
1890         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Taille maximum des segments", wx.DefaultPosition, wx.DefaultSize, 0 )
1891         self.m_staticText4.Wrap( -1 )
1892         fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1893         
1894         self.spin_max = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 10 )
1895         self.spin_max.SetValue(10)
1896         fgSizer1.Add( self.spin_max, 0, wx.ALL, 5 )
1897         
1898         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Effectif minimum d'un segment retenu", wx.DefaultPosition, wx.DefaultSize, 0 )
1899         self.m_staticText5.Wrap( -1 )
1900         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1901         
1902         self.spin_eff = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 4, 1000, 4 )
1903         self.spin_eff.SetValue(4)
1904         fgSizer1.Add( self.spin_eff, 0, wx.ALL, 5 )
1905         
1906         bSizer1.Add( fgSizer1, 1, wx.EXPAND, 5 )
1907         btnsizer = wx.StdDialogButtonSizer()
1908         btn = wx.Button(self, wx.ID_CANCEL)
1909         btnsizer.AddButton(btn)
1910         btn_ok = wx.Button(self, wx.ID_OK)
1911         btn_ok.SetDefault()
1912         btnsizer.AddButton(btn_ok)
1913         btnsizer.Realize()
1914         bSizer1.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1915
1916         self.SetSizer( bSizer1 )
1917         self.Layout()
1918         bSizer1.Fit( self )
1919         
1920         self.Centre( wx.BOTH )
1921
1922 class PrefQuestAlc ( wx.Dialog ):
1923     
1924     def __init__( self, parent, sim = False):
1925         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u'Classification', pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1926         
1927         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1928         
1929         #---------------------------------------------------------------
1930         #self.content = parent.content[:]
1931         self.header = parent.tableau.get_colnames()
1932         labels = [val for val in self.header]
1933         self.labels_tot = labels
1934         self.varsup = []
1935         self.sim = sim
1936         #---------------------------------------------------------------
1937         bSizer2 = wx.BoxSizer( wx.VERTICAL )
1938         
1939         fgSizer1 = wx.FlexGridSizer( 2, 2, 0, 0 )
1940         fgSizer1.SetFlexibleDirection( wx.BOTH )
1941         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1942
1943         if not self.sim :
1944             self.lab_format = wx.StaticText( self, wx.ID_ANY, u"Le corpus est formaté", wx.DefaultPosition, wx.DefaultSize, 0 )
1945             self.lab_format.Wrap( -1 )
1946             fgSizer1.Add( self.lab_format, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1947         
1948             m_radioBox1Choices = [ u"oui", u"non" ]
1949             self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
1950             self.m_radioBox1.SetSelection( 0 )
1951             fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1952         
1953         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Variables actives (min = 3) :", wx.DefaultPosition, wx.DefaultSize, 0 )
1954         self.m_staticText3.Wrap( -1 )
1955         fgSizer1.Add( self.m_staticText3, 0, wx.ALL, 5 )
1956         
1957         self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Variables illustratives (min = 1):", wx.DefaultPosition, wx.DefaultSize, 0 )
1958         self.m_staticText2.Wrap( -1 )
1959         fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
1960         
1961         self.ListActive = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels,  wx.LB_EXTENDED )
1962         self.ListActive.SetMinSize( wx.Size( 300,250 ) )
1963         
1964         fgSizer1.Add( self.ListActive, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1965         
1966         self.ListSup = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels, wx.LB_EXTENDED )
1967         self.ListSup.SetMinSize( wx.Size( 300,250 ) )
1968         
1969         fgSizer1.Add( self.ListSup, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1970         
1971         self.but_suiv = wx.Button( self, wx.ID_ANY, u"Suivant", wx.DefaultPosition, wx.DefaultSize, 0 )
1972         fgSizer1.Add( self.but_suiv, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1973         
1974         self.but_prec = wx.Button( self, wx.ID_ANY, u"Précédent", wx.DefaultPosition, wx.DefaultSize, 0 )
1975         fgSizer1.Add( self.but_prec, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1976         
1977         if not sim :
1978             self.lab_nbcl = wx.StaticText( self, wx.ID_ANY, u"Nombre de classes terminales de la phase 1", wx.DefaultPosition, wx.DefaultSize, 0 )
1979             self.lab_nbcl.Wrap( -1 )
1980             fgSizer1.Add( self.lab_nbcl, 0, wx.ALL, 5 )
1981             
1982             self.spin_nbcl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 100, 10 )
1983             self.spin_nbcl.SetValue(10)
1984             self.spin_nbcl.SetMinSize( wx.Size( 100,30 ) )
1985             
1986             fgSizer1.Add( self.spin_nbcl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1987             
1988             self.lab_mincl = wx.StaticText( self, wx.ID_ANY, u"Effectif minimum d'une classe (2 = automatique)", wx.DefaultPosition, wx.DefaultSize, 0 )
1989             self.lab_mincl.Wrap( -1 )
1990             fgSizer1.Add( self.lab_mincl, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1991             
1992             self.spin_mincl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 1000, 0 )
1993             self.spin_mincl.SetValue(2)
1994             self.spin_mincl.SetMinSize( wx.Size( 100,30 ) )
1995             
1996             fgSizer1.Add( self.spin_mincl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1997             
1998         bSizer2.Add( fgSizer1, 1, wx.EXPAND, 5 )
1999         
2000         m_sdbSizer2 = wx.StdDialogButtonSizer()
2001         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
2002         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
2003         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
2004         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
2005         m_sdbSizer2.Realize();
2006         bSizer2.Add( m_sdbSizer2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2007         
2008         self.SetSizer( bSizer2 )
2009         self.Layout()
2010         bSizer2.Fit( self )
2011         
2012         self.Centre( wx.BOTH )
2013         
2014         if not self.sim :
2015             self.ListActive.Enable(False)
2016             self.ListSup.Enable(False)
2017             self.but_suiv.Enable(False)
2018             self.but_prec.Enable(False)
2019         else :
2020             self.ListSup.Enable(False)
2021             self.but_prec.Enable(False)
2022         
2023         # Connect Events
2024         if not self.sim :
2025             self.m_radioBox1.Bind( wx.EVT_RADIOBOX, self.onformat )
2026         self.but_suiv.Bind(wx.EVT_BUTTON, self.onsuivant)
2027         self.but_prec.Bind(wx.EVT_BUTTON, self.onprec)
2028         self.m_sdbSizer2OK.Bind(wx.EVT_BUTTON, self.onvalid)
2029
2030     def __del__( self ):
2031         pass
2032     
2033     # Virtual event handlers, overide them in your derived class
2034     def onformat( self, event ):
2035         if self.m_radioBox1.GetSelection() == 0 :
2036             self.ListActive.Enable(False)
2037             self.ListSup.Enable(False)
2038             self.but_suiv.Enable(False)
2039             self.m_sdbSizer2OK.Enable(True)
2040         else :
2041             self.ListActive.Enable(True)
2042             self.but_suiv.Enable(True)
2043             self.m_sdbSizer2OK.Enable(False)
2044         
2045     def onsuivant(self, evt) :
2046         actives = list(self.ListActive.GetSelections())
2047         actives.sort()
2048         if len(actives)>=3 and len(actives) != len(self.header) :
2049             self.hindices = []
2050             self.nactives = []
2051             compt = 0
2052             header = self.header[:]
2053             for i in range(0, len(header)):
2054                 self.hindices.append(i)
2055             for i in actives :
2056                 self.nactives.append(i)
2057                 header.pop(i - compt)
2058                 self.hindices.pop(i - compt)
2059                 compt += 1
2060             self.labels = [val for val in header]
2061             self.ListSup.Clear()
2062             for i in header :
2063                 self.ListSup.Append(i)
2064                         
2065             self.ListActive.Enable(False)    
2066             self.ListSup.Enable(True)
2067             self.but_suiv.Enable(False)
2068             self.but_prec.Enable(True)
2069             if not self.sim :
2070                 self.m_sdbSizer2OK.Enable(True)
2071
2072     def onprec(self, evt) :
2073         self.ListActive.Enable(True)    
2074         self.ListSup.Enable(False)
2075         self.but_suiv.Enable(True)
2076         self.but_prec.Enable(False)
2077         if not self.sim :
2078             self.m_sdbSizer2OK.Enable(False)
2079
2080     def onvalid(self, evt) :
2081         for i in self.ListSup.GetSelections() :
2082             self.varsup.append(self.hindices[i])
2083         if not self.sim :
2084             if len(self.varsup) >= 1 or self.m_radioBox1.GetSelection() == 0 :
2085                 evt.Skip()
2086         else :
2087             if len(self.varsup) >= 1 :
2088                 evt.Skip()
2089
2090 class FindInCluster(wx.Frame):
2091     def __init__(self, parent, id, result, style = wx.DEFAULT_FRAME_STYLE):
2092         # begin wxGlade: MyFrame.__init__
2093         wx.Frame.__init__(self, parent, id)
2094         self.spanel =  wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL)
2095         self.sizer1 = wx.FlexGridSizer(len(result)+1,4,0,0)
2096         self.parent = parent
2097         self.formes = {}
2098         txt =  [u'forme',u'classe',u'chi2',u'voir']
2099         for val in txt :
2100             self.sizer1.Add( wx.StaticText(self.spanel, -1, val), 0, wx.ALL, 5)
2101         for val in txt :
2102             self.sizer1.Add(wx.StaticLine(self.spanel, -1), 0, wx.ALL, 5)
2103         for i,val in enumerate(result) :
2104             forme = val[0]
2105             cl = val[1]
2106             chi = val[2]
2107             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2108             siz = wx.BoxSizer(wx.VERTICAL)
2109             txt = wx.StaticText(pan, -1, forme)
2110             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2111             pan.SetSizer(siz)
2112             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2113             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2114             siz = wx.BoxSizer(wx.VERTICAL)
2115             txt = wx.StaticText(pan, -1, str(cl))
2116             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2117             pan.SetSizer(siz)
2118             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2119             pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
2120             siz = wx.BoxSizer(wx.VERTICAL)
2121             txt = wx.StaticText(pan, -1, str(chi))
2122             siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2123             pan.SetSizer(siz)
2124             self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
2125             idbut = wx.NewId()
2126             self.formes[idbut] = [forme, cl]
2127             but = wx.Button(self.spanel, idbut, u"voir")
2128             self.sizer1.Add(but, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
2129             self.Bind(wx.EVT_BUTTON, self.showitem, but)
2130         self.button_1 = wx.Button(self, -1, "Fermer")
2131         self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1)
2132         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
2133         self.__set_properties()
2134         self.__do_layout()
2135         # end wxGlade
2136     
2137     def __set_properties(self):
2138         self.SetTitle(u'Résultats')
2139         self.spanel.EnableScrolling(True,True)
2140         #self.panel_1.SetSize((1000,1000))
2141         self.spanel.SetScrollRate(20, 20)
2142         h = 60 * len(self.formes)
2143         if h > 600 :
2144             h = 600
2145         if h < 150 :
2146             h = 150
2147         self.SetSize(wx.Size(400,h))
2148
2149     def __do_layout(self):
2150         # begin wxGlade: MyFrame.__do_layout
2151         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2152         sizer_2 = wx.BoxSizer(wx.VERTICAL)
2153         self.spanel.SetSizer(self.sizer1)
2154         sizer_1.Add(self.spanel, 4, wx.EXPAND, 0)
2155         sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
2156         #sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
2157         self.SetAutoLayout(True)
2158         self.SetSizer(sizer_1)
2159         self.Layout()
2160         # end wxGlade
2161
2162     def showitem(self, evt) :
2163         idb = evt.GetEventObject().GetId()
2164         nb = self.parent.nb
2165         profile = nb.GetPage(nb.GetSelection())
2166         cl = self.formes[idb][1] - 1
2167         forme = self.formes[idb][0]
2168         profile.ProfNB.SetSelection(cl)
2169         UnSelectList(profile.ProfNB.GetPage(cl))
2170         datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())])
2171         profile.ProfNB.GetPage(cl).SetItemState(datas[self.formes[idb][0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2172         profile.ProfNB.GetPage(cl).Focus(datas[forme])
2173         profile.ProfNB.GetPage(cl).SetFocus()
2174
2175     def OnCloseMe(self, evt) :
2176         self.Close(True)
2177
2178     def OnCloseWindow(self, evt):
2179         self.Destroy()
2180
2181 class SearchDial ( wx.Dialog ):
2182     
2183     def __init__( self, parent, listctrl, col, shown):
2184         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2185         self.parent = parent
2186         self.listctrl = listctrl
2187         self.col = col
2188         self.shown = shown
2189         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2190         
2191         bSizer1 = wx.BoxSizer( wx.VERTICAL )
2192         
2193         self.search = wx.SearchCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
2194         self.search.ShowSearchButton( True )
2195         self.search.ShowCancelButton( True )
2196         bSizer1.Add( self.search, 0, wx.ALL, 5 )
2197         sizer2 = wx.BoxSizer(wx.HORIZONTAL)
2198         self.backward = wx.Button(self, wx.ID_BACKWARD, u"Précédent")
2199         self.forward = wx.Button(self, wx.ID_FORWARD, u"Suivant")
2200         sizer2.Add(self.backward, 0, wx.ALL, 5)
2201         sizer2.Add(self.forward, 0, wx.ALL, 5)
2202         bSizer1.Add( sizer2, 0, wx.ALL, 5 )
2203
2204         self.SetSizer( bSizer1 )
2205         self.Layout()
2206         bSizer1.Fit( self )
2207         self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnSearch, self.search)
2208         self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel, self.search)
2209         self.Bind(wx.EVT_TEXT_ENTER, self.OnSearch, self.search)
2210         self.Bind(wx.EVT_BUTTON, self.onforward, self.forward)
2211         self.Bind(wx.EVT_BUTTON, self.onbackward, self.backward)
2212         self.search.SetFocus()
2213         self.forward.Enable(False)
2214         self.backward.Enable(False)
2215
2216         self.Centre( wx.BOTH )
2217     
2218     def __del__( self ):
2219         pass
2220
2221     def OnSearch(self, evt):
2222         UnSelectList(self.listctrl)
2223         search_word = self.search.GetValue()
2224         if search_word.strip() != '' :
2225             formes = [self.listctrl.getColumnText(i, self.col) for i in range(self.listctrl.GetItemCount())]
2226             if search_word.endswith(u'*') :
2227                 search_word = search_word[0:-1]
2228                 result = [j for j, forme in enumerate(formes) if forme.startswith(search_word)]
2229             else :
2230                 result = [j for j, forme in enumerate(formes) if forme == search_word]
2231             if result == [] :
2232                 self.noresult()
2233             elif self.shown == True :
2234                 self.showitems(result)
2235             else :
2236                 self.showresult(result)
2237         else :
2238             self.Destroy()
2239
2240     
2241     def showitems(self, items) :
2242         if len(items) == 1 :
2243             self.listctrl.SetItemState(items[0], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2244             self.listctrl.Focus(items[0])
2245             self.listctrl.SetFocus()
2246             self.Destroy()
2247         else :
2248             for i in items :
2249                 self.listctrl.SetItemState(i, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2250             self.listctrl.Focus(items[0])
2251             self.listctrl.SetFocus()
2252             self.forward.Enable(True)
2253             self.backward.Enable(False)
2254             self.items = items
2255             self.forwitem = 1
2256             self.backitem = -1
2257     
2258     def showresult(self, result) :
2259         toshow = [self.listctrl.itemDataMap[int(self.listctrl.getColumnText(i,0))] for i in result]
2260         proflist = [[[line[1], i+1, val] for i, val in enumerate(line[2:]) if val>=2] for line in toshow]
2261         #FIXME: intervenir en aval en virant les forme avec chi<2
2262         if proflist != [[]] :
2263             proflist = [val for line in proflist for val in line if line !=[]]
2264             nb = self.parent.parent.nb
2265             profile = nb.GetPage(nb.GetSelection())
2266             first_forme = proflist[0]
2267             cl = first_forme[1] - 1
2268             profile.ProfNB.SetSelection(cl)
2269             profile.ProfNB.GetPage(cl).SetFocus()
2270             print profile.ProfNB.GetPage(cl)
2271             UnSelectList(profile.ProfNB.GetPage(cl))
2272             datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())])
2273             profile.ProfNB.GetPage(cl).SetItemState(datas[first_forme[0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
2274             profile.ProfNB.GetPage(cl).Focus(datas[first_forme[0]])
2275             profile.ProfNB.GetPage(cl).SetFocus()
2276             if len(proflist) == 1 :
2277                 self.Destroy()
2278             else :
2279                 SearchResult = FindInCluster(self.parent.parent, -1, proflist)
2280                 SearchResult.Show()
2281                 self.Destroy()
2282         else :
2283             self.noresult()
2284
2285     def onforward(self, evt) :
2286         self.listctrl.Focus(self.items[self.forwitem])
2287         self.listctrl.SetFocus()
2288         self.forwitem += 1
2289         if self.forwitem == len(self.items) :
2290             self.forward.Enable(False)
2291             self.backward.Enable(True)
2292             self.backitem += 1
2293         else :
2294             self.backitem += 1
2295             self.backward.Enable(True)
2296
2297     def onbackward(self, evt) :
2298         self.listctrl.Focus(self.items[self.backitem])
2299         self.listctrl.SetFocus()
2300         self.backitem -= 1
2301         if self.backitem == -1 :
2302             self.forwitem -= 1
2303             self.forward.Enable(True)
2304             self.backward.Enable(False)
2305         else :
2306             self.forwitem -= 1
2307             self.forward.Enable(True)
2308
2309     def noresult(self) :
2310         msg = u"Forme absente"
2311         dial = wx.MessageDialog(self, 'Forme absente','Forme absente', wx.OK | wx.ICON_INFORMATION)
2312         dial.CenterOnParent()
2313         dial.ShowModal()
2314         dial.Destroy()
2315
2316     def OnCancel(self, evt) :
2317         self.search.Clear()
2318
2319 def UnSelectList(liste) :
2320     print liste
2321     if liste.GetFirstSelected() != -1 :
2322         last = liste.GetFirstSelected()
2323         liste.Select(liste.GetFirstSelected(), False)
2324         while liste.GetNextSelected(last) != -1 :
2325              last = liste.GetNextSelected(last)
2326              liste.Select(liste.GetFirstSelected(),False)
2327
2328
2329 class OptLexi(wx.Dialog):
2330     def __init__(self, *args, **kwds):
2331         # begin wxGlade: MyDialog.__init__
2332         kwds["style"] = wx.DEFAULT_DIALOG_STYLE
2333         wx.Dialog.__init__(self, *args, **kwds)
2334         self.listet = None
2335         self.variables = None
2336         self.labellem =  wx.StaticText(self, -1, u"Lemmatisation : ")
2337         self.checklem = wx.CheckBox(self, -1)
2338         self.label_var =  wx.StaticText(self, -1, u"Sélection par :")
2339         self.choice = wx.Choice(self, -1, (100,50), choices = [u'variables', u'modalités'])
2340         self.label1 =  wx.StaticText(self, -1, u"Choix")
2341         self.list_box_1 = wx.ListBox(self, -1, choices=[],  size = wx.Size( 150,200 ), style=wx.LB_EXTENDED | wx.LB_HSCROLL)
2342         self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
2343         self.button_1 = wx.Button(self, wx.ID_OK, "")
2344         self.label_indice =  wx.StaticText(self, -1, u"indice")
2345         self.choice_indice =  wx.Choice(self, -1, (100,50), choices = [u'loi hypergéométique', u'chi2'])
2346         self.label = wx.StaticText(self, -1, u"effectif minimum")
2347         self.spin = wx.SpinCtrl(self, -1, min = 1, max = 10000)
2348         self.Bind(wx.EVT_CHOICE, self.onselect, self.choice)
2349         self.__set_properties()
2350         self.__do_layout()
2351         # end wxGlade
2352
2353     def __set_properties(self):
2354         # begin wxGlade: MyDialog.__set_properties
2355         self.SetTitle("Choix des variables")
2356         self.spin.SetValue(10)
2357         self.choice.SetSelection(0)
2358         #self.SetMinSize(wx.Size(300, 400))
2359         # end wxGlade
2360
2361     def __do_layout(self):
2362         # begin wxGlade: MyDialog.__do_layout
2363         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2364         sizer_2 = wx.FlexGridSizer(2,2,0,0)
2365         sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
2366         sizer_2.Add(self.labellem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2367         sizer_2.Add(self.checklem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2368         sizer_2.Add(self.label_var, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2369         sizer_2.Add(self.choice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2370         sizer_2.Add(self.label1, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2371         sizer_2.Add(self.list_box_1, 0, wx.ALIGN_RIGHT, 3)
2372         sizer_3.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2373         sizer_3.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2374         sizer_2.Add(self.label_indice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
2375         sizer_2.Add(self.choice_indice, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2376         sizer_2.Add(self.label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
2377         sizer_2.Add(self.spin, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
2378         sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 3)
2379         sizer_1.Add(sizer_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_RIGHT, 3)
2380         self.SetSizer(sizer_1)
2381         sizer_1.Fit(self)
2382         self.Layout()
2383         self.Centre()
2384
2385     def onselect(self, evt):
2386         self.list_box_1.Clear()
2387         if self.choice.GetSelection() == 0 :
2388             for var in self.variables :
2389                 self.list_box_1.Append(var)
2390         else :
2391             for et in self.listet :
2392                 self.list_box_1.Append(et)
2393
2394
2395 class PrefDendro ( wx.Dialog ):
2396     
2397     def __init__( self, parent, param ):
2398         wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = u"Dendrogramme", pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2399         self.param = param
2400         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2401         
2402         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2403         fgSizer1.SetFlexibleDirection( wx.BOTH )
2404         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2405         
2406         self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Taille de l'image", wx.DefaultPosition, wx.DefaultSize, 0 )
2407         self.m_staticText1.Wrap( -1 )
2408         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2409         
2410         bSizer2 = wx.BoxSizer( wx.VERTICAL )
2411         
2412         bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
2413         
2414         self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
2415         self.m_staticText2.Wrap( -1 )
2416         bSizer3.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2417         
2418         self.m_spinCtrl1 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
2419         bSizer3.Add( self.m_spinCtrl1, 0, wx.ALL, 5 )
2420         
2421         bSizer2.Add( bSizer3, 1, wx.EXPAND, 5 )
2422         
2423         bSizer31 = wx.BoxSizer( wx.HORIZONTAL )
2424         
2425         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
2426         self.m_staticText3.Wrap( -1 )
2427         bSizer31.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2428         
2429         self.m_spinCtrl2 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
2430         bSizer31.Add( self.m_spinCtrl2, 0, wx.ALL, 5 )
2431         
2432         bSizer2.Add( bSizer31, 1, wx.EXPAND, 5 )
2433         
2434         fgSizer1.Add( bSizer2, 1, wx.EXPAND, 5 )
2435         
2436         self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2437         fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
2438         
2439         self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2440         fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
2441         
2442         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Type de dendrogramme", wx.DefaultPosition, wx.DefaultSize, 0 )
2443         self.m_staticText4.Wrap( -1 )
2444         fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2445         
2446         m_choice1Choices = [ u"phylogram", u"cladogram", u"fan", u"unrooted", u"radial" ]
2447         self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice1Choices, 0 )
2448         self.m_choice1.SetSelection( 0 )
2449         fgSizer1.Add( self.m_choice1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2450         
2451         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2452         fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
2453         
2454         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2455         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
2456         
2457         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Couleur ou noir et blanc", wx.DefaultPosition, wx.DefaultSize, 0 )
2458         self.m_staticText5.Wrap( -1 )
2459         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2460         
2461         m_radioBox1Choices = [ u"couleur", u"noir et blanc" ]
2462         self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
2463         self.m_radioBox1.SetSelection( 0 )
2464         fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2465         
2466         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2467         fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
2468         
2469         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2470         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
2471         
2472         bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
2473         
2474         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Ajouter la taille des classes", wx.DefaultPosition, wx.DefaultSize, 0 )
2475         self.m_staticText6.Wrap( -1 )
2476         bSizer4.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2477         
2478         self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2479         self.m_checkBox1.SetValue(True) 
2480         bSizer4.Add( self.m_checkBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2481         
2482         fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
2483         
2484         m_radioBox2Choices = [ u"camemberts", u"barres" ]
2485         self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
2486         self.m_radioBox2.SetSelection( 0 )
2487         fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2488         
2489         self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2490         fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
2491         
2492         self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2493         fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
2494         
2495         
2496         fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
2497         
2498         m_sdbSizer2 = wx.StdDialogButtonSizer()
2499         self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
2500         m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
2501         self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
2502         m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
2503         m_sdbSizer2.Realize();
2504         fgSizer1.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
2505         
2506         self.__set_properties()
2507         self.SetSizer( fgSizer1 )
2508         self.Layout()
2509         fgSizer1.Fit( self )
2510         
2511         self.Centre( wx.BOTH )
2512
2513     def __set_properties(self):
2514         self.m_spinCtrl2.SetValue(self.param['width'])
2515         self.m_spinCtrl1.SetValue(self.param['height'])
2516         self.m_choice1.SetSelection(self.param['type_dendro'])
2517         self.m_radioBox1.SetSelection(self.param['color_nb'])
2518         self.m_checkBox1.SetValue(self.param['taille_classe'])
2519         self.m_radioBox2.SetSelection(self.param['type_tclasse'])
2520     
2521     def __del__( self ):
2522         pass
2523
2524
2525 class PrefWordCloud ( wx.Dialog ):
2526     
2527     def __init__( self, parent ):
2528         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 )
2529         
2530         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2531         
2532         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2533         fgSizer1.SetFlexibleDirection( wx.BOTH )
2534         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2535         
2536         #self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 )
2537         #self.m_staticText1.Wrap( -1 )
2538         #fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2539         
2540         #self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 )
2541         #fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2542         
2543         #self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2544         #fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
2545         
2546         #self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2547         #fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
2548         
2549         bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
2550         
2551         self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Hauteur", wx.DefaultPosition, wx.DefaultSize, 0 )
2552         self.m_staticText3.Wrap( -1 )
2553         bSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2554         
2555         self.spin_H = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
2556         bSizer1.Add( self.spin_H, 0, wx.ALL, 5 )
2557         
2558         fgSizer1.Add( bSizer1, 1, wx.EXPAND, 5 )
2559         
2560         bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
2561         
2562         self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Largeur", wx.DefaultPosition, wx.DefaultSize, 0 )
2563         self.m_staticText4.Wrap( -1 )
2564         bSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2565         
2566         self.spin_L = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
2567         bSizer3.Add( self.spin_L, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2568         
2569         fgSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
2570         
2571         self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2572         fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
2573         
2574         self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2575         fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
2576         
2577         self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Nombre maximum de formes", wx.DefaultPosition, wx.DefaultSize, 0 )
2578         self.m_staticText5.Wrap( -1 )
2579         fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2580         
2581         self.spin_maxword = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10000, 600 )
2582         fgSizer1.Add( self.spin_maxword, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2583         
2584         self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2585         fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
2586         
2587         self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2588         fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
2589         
2590         self.typeformes = wx.StaticText( self, wx.ID_ANY, u"formes retenues", wx.DefaultPosition, wx.DefaultSize, 0 )
2591         self.typeformes.Wrap( -1 )
2592         fgSizer1.Add( self.typeformes, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2593         
2594         typeformeschoiceChoices = [ u"actives", u"supplémentaires", u"actives et supplémentaires" ]
2595         self.typeformeschoice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, typeformeschoiceChoices, 0 )
2596         self.typeformeschoice.SetSelection( 0 )
2597         fgSizer1.Add( self.typeformeschoice, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2598         
2599         self.m_staticline11 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2600         fgSizer1.Add( self.m_staticline11, 0, wx.EXPAND |wx.ALL, 5 )
2601         
2602         self.m_staticline12 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2603         fgSizer1.Add( self.m_staticline12, 0, wx.EXPAND |wx.ALL, 5 )        
2604         
2605         self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Taille du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
2606         self.m_staticText6.Wrap( -1 )
2607         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2608         
2609         bSizer4 = wx.BoxSizer( wx.VERTICAL )
2610         
2611         bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
2612         
2613         self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Min", wx.DefaultPosition, wx.DefaultSize, 0 )
2614         self.m_staticText7.Wrap( -1 )
2615         bSizer5.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2616         
2617         self.spin_mincex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 5 )
2618         bSizer5.Add( self.spin_mincex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
2619         
2620         bSizer4.Add( bSizer5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2621         
2622         bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
2623         
2624         self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Max", wx.DefaultPosition, wx.DefaultSize, 0 )
2625         self.m_staticText8.Wrap( -1 )
2626         bSizer6.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2627         
2628         self.spin_maxcex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 50 )
2629         bSizer6.Add( self.spin_maxcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2630         
2631         bSizer4.Add( bSizer6, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2632         
2633         fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
2634         
2635         self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2636         fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
2637         
2638         self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2639         fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
2640         
2641         bSizer61 = wx.BoxSizer( wx.HORIZONTAL )
2642         
2643         self.m_staticText81 = wx.StaticText( self, wx.ID_ANY, u"Couleur du texte", wx.DefaultPosition, wx.DefaultSize, 0 )
2644         self.m_staticText81.Wrap( -1 )
2645         bSizer61.Add( self.m_staticText81, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2646         
2647         self.color_text = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
2648         bSizer61.Add( self.color_text, 0, wx.ALL, 5 )
2649         
2650         fgSizer1.Add( bSizer61, 1, wx.EXPAND, 5 )
2651         
2652         bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
2653         
2654         self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Couleur du fond", wx.DefaultPosition, wx.DefaultSize, 0 )
2655         self.m_staticText9.Wrap( -1 )
2656         bSizer7.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2657         
2658         self.color_bg = wx.ColourPickerCtrl( self, wx.ID_ANY, (255,255,255), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
2659         bSizer7.Add( self.color_bg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2660         
2661         fgSizer1.Add( bSizer7, 1, wx.EXPAND, 5 )
2662         
2663         self.m_staticline9 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2664         fgSizer1.Add( self.m_staticline9, 0, wx.EXPAND |wx.ALL, 5 )
2665         
2666         self.m_staticline10 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
2667         fgSizer1.Add( self.m_staticline10, 0, wx.EXPAND |wx.ALL, 5 )
2668
2669         fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
2670         
2671         m_sdbSizer1 = wx.StdDialogButtonSizer()
2672         self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2673         m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2674         self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2675         m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2676         m_sdbSizer1.Realize();
2677         fgSizer1.Add( m_sdbSizer1, 1, wx.EXPAND, 5 )
2678         
2679         self.SetSizer( fgSizer1 )
2680         self.Layout()
2681         fgSizer1.Fit( self )
2682         
2683         self.Centre( wx.BOTH )
2684     
2685     def __del__( self ):
2686         pass
2687     
2688 class PrefChi(sc.SizedDialog):
2689     def __init__(self, parent, ID, optionchi, title):
2690
2691         sc.SizedDialog.__init__(self, None, -1, u"Paramètres", 
2692                         style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
2693         pane = self.GetContentsPane()
2694         pane.SetSizerType("form")
2695         pane.SetSizerProps(border=("all",5))
2696         self.parent = parent
2697         self.optionchi = optionchi
2698         
2699
2700         self.label_obs = wx.StaticText(pane, -1, u'valeurs observée')
2701         self.check1 = wx.CheckBox(pane, -1)
2702  
2703         self.label_theo = wx.StaticText(pane, -1, u'valeurs théoriques')
2704         self.check2 = wx.CheckBox(pane, -1)
2705
2706         self.label_resi = wx.StaticText(pane, -1, u'residuals')
2707         self.check3 = wx.CheckBox(pane, -1)
2708
2709         self.label_contrib = wx.StaticText(pane, -1, u'contributions a posteriori')
2710         self.check4 = wx.CheckBox(pane, -1)
2711 #        self.label_graph = wx.StaticText(pane, -1, u'graphique')
2712 #        self.check8 = wx.CheckBox(pane, -1)
2713         self.label_pourcent = wx.StaticText(pane, -1, u'pourcentage total')
2714         self.check5 = wx.CheckBox(pane, -1)
2715
2716         self.label_prl = wx.StaticText(pane, -1, u'pourcentages en ligne')
2717         self.check6 = wx.CheckBox(pane, -1)
2718
2719         self.label_prc = wx.StaticText(pane, -1, u'pourcentages en colonne')
2720         self.check7 = wx.CheckBox(pane, -1)
2721
2722         self.label_graph = wx.StaticText(pane, -1, u'graphique')
2723         self.check8 = wx.CheckBox(pane, -1)
2724         
2725         self.label_graphbw = wx.StaticText(pane, -1, u'graphique en noir et blanc')
2726         self.checkbw = wx.CheckBox(pane, -1)
2727
2728         self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL))
2729
2730         self.__set_properties()
2731         self.Fit()
2732         self.SetMinSize(self.GetSize())
2733
2734     def __set_properties(self):
2735         self.check1.SetValue(self.optionchi['valobs'])
2736         self.check2.SetValue(self.optionchi['valtheo'])
2737         self.check3.SetValue(self.optionchi['resi'])
2738         self.check4.SetValue(self.optionchi['contrib'])
2739         self.check5.SetValue(self.optionchi['pourcent'])
2740         self.check6.SetValue(self.optionchi['pourcentl'])
2741         self.check7.SetValue(self.optionchi['pourcentc'])
2742         self.check8.SetValue(self.optionchi['graph'])
2743         self.checkbw.SetValue(self.optionchi['bw'])
2744
2745 class ChiDialog(wx.Dialog):
2746     def __init__(
2747             self, parent, ID, title, optionchi, size=wx.DefaultSize, pos=wx.DefaultPosition, 
2748             style=wx.DEFAULT_DIALOG_STYLE
2749             ):
2750
2751         pre = wx.PreDialog()
2752         pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
2753         pre.Create(parent, ID, title, pos, size, style)
2754
2755         self.PostCreate(pre)
2756         self.parent = parent 
2757         self.optionchi = optionchi
2758         self.chiopt = False
2759         #self.Filename=parent.filename
2760         #self.content=parent.content[:]
2761         self.headers=parent.tableau.get_colnames()
2762         LABELLIST=[]
2763         
2764         for i in self.headers:
2765             if len(i)>60 :
2766                 LABELLIST.append(i[0:60])
2767             else:
2768                 LABELLIST.append(i)
2769         
2770         self.ListOK=[]
2771         self.LabelListOK=LABELLIST
2772  
2773         self.list_box_1 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2774         self.list_box_2 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2775         self.button_1 = wx.Button(self, wx.ID_OK)
2776         self.button_cancel = wx.Button(self, wx.ID_CANCEL)
2777         self.button_pref = wx.Button(self, wx.ID_PREFERENCES)
2778         self.__set_properties()
2779         self.__do_layout()
2780
2781         self.Bind(wx.EVT_LISTBOX, self.Select1, self.list_box_1)
2782         self.Bind(wx.EVT_BUTTON, self.onparam, self.button_pref)
2783         # end wxGlade
2784 #-------------------------------
2785     def __set_properties(self):
2786         # begin wxGlade: ConfChi2.__set_properties
2787         self.SetTitle(u"Sélection des variables")
2788
2789     def __do_layout(self):
2790         # begin wxGlade: ConfChi2.__do_layout
2791         sizer_1 = wx.BoxSizer(wx.VERTICAL)
2792         sizer_2 = wx.BoxSizer(wx.VERTICAL)
2793         sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
2794         sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
2795         sizer_3.Add(self.list_box_1, 0, wx.EXPAND, 0)
2796         sizer_3.Add(self.list_box_2, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 0)
2797         sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
2798         sizer_4.Add(self.button_cancel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2799         sizer_4.Add(self.button_pref, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2800         sizer_4.Add(self.button_1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2801         sizer_2.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
2802         sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
2803         self.SetSizer(sizer_1)
2804         sizer_1.Fit(self)
2805         self.Layout()
2806         # end wxGlade
2807
2808     def Select1(self, event): # wxGlade: ConfChi2.<event_handler>
2809         event.Skip()
2810     
2811     
2812     def onparam(self,event):
2813         self.dial = PrefChi(self.parent, -1, self.optionchi, '')
2814         self.dial.CenterOnParent()
2815         self.chiopt = self.dial.ShowModal()
2816
2817 class CorpusPref ( wx.Dialog ):
2818     
2819     def __init__( self, parent, parametres ):
2820         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 )
2821         self.parent = parent 
2822         langues_n = [u'français', u'english', u'german (expérimentale)', u'italian (expérimentale)', u'swedish (exp.)', u'portuguese (exp.)', 'greek', 'other...']
2823         self.langues = [u'french', u'english', u'german', 'italian', 'swedish', u'portuguese', 'greek', 'other']
2824         self.encodages = [enc[0].lower() for enc in encodages]
2825
2826         ucimark = [u'****', u'0000']
2827         ucemethod = [u'charactères', u'occurrences', u'paragraphe']
2828
2829         self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2830         
2831         bSizer1 = wx.BoxSizer( wx.VERTICAL )
2832         
2833         self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
2834         self.m_panel1 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2835         fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2836         fgSizer1.SetFlexibleDirection( wx.BOTH )
2837         fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2838         
2839         self.m_staticText7 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Corpus", wx.DefaultPosition, wx.DefaultSize, 0 )
2840         self.m_staticText7.Wrap( -1 )
2841         fgSizer1.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2842         
2843         self.txtpath = wx.StaticText( self.m_panel1, wx.ID_ANY, u"path", wx.DefaultPosition, wx.DefaultSize, 0 )
2844         self.txtpath.Wrap( -1 )
2845         fgSizer1.Add( self.txtpath, 0, wx.ALL, 5 )
2846         
2847         self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Encodage", wx.DefaultPosition, wx.DefaultSize, 0 )
2848         self.m_staticText1.Wrap( -1 )
2849         fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2850         
2851         encodage_choicesChoices = [' - '.join(encodage) for encodage in encodages]
2852         self.encodage_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, encodage_choicesChoices, 0 )
2853         self.encodage_choices.SetSelection( 0 )
2854         fgSizer1.Add( self.encodage_choices, 0, wx.ALL, 5 )
2855         
2856         self.m_staticText2 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Langue", wx.DefaultPosition, wx.DefaultSize, 0 )
2857         self.m_staticText2.Wrap( -1 )
2858         fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2859         
2860         lang_choicesChoices = langues_n
2861         self.lang_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, lang_choicesChoices, 0 )
2862         self.lang_choices.SetSelection( 0 )
2863         fgSizer1.Add( self.lang_choices, 0, wx.ALL, 5 )
2864
2865         self.m_staticText3 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Répertoire en sortie", wx.DefaultPosition, wx.DefaultSize, 0 )
2866         self.m_staticText3.Wrap( -1 )
2867         fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2868         
2869         
2870         fgSizer41 = wx.FlexGridSizer( 0, 2, 0, 0 )
2871         fgSizer41.SetFlexibleDirection( wx.BOTH )
2872         fgSizer41.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2873         
2874         self.repout_choices = wx.TextCtrl( self.m_panel1, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0 )
2875         self.repout_choices.SetMinSize( wx.Size( 400,-1 ) )
2876         fgSizer41.Add( self.repout_choices, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2877         
2878         self.m_button1 = wx.Button( self.m_panel1, wx.ID_ANY, u"Modifier...", wx.DefaultPosition, wx.DefaultSize, 0 )
2879         fgSizer41.Add( self.m_button1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2880         
2881         fgSizer1.Add( fgSizer41, 1, wx.EXPAND, 5 )        
2882
2883         self.m_staticText12 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Marqueur d'UCI", wx.DefaultPosition, wx.DefaultSize, 0 )
2884         self.m_staticText12.Wrap( -1 )
2885         fgSizer1.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2886         
2887         ucimark_choicesChoices = ucimark
2888         self.ucimark_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ucimark_choicesChoices, 0 )
2889         self.ucimark_choices.SetSelection( 0 )
2890         fgSizer1.Add( self.ucimark_choices, 0, wx.ALL, 5 )
2891         
2892         self.m_staticText6 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Utiliser le dictionnaire des expressions", wx.DefaultPosition, wx.DefaultSize, 0 )
2893         self.m_staticText6.Wrap( -1 )
2894         fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2895         
2896         self.check_expressions = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2897         self.check_expressions.SetValue(True) 
2898         fgSizer1.Add( self.check_expressions, 0, wx.ALL, 5 )
2899         
2900         self.m_staticText9 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Construire des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2901         self.m_staticText9.Wrap( -1 )
2902         fgSizer1.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2903         
2904         self.check_makeuce = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2905         self.check_makeuce.SetValue(True) 
2906         fgSizer1.Add( self.check_makeuce, 0, wx.ALL, 5 )
2907         
2908         self.m_staticText10 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Mode de construction des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2909         self.m_staticText10.Wrap( -1 )
2910         fgSizer1.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2911         
2912         uce_modeChoices = ucemethod
2913         self.uce_mode = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, uce_modeChoices, 0 )
2914         self.uce_mode.SetSelection( 0 )
2915         fgSizer1.Add( self.uce_mode, 0, wx.ALL, 5 )
2916         
2917         self.m_staticText13 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Taille des UCE", wx.DefaultPosition, wx.DefaultSize, 0 )
2918         self.m_staticText13.Wrap( -1 )
2919         fgSizer1.Add( self.m_staticText13, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2920         
2921         self.uce_size = wx.SpinCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 1000000, 40 )
2922         fgSizer1.Add( self.uce_size, 0, wx.ALL, 5 )
2923         
2924         
2925         self.m_panel1.SetSizer( fgSizer1 )
2926         self.m_panel1.Layout()
2927         fgSizer1.Fit( self.m_panel1 )
2928         self.m_notebook1.AddPage( self.m_panel1, u"Générale", True )
2929         self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2930         fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
2931         fgSizer3.SetFlexibleDirection( wx.BOTH )
2932         fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2933         
2934         self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Passer le corpus en minuscule", wx.DefaultPosition, wx.DefaultSize, 0 )
2935         self.m_staticText4.Wrap( -1 )
2936         fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2937         
2938         self.check_lower = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2939         self.check_lower.SetValue(True) 
2940         fgSizer3.Add( self.check_lower, 0, wx.ALL, 5 )
2941         
2942         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 )
2943         self.m_staticText5.Wrap( -1 )
2944         fgSizer3.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2945         
2946         fgSizer4 = wx.FlexGridSizer( 0, 2, 0, 0 )
2947         fgSizer4.SetFlexibleDirection( wx.BOTH )
2948         fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2949         
2950         self.check_charact = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2951         self.check_charact.SetValue(True) 
2952         fgSizer4.Add( self.check_charact, 0, wx.ALL, 5 )
2953         
2954         self.txt_charact = wx.TextCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2955         self.txt_charact.SetMinSize( wx.Size( 200,-1 ) )
2956         
2957         fgSizer4.Add( self.txt_charact, 0, wx.ALL|wx.EXPAND, 5 )
2958         
2959         
2960         fgSizer3.Add( fgSizer4, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2961         
2962         self.m_staticText14 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Remplacer les apostrophes par des espaces", wx.DefaultPosition, wx.DefaultSize, 0 )
2963         self.m_staticText14.Wrap( -1 )
2964         fgSizer3.Add( self.m_staticText14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2965         
2966         self.check_apos = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2967         self.check_apos.SetValue(True) 
2968         fgSizer3.Add( self.check_apos, 0, wx.ALL, 5 )
2969         
2970         self.m_staticText15 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Remplacer les tirets par des espaces", wx.DefaultPosition, wx.DefaultSize, 0 )
2971         self.m_staticText15.Wrap( -1 )
2972         fgSizer3.Add( self.m_staticText15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2973         
2974         self.check_tirets = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2975         self.check_tirets.SetValue(True) 
2976         fgSizer3.Add( self.check_tirets, 0, wx.ALL, 5 )
2977         
2978         self.m_staticText17 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Conserver la ponctuation", wx.DefaultPosition, wx.DefaultSize, 0 )
2979         self.m_staticText17.Wrap( -1 )
2980         fgSizer3.Add( self.m_staticText17, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2981         
2982         self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2983         fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 )
2984
2985         self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, u"Pas d'espace entre deux formes", wx.DefaultPosition, wx.DefaultSize, 0 )
2986         self.m_staticText16.Wrap( -1 )
2987         fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2988         
2989         self.check_tolist = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2990         fgSizer3.Add( self.check_tolist, 0, wx.ALL, 5 )
2991         
2992         
2993         self.m_panel2.SetSizer( fgSizer3 )
2994         self.m_panel2.Layout()
2995         fgSizer3.Fit( self.m_panel2 )
2996         self.m_notebook1.AddPage( self.m_panel2, u"Nettoyage", False )
2997         
2998         bSizer1.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
2999         
3000         m_sdbSizer1 = wx.StdDialogButtonSizer()
3001         self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
3002         m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
3003         self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
3004         m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
3005         m_sdbSizer1.Realize();
3006         
3007         bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
3008        
3009
3010         self.Bind(wx.EVT_BUTTON, self.OnChangeDir, self.m_button1)
3011         self.setparametres(parametres) 
3012         self.SetSizer( bSizer1 )
3013         self.Layout()
3014         bSizer1.Fit( self )
3015         
3016         self.Centre( wx.BOTH )
3017
3018     def OnChangeDir(self, evt) :
3019         dlg = wx.DirDialog(self.parent, u"Choisissez un répertoire", style = wx.DD_DEFAULT_STYLE)
3020         if dlg.ShowModal() == wx.ID_OK :
3021             self.repout_choices.SetValue(dlg.GetPath())
3022     
3023     def __del__( self ):
3024         pass
3025
3026     def setparametres(self, parametres) :
3027         if  locale.getpreferredencoding().lower() == 'mac-roman' :
3028             enc = self.encodages.index('macroman')
3029         else :
3030             enc = self.encodages.index(locale.getpreferredencoding().lower())
3031         self.encodage_choices.SetSelection(enc)
3032         self.lang_choices.SetSelection(0)
3033         self.repout_choices.SetValue(parametres['pathout'])
3034         self.ucimark_choices.SetSelection(parametres['ucimark'])
3035         self.check_expressions.SetValue(parametres['expressions'])
3036         self.check_makeuce.SetValue(parametres['douce'])
3037         self.uce_mode.SetSelection(parametres['ucemethod'])
3038         self.uce_size.SetValue(parametres['ucesize'])
3039         self.check_lower.SetValue(parametres['lower'])
3040         #self.check_charact.SetValue(parametres['charact'])
3041         self.txt_charact.SetValue(parametres['keep_caract'])
3042         self.check_apos.SetValue(parametres['apos'])
3043         self.check_tirets.SetValue(parametres['tiret'])
3044         self.check_tolist.SetValue(parametres['tolist'])
3045         self.check_ponct.SetValue(parametres['keep_ponct'])
3046
3047     def doparametres(self) :
3048         parametres = {}
3049         parametres['encoding'] = encodages[self.encodage_choices.GetSelection()][0]
3050         parametres['lang'] = self.langues[self.lang_choices.GetSelection()]
3051         parametres['pathout'] = self.repout_choices.GetValue()
3052         parametres['ucimark'] = self.ucimark_choices.GetSelection()
3053         parametres['expressions'] = self.check_expressions.GetValue()
3054         parametres['douce'] =  self.check_makeuce.GetValue()
3055         parametres['ucemethod'] = self.uce_mode.GetSelection()
3056         parametres['ucesize'] = self.uce_size.GetValue()
3057         parametres['lower'] = self.check_lower.GetValue()
3058         parametres['charact'] = self.check_charact.GetValue()
3059         parametres['keep_caract'] = self.txt_charact.GetValue()
3060         parametres['apos'] = self.check_apos.GetValue()
3061         parametres['tiret'] = self.check_tirets.GetValue()
3062         parametres['tolist'] = self.check_tolist.GetValue()
3063         parametres['keep_ponct'] = self.check_ponct.GetValue()
3064         for val in parametres :
3065             if isinstance(parametres[val], bool) :
3066                 if parametres[val] :
3067                     parametres[val] = 1
3068                 else :
3069                     parametres[val] = 0
3070         return parametres