2 # -*- coding: utf-8 -*-
3 #Author: Pierre Ratinaud
4 #Copyright (c) 2008-2009 Pierre Ratinaud
7 import wx.lib.colourselect as csel
8 import wx.lib.sized_controls as sc
9 import wx.lib.filebrowsebutton as filebrowse
11 from functions import DoConf
14 from KeyFrame import AlcOptFrame
15 #---------------------------------------------------------------------------
16 provider = wx.SimpleHelpProvider()
17 wx.HelpProvider_Set(provider)
19 #---------------------------------------------------------------------------
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']]
24 class FileOptionDialog(wx.Dialog):
26 self, parent, ID, title, sep=False, sheet = False, size=wx.DefaultSize, pos=wx.DefaultPosition,
27 style=wx.DEFAULT_DIALOG_STYLE
31 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
32 pre.Create(parent, ID, title, pos, size, style)
36 sizer = wx.BoxSizer(wx.VERTICAL)
37 grid_sizer = wx.FlexGridSizer(0, 2, 2, 2)
38 ##############################
40 label = wx.StaticText(self, -1, _(u"First line is header").decode('utf8'))
41 label.SetHelpText(_(u"First line is header").decode('utf8'))
42 grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
43 on = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
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"First line is header").decode('utf8'))
46 grid_sizer.Add(self.radio_box_1, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
48 ##############################
50 label = wx.StaticText(self, -1, _(u"First column is an id").decode('utf8'))
51 label.SetHelpText(_(u"First column is an id").decode('utf8'))
52 grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
53 on = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
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"First column is an id").decode('utf8'))
56 grid_sizer.Add(self.radio_box_2, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
58 ##############################
60 label = wx.StaticText(self, -1, _(u"Column separator").decode('utf8'))
61 label.SetHelpText(_(u"Column separator").decode('utf8'))
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"Column separator").decode('utf8'))
66 grid_sizer.Add(self.choice3, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
68 ##############################
70 label = wx.StaticText(self, -1, _(u"Text separator").decode('utf8'))
71 label.SetHelpText(_(u"Text separator").decode('utf8'))
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"Text separator").decode('utf8'))
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"Character set").decode('utf8'))
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')
87 enc = self.le.index(sys.getdefaultencoding().lower())
89 enc = self.le.index('utf-8')
90 self.list_encodages.SetSelection(enc)
91 grid_sizer.Add(self.list_encodages, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
93 label = wx.StaticText(self, -1, u"Feuille ")
94 grid_sizer.Add(label, 0, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
95 self.spin1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=500)
96 grid_sizer.Add(self.spin1, 1, wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
98 sizer.Add(grid_sizer, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
101 line = wx.StaticLine(self, -1, size=(20, -1), style=wx.LI_HORIZONTAL)
102 sizer.Add(line, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.RIGHT | wx.TOP, 5)
104 btnsizer = wx.StdDialogButtonSizer()
106 if wx.Platform != "__WXMSW__":
107 btn = wx.ContextHelpButton(self)
108 btnsizer.AddButton(btn)
110 btn = wx.Button(self, wx.ID_OK)
112 btnsizer.AddButton(btn)
114 btn = wx.Button(self, wx.ID_CANCEL)
115 btnsizer.AddButton(btn)
118 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
124 class ClusterNbDialog(wx.Dialog):
126 self, LIST_CLASSE, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
127 style=wx.DEFAULT_DIALOG_STYLE
131 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
132 pre.Create(parent, ID, title, pos, size, style)
136 # Now continue with the normal construction of the dialog
138 sizer = wx.BoxSizer(wx.VERTICAL)
140 label = wx.StaticText(self, -1, u"Résultats de la classification")
141 label.SetHelpText("This is the help text for the label")
142 sizer.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
144 box = wx.BoxSizer(wx.HORIZONTAL)
146 label = wx.StaticText(self, -1, u"Choisissez le nombre de classes")
147 label.SetHelpText("This is the help text for the label")
148 box.Add(label, 0, wx.ALIGN_CENTRE | wx.ALL, 5)
150 if type(LIST_CLASSE) != float :
151 for i in LIST_CLASSE :
152 LIST_CLASSE_OK.append(str(i))
154 LIST_CLASSE_OK.append(str(LIST_CLASSE))
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)
159 sizer.Add(box, 0, wx.GROW | wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
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)
166 btnsizer = wx.StdDialogButtonSizer()
168 if wx.Platform != "__WXMSW__":
169 btn = wx.ContextHelpButton(self)
170 btnsizer.AddButton(btn)
172 btn = wx.Button(self, wx.ID_OK)
174 btnsizer.AddButton(btn)
176 btn = wx.Button(self, wx.ID_CANCEL)
177 btnsizer.AddButton(btn)
180 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 5)
185 class CHDDialog(wx.Dialog):
187 self, parent, ID, title, size=wx.DefaultSize, pos=wx.DefaultPosition,
188 style=wx.DEFAULT_DIALOG_STYLE | wx.CANCEL
191 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
192 pre.Create(parent, ID, title, pos, size, style)
196 self.colsep = parent.colsep
198 self.content = parent.content[:]
199 self.header = parent.header[:]
201 for i in self.header:
203 LABELLIST.append(i[0:60])
206 self.LABELLISTTOT = LABELLIST
208 #----------------------------------------------------------------------------------------------------
209 self.text1 = wx.StaticText(self, -1, u"Variables Actives (au moins 3)")
210 self.text2 = wx.StaticText(self, -1, u"Variables Supplémentaires (au moins 1)")
211 self.list_box_1 = wx.ListBox(self, -1, choices=LABELLIST, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
212 self.list_box_2 = wx.ListBox(self, -1, choices=LABELLIST, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
213 self.button_cancel = wx.Button(self, wx.ID_CANCEL)
214 self.button_back = wx.Button(self, wx.ID_BACKWARD)
215 self.button_forw = wx.Button(self, wx.ID_FORWARD)
216 self.button_ok = wx.Button(self, wx.ID_OK)
217 self.button_pref = wx.Button(self, wx.ID_PROPERTIES)
218 self.button_selectall = wx.Button(self, wx.NewId(), u"Sélectionner tout")
219 self.__set_properties()
222 self.Bind(wx.EVT_BUTTON, self.OnPrec, self.button_back)
223 self.Bind(wx.EVT_BUTTON, self.OnSuivant, self.button_forw)
224 self.Bind(wx.EVT_BUTTON, self.OnValider, self.button_ok)
225 self.Bind(wx.EVT_BUTTON, self.OnSelectAll, self.button_selectall)
228 self.TEMPDIR = parent.TEMPDIR
231 def __set_properties(self):
232 # begin wxGlade: ConfChi2.__set_properties
233 self.SetTitle(u"Sélection des variables")
234 self.list_box_2.Enable(False)
235 self.button_ok.Enable(False)
236 self.button_back.Enable(False)
239 def __do_layout(self):
240 # begin wxGlade: ConfChi2.__do_layout
241 sizer_1 = wx.BoxSizer(wx.VERTICAL)
242 sizer_2 = wx.BoxSizer(wx.VERTICAL)
243 sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
244 sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
245 sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
246 sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
247 sizer_7 = wx.BoxSizer(wx.HORIZONTAL)
248 sizer_5.Add(self.text1, 1, wx.CENTER | wx.ALL, 0)
249 sizer_5.Add(self.text2, 1, wx.CENTER | wx.ALL, 0)
250 sizer_3.Add(self.list_box_1, 0, wx.EXPAND, 0)
251 sizer_3.Add(self.list_box_2, 0, wx.EXPAND, 0)
252 sizer_6.Add(self.button_selectall, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 0)
253 sizer_7.Add(self.button_cancel, 0, wx.ALL, 0)
254 sizer_7.Add(self.button_pref, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
255 sizer_7.Add(self.button_ok, 0, wx.wx.ALIGN_CENTER_HORIZONTAL, 0)
256 sizer_4.Add(self.button_back, 0, wx.ALL, 0)
257 sizer_4.Add(self.button_forw, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
258 sizer_2.Add(sizer_5, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
259 sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
260 sizer_2.Add(sizer_6, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
261 sizer_2.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
262 sizer_2.Add(sizer_7, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
263 sizer_1.Add(sizer_2, 1, wx.EXPAND, 4)
264 self.SetSizer(sizer_1)
268 #--------------FIXME-----------------------
269 #NETTOYAGE des variables inutiles
270 def OnSuivant(self, event):
271 LISTACTIVE = self.list_box_1.GetSelections()
272 if len(LISTACTIVE) != len(self.LABELLISTTOT) and len(LISTACTIVE) >= 3:
273 self.button_ok.Enable(True)
275 self.LISTHEADERINDICE = []
276 self.LISTNUMACTIVE = []
278 header = self.header[:]
279 for i in range(0, len(header)):
280 self.LISTHEADERINDICE.append(i)
281 for i in LISTACTIVE :
282 self.LISTNUMACTIVE.append(i)
283 header.pop(i - COMPT)
284 self.LISTHEADERINDICE.pop(i - COMPT)
289 self.LABELLIST.append(i[0:60])
291 self.LABELLIST.append(i)
292 self.list_box_2.Clear()
293 for i in self.LABELLIST :
294 self.list_box_2.Append(i)
296 self.list_box_1.Enable(False)
297 self.list_box_2.Enable(True)
298 self.button_forw.Enable(False)
299 self.button_back.Enable(True)
301 def OnValider(self, event):
302 LISTVARSUPSEL = self.list_box_2.GetSelections()
303 for i in LISTVARSUPSEL :
304 self.LISTVARSUP.append(self.LISTHEADERINDICE[i])
307 def OnPrec(self, event):
308 self.list_box_1.Enable(True)
309 self.list_box_2.Enable(False)
310 self.button_forw.Enable(True)
311 self.button_back.Enable(False)
312 self.button_ok.Enable(False)
316 def OnSelectAll(self, event):
318 for i in range(len(self.LABELLISTTOT)):
319 self.list_box_1.Select(i)
321 for i in range(len(self.LABELLIST)):
322 self.list_box_2.Select(i)
324 class PrefDialog ( wx.Dialog ):
326 def __init__( self, parent ):
327 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Settings").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
330 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
332 bSizer1 = wx.BoxSizer( wx.VERTICAL )
334 fgSizer1 = wx.FlexGridSizer( 0, 3, 0, 0 )
335 fgSizer1.SetFlexibleDirection( wx.BOTH )
336 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
338 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Play a sound at the end of analysis").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
339 self.m_staticText1.Wrap( -1 )
340 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
342 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
343 self.m_staticText2.Wrap( -1 )
344 fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
346 m_radioBox1Choices = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
347 self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
348 self.m_radioBox1.SetSelection( 0 )
349 fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
351 msg = _(u"""Check for new
352 releases at startup""").decode('utf8')
353 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
354 self.m_staticText3.Wrap( -1 )
355 fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
357 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
358 self.m_staticText4.Wrap( -1 )
359 fgSizer1.Add( self.m_staticText4, 0, wx.ALL, 5 )
361 m_radioBox2Choices = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
362 self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
363 self.m_radioBox2.SetSelection( 0 )
364 fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
366 msg = _(u"Interface language").decode('utf8')
367 self.m_staticText45 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
368 self.m_staticText45.Wrap( -1 )
369 fgSizer1.Add( self.m_staticText45, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
371 self.m_staticText46 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
372 self.m_staticText46.Wrap( -1 )
373 fgSizer1.Add( self.m_staticText46, 0, wx.ALL, 5 )
375 self.listlangues = [ u"french", u"english", u"spanish", u"portuguese", u"italian" ]
376 self.langues = wx.Choice( self, wx.ID_ANY, (200, -1), choices = self.listlangues)
377 #self.langues.SetSelection( 0 )
378 fgSizer1.Add( self.langues, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
380 msg = _(u"""Check installation
381 of R packages""").decode('utf8')
382 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
383 self.m_staticText5.Wrap( -1 )
384 fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
386 self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
387 self.m_staticText6.Wrap( -1 )
388 fgSizer1.Add( self.m_staticText6, 0, wx.ALL, 5 )
390 self.m_button1 = wx.Button( self, wx.ID_ANY, _(u"Check").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
391 fgSizer1.Add( self.m_button1, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
393 bSizer1.Add( fgSizer1, 1, wx.EXPAND, 5 )
394 if sys.platform == 'win32' :
395 bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
398 memory for R""").decode('utf8')
399 self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, msg, wx.DefaultPosition, wx.DefaultSize, 0 )
400 self.m_staticText7.Wrap( -1 )
401 bSizer2.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
403 self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
404 bSizer2.Add( self.m_checkBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
406 self.m_spinCtrl1 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 32, 16000, 1535 )
407 bSizer2.Add( self.m_spinCtrl1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
409 self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
410 bSizer2.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
412 bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
413 self.m_checkBox1.Bind( wx.EVT_CHECKBOX, self.oncheckmem )
415 bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
416 bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
417 self.text8 = wx.StaticText( self, wx.ID_ANY, _(u"Use svdlibc").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
418 self.text8.Wrap( -1 )
419 fgSizer1.Add( self.text8, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
420 self.check_svdc = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
421 bSizer4.Add( self.check_svdc, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
422 bSizer3.Add( bSizer4, 0, wx.EXPAND, 5 )
423 self.fbb = filebrowse.FileBrowseButton(self, -1, size=(250, -1), fileMode = 2, fileMask = '*')
424 bSizer3.Add( self.fbb, 0, wx.EXPAND, 5 )
425 self.fbb.SetLabel(_(u"Path : ").decode('utf8'))
426 fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ), wx.ID_ANY, wx.ALL, 5)
427 fgSizer1.Add( bSizer3, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
429 Rpath_text = wx.StaticText( self, wx.ID_ANY, _(u"R path").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
430 Rpath_text.Wrap( -1 )
431 fgSizer1.Add( Rpath_text, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
432 fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ), wx.ID_ANY, wx.ALL, 5)
433 self.Rpath_value = filebrowse.FileBrowseButton(self, -1, size=(350, -1), fileMode = 2, fileMask = '*')
434 self.Rpath_value.SetLabel(_(u"Path : ").decode('utf8'))
435 fgSizer1.Add( self.Rpath_value, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
437 mirror_text = wx.StaticText( self, wx.ID_ANY, _(u"Default R mirror").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
438 mirror_text.Wrap( -1 )
439 fgSizer1.Add( mirror_text, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
440 fgSizer1.Add( wx.StaticText(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 ), wx.ID_ANY, wx.ALL, 5)
441 self.mirror_value = wx.TextCtrl( self, wx.ID_ANY, u'http://cran.univ-lyon1.fr', wx.DefaultPosition, wx.Size( 300,30 ), 0 )
442 fgSizer1.Add( self.mirror_value, 0, wx.ALIGN_RIGHT|wx.ALL, 5 )
445 m_sdbSizer1 = wx.StdDialogButtonSizer()
446 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
447 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
448 self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
449 m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
450 m_sdbSizer1.Realize()
451 bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
453 self.SetSizer( bSizer1 )
457 self.Centre( wx.BOTH )
460 self.m_sdbSizer1OK.Bind( wx.EVT_BUTTON, self.OnValid )
461 self.m_button1.Bind( wx.EVT_BUTTON, parent.OnVerif )
462 self.check_svdc.Bind( wx.EVT_CHECKBOX, self.OnSVDC )
463 self.__set_properties()
465 def __set_properties(self):
466 self.SetTitle(_(u"Settings").decode('utf8'))
467 if self.parent.pref.getboolean('iramuteq', 'sound'): val1 = 0
469 self.m_radioBox1.SetSelection(val1)
470 if self.parent.pref.getboolean('iramuteq', 'checkupdate') : val2 = 0
472 self.m_radioBox2.SetSelection(val2)
473 self.langues.SetSelection(self.listlangues.index(self.parent.pref.get('iramuteq', 'guilanguage')))
474 if sys.platform == 'win32' :
475 if self.parent.pref.getboolean('iramuteq', 'R_mem') :
476 self.m_checkBox1.SetValue(True)
477 self.m_spinCtrl1.Enable(True)
478 self.m_spinCtrl1.SetValue(self.parent.pref.getint('iramuteq', 'R_max_mem'))
480 self.m_checkBox1.SetValue(False)
481 self.m_spinCtrl1.Enable(False)
482 if self.parent.pref.getboolean('iramuteq', 'libsvdc') :
483 self.check_svdc.SetValue(True)
484 self.fbb.SetValue(self.parent.pref.get('iramuteq', 'libsvdc_path'))
486 self.check_svdc.SetValue(False)
487 self.fbb.SetValue(self.parent.pref.get('iramuteq', 'libsvdc_path'))
488 self.fbb.Enable(False)
489 self.Rpath_value.SetValue(self.parent.PathPath.get('PATHS', 'rpath'))
490 self.mirror_value.SetValue(self.parent.pref.get('iramuteq', 'rmirror'))
492 def oncheckmem(self, evt):
493 if self.m_checkBox1.GetValue() :
494 self.m_spinCtrl1.Enable(True)
496 self.m_spinCtrl1.Enable(False)
498 def OnSVDC(self, evt):
499 if self.check_svdc.GetValue() :
500 self.fbb.Enable(True)
502 self.fbb.Enable(False)
504 def OnValid(self, event):
506 if self.m_radioBox1.GetSelection() == 0 : valsound = 'true'
507 else : valsound = 'false'
508 parent.pref.set('iramuteq', 'sound', valsound)
509 if self.m_radioBox2.GetSelection() == 0 : valcheck = 'true'
510 else : valcheck = 'false'
511 parent.pref.set('iramuteq', 'checkupdate', valcheck)
512 parent.pref.set('iramuteq', 'guilanguage', self.listlangues[self.langues.GetSelection()])
513 if sys.platform == 'win32' :
514 if self.m_checkBox1.GetValue() :
515 parent.pref.set('iramuteq', 'R_mem', 'true')
516 parent.pref.set('iramuteq', 'R_max_mem', str(self.m_spinCtrl1.GetValue()))
518 parent.pref.set('iramuteq', 'R_mem', 'false')
519 if self.check_svdc.GetValue() :
520 parent.pref.set('iramuteq', 'libsvdc', 'true')
522 parent.pref.set('iramuteq', 'libsvdc', 'false')
523 parent.pref.set('iramuteq', 'libsvdc_path', self.fbb.GetValue())
524 self.parent.pref.set('iramuteq', 'rmirror', self.mirror_value.GetValue())
525 file = open(parent.ConfigPath['preferences'], 'w')
526 parent.pref.write(file)
528 self.parent.PathPath.set('PATHS', 'rpath', self.Rpath_value.GetValue())
529 with open(self.parent.ConfigPath['path'], 'w') as f:
530 self.parent.PathPath.write(f)
533 class PrefGraph(wx.Dialog):
534 def __init__(self, parent, ID, paramgraph, title = '', size=wx.DefaultSize, pos=wx.DefaultPosition, style=wx.DEFAULT_DIALOG_STYLE):
536 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
537 pre.Create(parent, ID, title, pos, size, style)
540 self.paramgraph=paramgraph
541 self.labeltype = wx.StaticText(self, -1, _(u"Graphic type").decode('utf8'))
542 if self.paramgraph['clnb'] <= 3 :
543 choix = [u'2D', 'web 2D']
545 choix=[u'2D' ,u'3D', 'web 2D', 'web 3D']
546 self.choicetype = wx.Choice(self, -1, (100,50), choices=choix)
547 self.label_format = wx.StaticText(self, -1, _(u"Picture format").decode('utf8'))
548 self.choix_format = wx.Choice(self, -1, (100,50), choices = ['png', 'svg'])
549 self.label_1 = wx.StaticText(self, -1, _(u"width").decode('utf8'))
550 self.spin1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=100, max=5000)
551 self.label_2 = wx.StaticText(self, -1, _(u"height").decode('utf8'))
552 self.spin2 = wx.SpinCtrl(self, -1, '', size = (100,30), min=100, max=5000)
553 self.label_what = wx.StaticText(self, -1, _(u"Representation").decode('utf8'))
554 self.choice1 = wx.Choice(self, -1, (100,50), choices=[_(u"coordinates").decode('utf8'),_(u"correlations").decode('utf8')])
555 self.label_qui = wx.StaticText(self, -1, u'Variables')
556 self.choice2 = wx.Choice(self, -1, (100,50), choices=[_(u"actives").decode('utf8') ,_(u"supplementaries").decode('utf8'), _(u"stars").decode('utf8'), _(u"clusters").decode('utf8')])
557 self.label_3 = wx.StaticText(self, -1, _(u"Text size").decode('utf8'))
558 self.spin3 = wx.SpinCtrl(self, -1, '', size = (100,30), min=1, max=20)
559 txt = _(u"Take the x first points").decode('utf8')
560 self.label_4 = wx.StaticText(self, -1, txt)
561 self.check1 = wx.CheckBox(self, -1)
562 self.spin_nb = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)
563 txt = _(u"Take the x first points by cluster").decode('utf8')
564 self.label_chic = wx.StaticText(self, -1, txt)
565 self.check_chic = wx.CheckBox(self, -1)
566 self.spin_nbchic = wx.SpinCtrl(self, -1, '', size = (100,30), min=2, max=1000)
567 txt = _(u"Limit points by cluster chi2").decode('utf8')
568 self.label_5 = wx.StaticText(self, -1, txt)
569 self.check2 = wx.CheckBox(self, -1)
570 self.spin_chi = wx.SpinCtrl(self, -1, '',size = (100,30), min=2, max=1000)
571 self.label_6 = wx.StaticText(self, -1, _(u"Avoid overlay").decode('utf8'))
572 self.check3 = wx.CheckBox(self, -1)
573 txt = _(u"Text size proportional to frequency").decode('utf8')
574 self.label_7 = wx.StaticText(self, -1, txt)
575 self.check4 = wx.CheckBox(self, -1)
576 self.label_min = wx.StaticText(self, -1, 'min')
577 self.spin_min = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
578 self.label_max = wx.StaticText(self, -1, 'max')
579 self.spin_max = wx.SpinCtrl(self, -1, '',size = (100,30), min = 1, max = 100)
580 txt = _(u"Text size proportional to chi2").decode('utf8')
581 self.label_tchi = wx.StaticText(self, -1, txt)
582 self.check_tchi = wx.CheckBox(self, -1)
583 self.label_min_tchi = wx.StaticText(self, -1, 'min')
584 self.spin_min_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
585 self.label_max_tchi = wx.StaticText(self, -1, 'max')
586 self.spin_max_tchi = wx.SpinCtrl(self, -1, '', size = (100,30), min = 1, max = 100)
587 self.label_8 = wx.StaticText(self, -1, _(u"Factor x : ").decode('utf8'))
588 self.spin_f1 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
589 self.label_9 = wx.StaticText(self, -1, _(u"Factor y : ").decode('utf8'))
590 self.spin_f2 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
591 self.label_f3 = wx.StaticText(self, -1, _(u"Factor z : ").decode('utf8'))
592 self.spin_f3 = wx.SpinCtrl(self, -1, '',size = (100,30), min=1, max=self.paramgraph['clnb']-1)
593 self.label_sphere = wx.StaticText(self, -1, _(u"Sphere transparency").decode('utf8'))
594 self.slider_sphere = wx.Slider(self, -1, 10, 1, 100, size = (255,-1), style = wx.SL_HORIZONTAL | wx.SL_AUTOTICKS | wx.SL_LABELS)
596 self.label_film = wx.StaticText(self, -1, _(u"Make a movie").decode('utf8'))
597 self.film = wx.CheckBox(self, -1)
599 self.btnsizer = wx.StdDialogButtonSizer()
600 if wx.Platform != "__WXMSW__":
601 btn = wx.ContextHelpButton(self)
602 self.btnsizer.AddButton(btn)
603 btn = wx.Button(self, wx.ID_OK)
605 self.btnsizer.AddButton(btn)
606 btn = wx.Button(self, wx.ID_CANCEL)
607 self.btnsizer.AddButton(btn)
608 self.btnsizer.Realize()
610 self.Bind(wx.EVT_CHECKBOX, self.OnCheck1, self.check1)
611 self.Bind(wx.EVT_CHECKBOX, self.OnCheck2, self.check2)
612 self.Bind(wx.EVT_CHECKBOX, self.OnNorm, self.check4)
613 self.Bind(wx.EVT_CHECKBOX, self.OnCheckTchi, self.check_tchi)
614 self.Bind(wx.EVT_CHOICE, self.On3D, self.choicetype)
615 self.Bind(wx.EVT_CHOICE, self.OnPass, self.choice2)
616 self.Bind(wx.EVT_CHECKBOX, self.OnCheckChic, self.check_chic)
617 self.__set_properties()
618 self.OnNorm(wx.EVT_CHECKBOX)
619 self.OnCheckTchi(wx.EVT_CHECKBOX)
622 def __set_properties(self):
623 self.choicetype.SetSelection(self.paramgraph['typegraph'])
624 if self.paramgraph['typegraph'] == 0 or self.paramgraph['typegraph'] == 2:
625 self.film.Enable(False)
626 self.spin_f3.Enable(False)
627 self.slider_sphere.Enable(False)
628 self.choix_format.SetSelection(self.paramgraph['svg'])
629 self.choice1.SetSelection(self.paramgraph['what'])
630 self.choice2.SetSelection(self.paramgraph['qui'])
631 self.spin_chi.SetValue(self.paramgraph['select_nb'])
632 self.spin_nb.SetValue(self.paramgraph['select_chi'])
633 self.spin1.SetValue(self.paramgraph['width'])
634 self.spin2.SetValue(self.paramgraph['height'])
635 self.spin3.SetValue(self.paramgraph['taillecar'])
636 self.spin_nb.SetValue(self.paramgraph['select_nb'])
637 self.spin_chi.SetValue(self.paramgraph['select_chi'])
638 self.spin_nbchic.SetValue(self.paramgraph['nbchic'])
639 self.check1.SetValue(self.paramgraph['do_select_nb'])
640 self.check2.SetValue(self.paramgraph['do_select_chi'])
641 self.check_chic.SetValue(self.paramgraph['do_select_chi_classe'])
642 self.check3.SetValue(self.paramgraph['over'])
643 if self.paramgraph['do_select_nb'] :
644 self.spin_nb.Enable(True)
645 self.spin_chi.Enable(False)
646 self.spin_nbchic.Enable(False)
647 elif self.paramgraph['do_select_chi_classe'] :
648 self.spin_nb.Enable(False)
649 self.spin_chi.Enable(False)
650 self.spin_nbchic.Enable(True)
651 elif self.paramgraph['do_select_chi'] :
652 self.spin_nb.Enable(False)
653 self.spin_chi.Enable(True)
654 self.spin_nbchic.Enable(False)
656 self.spin_nb.Enable(False)
657 self.spin_chi.Enable(False)
658 self.spin_nbchic.Enable(False)
661 self.check4.SetValue(self.paramgraph['cex_txt'])
662 self.spin_min.SetValue(self.paramgraph['txt_min'])
663 self.spin_max.SetValue(self.paramgraph['txt_max'])
664 self.check_tchi.SetValue(self.paramgraph['tchi'])
665 self.spin_min_tchi.SetValue(self.paramgraph['tchi_min'])
666 self.spin_max_tchi.SetValue(self.paramgraph['tchi_max'])
668 self.spin_f1.SetValue(self.paramgraph['facteur'][0])
669 self.spin_f2.SetValue(self.paramgraph['facteur'][1])
670 self.spin_f3.SetValue(self.paramgraph['facteur'][2])
671 self.slider_sphere.SetValue(self.paramgraph['alpha'])
673 def __do_layout(self):
674 sizer_2 = wx.BoxSizer(wx.VERTICAL)
675 fsizer = wx.FlexGridSizer(0,2,0,5)
676 grid_min = wx.FlexGridSizer(0, 2, 0, 0)
677 grid_max = wx.FlexGridSizer(0, 2, 0, 0)
678 grid_minmax = wx.FlexGridSizer(0, 2, 0, 0)
679 grid_min_tchi = wx.FlexGridSizer(0, 2, 0, 0)
680 grid_max_tchi = wx.FlexGridSizer(0, 2, 0, 0)
681 grid_minmax_tchi = wx.FlexGridSizer(0, 2, 0, 0)
683 sizer_3 = wx.BoxSizer(wx.VERTICAL)
685 fsizer.Add(self.labeltype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
686 fsizer.Add(self.choicetype, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
687 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
688 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
690 fsizer.Add(self.label_format, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
691 fsizer.Add(self.choix_format, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
692 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
693 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
695 fsizer.Add(self.label_what, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
696 fsizer.Add(self.choice1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
697 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
698 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
700 fsizer.Add(self.label_qui, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
701 fsizer.Add(self.choice2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
702 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
703 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
705 sizer_h1 = wx.BoxSizer(wx.HORIZONTAL)
706 sizer_h1.Add(self.label_1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
707 sizer_h1.Add(self.spin1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
708 fsizer.Add(sizer_h1, 0, wx.ALL, 5)
709 sizer_h2 = wx.BoxSizer(wx.HORIZONTAL)
710 sizer_h2.Add(self.label_2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
711 sizer_h2.Add(self.spin2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
712 fsizer.Add(sizer_h2, 0, wx.ALL, 5)
713 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
714 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
716 fsizer.Add(self.label_3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
717 fsizer.Add(self.spin3, 0, wx.ALL | wx.LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
718 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
719 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
721 fsizer.Add(self.label_4, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
722 sizer_nb = wx.BoxSizer(wx.HORIZONTAL)
723 sizer_nb.Add(self.check1, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
724 sizer_nb.Add(self.spin_nb, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
725 fsizer.Add(sizer_nb, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
726 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
727 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
729 fsizer.Add(self.label_chic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
730 sizer_nbchic = wx.BoxSizer(wx.HORIZONTAL)
731 sizer_nbchic.Add(self.check_chic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
732 sizer_nbchic.Add(self.spin_nbchic, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
733 fsizer.Add(sizer_nbchic, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
734 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
735 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
737 fsizer.Add(self.label_5, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
738 sizer_chi = wx.BoxSizer(wx.HORIZONTAL)
739 sizer_chi.Add(self.check2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
740 sizer_chi.Add(self.spin_chi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
741 fsizer.Add(sizer_chi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
742 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
743 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
745 fsizer.Add(self.label_6, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL| wx.ADJUST_MINSIZE, 5)
746 fsizer.Add(self.check3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL|wx.ADJUST_MINSIZE, 5)
747 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
748 fsizer.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
750 sizer_2.Add(fsizer, 0, wx.EXPAND, 0)
752 bsizer_1 = wx.FlexGridSizer(0,3,0,0)
753 bsizer_1.Add(self.label_7, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
754 bsizer_1.Add(self.check4, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
755 grid_min.Add(self.label_min, 0,wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
756 grid_min.Add(self.spin_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
757 grid_max.Add(self.label_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
758 grid_max.Add(self.spin_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
759 grid_minmax.Add(grid_min, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
760 grid_minmax.Add(grid_max, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
762 bsizer_1.Add(grid_minmax, 0, wx.ALL, 5)
764 bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
765 bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
766 bsizer_1.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
768 bsizer_1.Add(self.label_tchi, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
769 bsizer_1.Add(self.check_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5)
770 grid_min_tchi.Add(self.label_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
771 grid_min_tchi.Add(self.spin_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
772 grid_max_tchi.Add(self.label_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
773 grid_max_tchi.Add(self.spin_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
774 grid_minmax_tchi.Add(grid_min_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
775 grid_minmax_tchi.Add(grid_max_tchi, 0, wx.ALL | wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 5)
777 bsizer_1.Add(grid_minmax_tchi, 0, wx.ALL, 5)
778 sizer_2.Add(bsizer_1, 0, wx.EXPAND, 5)
780 sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
782 sizer_f = wx.BoxSizer(wx.HORIZONTAL)
783 sizer_f.Add(self.label_8, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
784 sizer_f.Add(self.spin_f1, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
786 sizer_f.Add(self.label_9, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
787 sizer_f.Add(self.spin_f2, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
789 sizer_f.Add(self.label_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
790 sizer_f.Add(self.spin_f3, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
791 sizer_2.Add(sizer_f, 0, wx.EXPAND, 5)
793 sizer_2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 5)
795 fsizer2 = wx.FlexGridSizer(0,2,0,0)
796 fsizer2.Add(self.label_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
797 fsizer2.Add(self.slider_sphere, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
798 fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
799 fsizer2.Add(wx.StaticLine(self, -1), 0, wx.EXPAND, 0)
801 fsizer2.Add(self.label_film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
802 fsizer2.Add(self.film, 0, wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL, 5)
803 sizer_2.Add(fsizer2, 0, wx.EXPAND, 5)
804 sizer_2.Add(self.btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
805 self.SetSizer(sizer_2)
809 def OnCheck1(self, event):
810 if self.check1.GetValue() :
811 self.check2.SetValue(False)
812 self.check_chic.SetValue(False)
813 self.spin_chi.Enable(False)
814 self.spin_nb.Enable(True)
815 self.spin_nbchic.Enable(False)
817 self.spin_nb.Enable(False)
819 def OnCheck2(self, event):
820 if self.check2.GetValue() :
821 self.check1.SetValue(False)
822 self.check_chic.SetValue(False)
823 self.spin_chi.Enable(True)
824 self.spin_nb.Enable(False)
825 self.spin_nbchic.Enable(False)
827 self.spin_chi.Enable(False)
829 def OnCheckChic(self, event) :
830 if self.check_chic.GetValue() :
831 self.check1.SetValue(False)
832 self.check2.SetValue(False)
833 self.spin_chi.Enable(False)
834 self.spin_nb.Enable(False)
835 self.spin_nbchic.Enable(True)
837 self.spin_nbchic.Enable(False)
839 def OnNorm(self, event):
840 if not self.check4.GetValue() :
841 self.spin_min.Disable()
842 self.spin_max.Disable()
844 self.spin_min.Enable(True)
845 self.spin_max.Enable(True)
846 self.check_tchi.SetValue(False)
847 self.OnCheckTchi(wx.EVT_CHECKBOX)
849 def OnCheckTchi(self, evt) :
850 if not self.check_tchi.GetValue() :
851 self.spin_min_tchi.Disable()
852 self.spin_max_tchi.Disable()
854 self.spin_min_tchi.Enable(True)
855 self.spin_max_tchi.Enable(True)
856 self.check4.SetValue(False)
857 self.OnNorm(wx.EVT_CHECKBOX)
859 def On3D(self, event) :
860 if event.GetString() == u'3D' :
861 self.film.Enable(True)
862 self.spin_f3.Enable(True)
863 self.slider_sphere.Enable(True)
865 self.film.Enable(False)
866 self.spin_f3.Enable(False)
867 self.slider_sphere.Enable(False)
869 def OnPass(self,evt) :
870 if evt.GetString() == _(u"clusters").decode('utf8') :
871 self.check4.SetValue(False)
872 self.check4.Enable(False)
873 self.OnNorm(wx.EVT_CHECKBOX)
878 class SelectColDial ( wx.Dialog ):
880 def __init__( self, parent ):
881 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 )
883 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
885 self.bSizer2 = wx.BoxSizer( wx.VERTICAL )
887 #self.m_checkList2 = wx.CheckListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ['r','t','y'], 0 )
888 #bSizer2.Add( self.m_checkList2, 2, wx.ALL|wx.EXPAND, 5 )
890 self.m_sdbSizer2 = wx.StdDialogButtonSizer()
891 self.m_sdbSizer2OK = wx.Button( self, wx.ID_CANCEL)
892 self.butok = wx.Button( self, wx.ID_OK)
893 #m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
894 #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
895 #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
896 #m_sdbSizer2.Realize();
897 #self.bSizer2.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
899 self.SetSizer( self.bSizer2 )
902 self.Centre( wx.BOTH )
907 class PrefExport(wx.Dialog):
908 def __init__(self, parent, *args, **kwds):
909 kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE
910 wx.Dialog.__init__(self, *args, **kwds)
913 sizer = wx.BoxSizer(wx.VERTICAL)
914 box = wx.BoxSizer(wx.HORIZONTAL)
915 box3 = wx.BoxSizer(wx.HORIZONTAL)
916 self.label_lem = wx.StaticText(self, -1, _(u"Lemmatised corpora").decode('utf8'))
917 box3.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
918 self.radio_lem = wx.RadioBox(self, -1, u"", choices= [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
919 box3.Add(self.radio_lem, 0, wx.ALIGN_RIGHT, 5)
920 sizer.Add(box3, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
921 self.label_txt = wx.StaticText(self, -1, _(u"Export for ...").decode('utf8'))
922 box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
923 self.radio_type = wx.RadioBox(self, -1, u"", choices=['IRaMuTeQ/ALCESTE', 'Lexico'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
924 box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
925 sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
926 box2 = wx.BoxSizer(wx.HORIZONTAL)
927 self.txt2 = wx.StaticText(self, -1, _(u"Output file").decode('utf8'))
928 box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
929 self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
930 box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
931 self.fbb.SetLabel("")
932 sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
934 btnsizer = wx.StdDialogButtonSizer()
935 btn = wx.Button(self, wx.ID_CANCEL)
936 btnsizer.AddButton(btn)
937 btn_ok = wx.Button(self, wx.ID_OK)
939 btnsizer.AddButton(btn_ok)
941 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
942 self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
946 def check_file(self, evt) :
947 if evt.GetId() == wx.ID_OK :
948 if os.path.exists(self.fbb.GetValue()):
949 dlg = wx.MessageDialog(self, '\n'.join([u"%s" % self.fbb.GetValue(), _(u"This file already exists. Continue anyway ?").decode('utf8')]), _(u"Attention").decode('utf8'), wx.NO | wx.YES | wx.ICON_WARNING)
951 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
952 self.EndModal(wx.ID_OK)
954 self.EndModal(wx.ID_OK)
956 self.EndModal(wx.ID_CANCEL)
958 class PrefProfTypes(wx.Dialog):
959 def __init__(self, parent, *args, **kwds):
960 kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE
961 wx.Dialog.__init__(self, parent, *args, **kwds)
964 sizer = wx.BoxSizer(wx.VERTICAL)
965 box = wx.BoxSizer(wx.HORIZONTAL)
966 box3 = wx.BoxSizer(wx.HORIZONTAL)
967 self.label_txt = wx.StaticText(self, -1, _(u"Settings").decode('utf8'))
968 box.Add(self.label_txt, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
969 self.radio_type = wx.RadioBox(self, -1, u"", choices=[_(u"Like ALCESTE").decode('utf8'), _(u"Like Lexico").decode('utf8')], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
970 box.Add(self.radio_type, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
971 sizer.Add(box, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
972 box2 = wx.BoxSizer(wx.HORIZONTAL)
973 self.txt2 = wx.StaticText(self, -1, _(u"Output file").decode('utf8'))
974 box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
975 self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2)
976 box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
977 self.fbb.SetLabel("")
978 sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
980 btnsizer = wx.StdDialogButtonSizer()
981 btn = wx.Button(self, wx.ID_CANCEL)
982 btnsizer.AddButton(btn)
983 btn_ok = wx.Button(self, wx.ID_OK)
985 btnsizer.AddButton(btn_ok)
987 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
988 #self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
992 class PrefSimpleFile(wx.Dialog):
993 def __init__(self, parent, *args, **kwds):
994 kwds['style'] = wx.OK|wx.DEFAULT_DIALOG_STYLE
996 self.mask = kwds['mask']
998 else : self.mask = '*.*'
999 wx.Dialog.__init__(self, *args, **kwds)
1001 self.parent = parent
1002 sizer = wx.BoxSizer(wx.VERTICAL)
1003 box2 = wx.BoxSizer(wx.HORIZONTAL)
1004 self.txt2 = wx.StaticText(self, -1, _(u"Output file").decode('utf8'))
1005 box2.Add(self.txt2, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1006 self.fbb = filebrowse.FileBrowseButton(self, -1, size=(450, -1), fileMode = 2, fileMask = self.mask)
1007 box2.Add(self.fbb, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1008 self.fbb.SetLabel("")
1009 sizer.Add(box2, 0, wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5)
1011 btnsizer = wx.StdDialogButtonSizer()
1012 btn = wx.Button(self, wx.ID_CANCEL)
1013 btnsizer.AddButton(btn)
1014 btn_ok = wx.Button(self, wx.ID_OK)
1016 btnsizer.AddButton(btn_ok)
1018 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.ALIGN_RIGHT, 5)
1019 self.Bind(wx.EVT_BUTTON, self.check_file, btn_ok)
1020 self.SetSizer(sizer)
1023 def check_file(self, evt) :
1024 if evt.GetId() == wx.ID_OK :
1025 if os.path.exists(self.fbb.GetValue()):
1026 dlg = wx.MessageDialog(self, '\n'.join([u"%s" % self.fbb.GetValue(), _(u"This file already exists. Continue anyway ?").decode('utf8')]), _(u"Attention").decode('utf8'), wx.NO | wx.YES | wx.ICON_WARNING)
1027 dlg.CenterOnParent()
1028 if dlg.ShowModal() not in [wx.ID_NO, wx.ID_CANCEL]:
1029 self.EndModal(wx.ID_OK)
1031 self.EndModal(wx.ID_OK)
1033 self.EndModal(wx.ID_CANCEL)
1036 class StatDialog(wx.Dialog):
1037 def __init__(self, parent, *args, **kwds):
1038 kwds['style'] = wx.DEFAULT_DIALOG_STYLE
1039 wx.Dialog.__init__(self, *args, **kwds)
1041 self.parent = parent
1042 self.label_lem = wx.StaticText(self, -1, _(u"Lemmatization").decode('utf8'))
1043 self.radio_lem = wx.RadioBox(self, -1, u"", choices=['oui', 'non'], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1044 #txt = u"""Fréquence minimum d'une forme
1045 #analysée (0 = non utilisé)"""
1046 #self.label_8 = wx.StaticText(self, -1, txt)
1047 #self.spin_ctrl_5 = wx.SpinCtrl(self, -1, "",size = (100,30), min=0, max=1000, initial=0)
1048 #self.label_max_actives = wx.StaticText(self, -1, u"Nombre maximum de formes analysées")
1049 #self.spin_max_actives = wx.SpinCtrl(self, -1, "",size = (100,30), min=20, max=10000, initial=1500)
1050 self.label_4 = wx.StaticText(self, -1, _(u"Keys settings").decode('utf8'))
1051 self.button_5 = wx.Button(self, wx.ID_PREFERENCES, "")
1053 #self.Bind(wx.EVT_CHECKBOX, self.OnCheckUce, self.check_uce)
1054 #self.Bind(wx.EVT_SPINCTRL, self.OnSpin, self.spin_ctrl_5)
1055 self.Bind(wx.EVT_BUTTON, self.OnKeys, self.button_5)
1057 self.__set_properties()
1059 def __do_layout(self) :
1060 first = wx.BoxSizer(wx.VERTICAL)
1061 sizer = wx.FlexGridSizer(0,2,0,0)
1062 sizer.Add(self.label_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1063 sizer.Add(self.radio_lem, 0, wx.ALIGN_LEFT, 5)
1064 sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1065 sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1066 #sizer.Add(self.txt_exp, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1067 #sizer.Add(self.exp, 0, wx.ALIGN_RIGHT, 5)
1068 #sizer.Add(self.label_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1069 #sizer.Add(self.check_uce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1070 #sizer.Add(self.label_occuce, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1071 #sizer.Add(self.spin_ctrl_4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1072 #sizer.Add(self.label_8, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1073 #sizer.Add(self.spin_ctrl_5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1074 #sizer.Add(self.label_max_actives, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1075 #sizer.Add(self.spin_max_actives, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1076 sizer.Add(self.label_4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1077 sizer.Add(self.button_5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1078 sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1079 sizer.Add(wx.StaticLine(self),0, wx.ALIGN_LEFT, 5)
1080 #sizer.Add(box2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1081 first.Add(sizer, 0, wx.ALL, 5)
1082 btnsizer = wx.StdDialogButtonSizer()
1083 btn = wx.Button(self, wx.ID_CANCEL)
1084 btnsizer.AddButton(btn)
1085 btn_ok = wx.Button(self, wx.ID_OK)
1087 btnsizer.AddButton(btn_ok)
1089 first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1090 self.SetSizer(first)
1093 def __set_properties(self) :
1094 self.SetTitle(_(u"Settings").decode('utf8'))
1096 def OnKeys(self, evt):
1097 dial = AlcOptFrame(self, self.parent.parent)
1098 dial.CenterOnParent()
1100 for i in range(0,len(dial.listlabel)):
1101 dial.keys[dial.listcle[i]] = dial.listspin[i].GetValue()
1102 DoConf().makeoptions(['KEY'], [dial.keys], outfile = self.parent.parent.ConfigPath['key'])
1105 class PrefUCECarac(wx.Dialog):
1106 def __init__(self, parent, *args, **kwds):
1107 kwds['style'] = wx.DEFAULT_DIALOG_STYLE
1108 kwds['title'] = _(u"Characteristic text segments").decode('utf8')
1109 wx.Dialog.__init__(self, *args, **kwds)
1110 self.parent = parent
1111 first = wx.BoxSizer(wx.VERTICAL)
1112 sizer = wx.FlexGridSizer(0,2,0,0)
1113 self.label_type = wx.StaticText(self, -1, _(u"Ranking score").decode('utf8'))
1114 sizer.Add(self.label_type, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT, 5)
1115 self.radio_type = wx.RadioBox(self, -1, u"", choices=[_(u"absolute (sum of chi2 of marked forms in segment)").decode('utf8'), _(u"relative (mean of chi2 of marked forms in segment)").decode('utf8')], majorDimension=0, style=wx.RA_SPECIFY_ROWS)
1116 sizer.Add(self.radio_type, 0, wx.ALIGN_RIGHT, 5)
1117 self.txt_eff = wx.StaticText(self, -1, _(u"Maximum number of text segments").decode('utf8'))
1118 sizer.Add(self.txt_eff, 0, wx.ALIGN_CENTRE, 5)
1119 self.spin_eff = wx.SpinCtrl(self, -1, '', size = (100, 30), min = 1, max = 100000, initial = 50)
1120 self.spin_eff.SetValue(50)
1121 sizer.Add(self.spin_eff, 0, wx.ALIGN_CENTRE|wx.ALL, 5)
1122 first.Add(sizer, 0, wx.ALL, 5)
1123 btnsizer = wx.StdDialogButtonSizer()
1124 btn = wx.Button(self, wx.ID_CANCEL)
1125 btnsizer.AddButton(btn)
1126 btn_ok = wx.Button(self, wx.ID_OK)
1128 btnsizer.AddButton(btn_ok)
1130 first.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1131 self.SetSizer(first)
1134 class PrefSegProf(wx.Dialog) :
1135 def __init__( self, parent ):
1136 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Repeated segments profiles").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1138 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1139 bSizer1 = wx.BoxSizer( wx.VERTICAL )
1140 txt = _(u"Be carefull : computation of repeated segments profiles can be very long on large corpora").decode('utf8')
1141 self.label = wx.StaticText( self, wx.ID_ANY, txt, wx.DefaultPosition, wx.DefaultSize, 0 )
1142 bSizer1.Add( self.label, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5 )
1144 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1145 fgSizer1.SetFlexibleDirection( wx.BOTH )
1146 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1148 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Lemmatised corpora").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1149 self.m_staticText1.Wrap( -1 )
1150 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1152 box_lemChoices = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
1153 self.box_lem = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, box_lemChoices, 1, wx.RA_SPECIFY_COLS )
1154 self.box_lem.SetSelection( 1 )
1155 fgSizer1.Add( self.box_lem, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1156 #self.box_lem.Enable(False)
1158 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"Minimum size of segments").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1159 self.m_staticText3.Wrap( -1 )
1160 fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1162 self.spin_min = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 2 )
1163 self.spin_min.SetValue(2)
1164 fgSizer1.Add( self.spin_min, 0, wx.ALL, 5 )
1166 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"Minimum size of segments").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1167 self.m_staticText4.Wrap( -1 )
1168 fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1170 self.spin_max = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 2, 30, 10 )
1171 self.spin_max.SetValue(10)
1172 fgSizer1.Add( self.spin_max, 0, wx.ALL, 5 )
1174 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Minimum frequency of segments").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1175 self.m_staticText5.Wrap( -1 )
1176 fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1178 self.spin_eff = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (100,30), wx.SP_ARROW_KEYS, 4, 1000, 4 )
1179 self.spin_eff.SetValue(4)
1180 fgSizer1.Add( self.spin_eff, 0, wx.ALL, 5 )
1182 bSizer1.Add( fgSizer1, 1, wx.EXPAND, 5 )
1183 btnsizer = wx.StdDialogButtonSizer()
1184 btn = wx.Button(self, wx.ID_CANCEL)
1185 btnsizer.AddButton(btn)
1186 btn_ok = wx.Button(self, wx.ID_OK)
1188 btnsizer.AddButton(btn_ok)
1190 bSizer1.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT, 5)
1192 self.SetSizer( bSizer1 )
1196 self.Centre( wx.BOTH )
1198 class PrefQuestAlc ( wx.Dialog ):
1200 def __init__( self, parent, sim = False):
1201 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Clustering").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1203 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1205 #---------------------------------------------------------------
1206 #self.content = parent.content[:]
1207 self.header = parent.tableau.get_colnames()
1208 labels = [val for val in self.header]
1209 self.labels_tot = labels
1212 #---------------------------------------------------------------
1213 bSizer2 = wx.BoxSizer( wx.VERTICAL )
1215 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1216 fgSizer1.SetFlexibleDirection( wx.BOTH )
1217 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1220 self.lab_format = wx.StaticText( self, wx.ID_ANY, _(u"Supplementary variables are marked with a *").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1221 self.lab_format.Wrap( -1 )
1222 fgSizer1.Add( self.lab_format, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1224 m_radioBox1Choices = [ _(u"yes").decode('utf8'), _(u"no").decode('utf8') ]
1225 self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
1226 self.m_radioBox1.SetSelection( 0 )
1227 fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1229 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"Actives variables (almost 3)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1230 self.m_staticText3.Wrap( -1 )
1231 fgSizer1.Add( self.m_staticText3, 0, wx.ALL, 5 )
1233 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"Supplementaries variables (almost 1)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1234 self.m_staticText2.Wrap( -1 )
1235 fgSizer1.Add( self.m_staticText2, 0, wx.ALL, 5 )
1237 self.ListActive = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels, wx.LB_EXTENDED )
1238 self.ListActive.SetMinSize( wx.Size( 300,250 ) )
1240 fgSizer1.Add( self.ListActive, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1242 self.ListSup = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, labels, wx.LB_EXTENDED )
1243 self.ListSup.SetMinSize( wx.Size( 300,250 ) )
1245 fgSizer1.Add( self.ListSup, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1247 self.but_suiv = wx.Button( self, wx.ID_ANY, _(u"Next").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1248 fgSizer1.Add( self.but_suiv, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1250 self.but_prec = wx.Button( self, wx.ID_ANY, _(u"Previous").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1251 fgSizer1.Add( self.but_prec, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1254 self.lab_nbcl = wx.StaticText( self, wx.ID_ANY, _(u"Number of terminal clusters in phase 1").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1255 self.lab_nbcl.Wrap( -1 )
1256 fgSizer1.Add( self.lab_nbcl, 0, wx.ALL, 5 )
1258 self.spin_nbcl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 100, 10 )
1259 self.spin_nbcl.SetValue(10)
1260 self.spin_nbcl.SetMinSize( wx.Size( 100,30 ) )
1262 fgSizer1.Add( self.spin_nbcl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1264 self.lab_mincl = wx.StaticText( self, wx.ID_ANY, _(u"Minimum text segments frenquency in clusters (2= automatic)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1265 self.lab_mincl.Wrap( -1 )
1266 fgSizer1.Add( self.lab_mincl, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1268 self.spin_mincl = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 2, 1000, 0 )
1269 self.spin_mincl.SetValue(2)
1270 self.spin_mincl.SetMinSize( wx.Size( 100,30 ) )
1272 fgSizer1.Add( self.spin_mincl, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1274 bSizer2.Add( fgSizer1, 1, wx.EXPAND, 5 )
1276 m_sdbSizer2 = wx.StdDialogButtonSizer()
1277 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1278 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1279 self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1280 m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1281 m_sdbSizer2.Realize();
1282 bSizer2.Add( m_sdbSizer2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1284 self.SetSizer( bSizer2 )
1288 self.Centre( wx.BOTH )
1291 self.ListActive.Enable(False)
1292 self.ListSup.Enable(False)
1293 self.but_suiv.Enable(False)
1294 self.but_prec.Enable(False)
1296 self.ListSup.Enable(False)
1297 self.but_prec.Enable(False)
1301 self.m_radioBox1.Bind( wx.EVT_RADIOBOX, self.onformat )
1302 self.but_suiv.Bind(wx.EVT_BUTTON, self.onsuivant)
1303 self.but_prec.Bind(wx.EVT_BUTTON, self.onprec)
1304 self.m_sdbSizer2OK.Bind(wx.EVT_BUTTON, self.onvalid)
1306 def __del__( self ):
1309 # Virtual event handlers, overide them in your derived class
1310 def onformat( self, event ):
1311 if self.m_radioBox1.GetSelection() == 0 :
1312 self.ListActive.Enable(False)
1313 self.ListSup.Enable(False)
1314 self.but_suiv.Enable(False)
1315 self.m_sdbSizer2OK.Enable(True)
1317 self.ListActive.Enable(True)
1318 self.but_suiv.Enable(True)
1319 self.m_sdbSizer2OK.Enable(False)
1321 def onsuivant(self, evt) :
1322 actives = list(self.ListActive.GetSelections())
1324 if len(actives)>=3 and len(actives) != len(self.header) :
1328 header = self.header[:]
1329 for i in range(0, len(header)):
1330 self.hindices.append(i)
1332 self.nactives.append(i)
1333 header.pop(i - compt)
1334 self.hindices.pop(i - compt)
1336 self.labels = [val for val in header]
1337 self.ListSup.Clear()
1339 self.ListSup.Append(i)
1341 self.ListActive.Enable(False)
1342 self.ListSup.Enable(True)
1343 self.but_suiv.Enable(False)
1344 self.but_prec.Enable(True)
1346 self.m_sdbSizer2OK.Enable(True)
1348 def onprec(self, evt) :
1349 self.ListActive.Enable(True)
1350 self.ListSup.Enable(False)
1351 self.but_suiv.Enable(True)
1352 self.but_prec.Enable(False)
1354 self.m_sdbSizer2OK.Enable(False)
1356 def onvalid(self, evt) :
1357 for i in self.ListSup.GetSelections() :
1358 self.varsup.append(self.hindices[i])
1360 if len(self.varsup) >= 1 or self.m_radioBox1.GetSelection() == 0 :
1363 if len(self.varsup) >= 1 :
1366 class FindInCluster(wx.Frame):
1367 def __init__(self, parent, id, result, style = wx.DEFAULT_FRAME_STYLE):
1368 # begin wxGlade: MyFrame.__init__
1369 wx.Frame.__init__(self, parent, id)
1370 self.spanel = wx.ScrolledWindow(self, -1, style=wx.TAB_TRAVERSAL)
1371 self.sizer1 = wx.FlexGridSizer(0,4,0,0)
1372 self.parent = parent
1374 txt = [_(u"form").decode('utf8'),_(u"cluster").decode('utf8'),_(u"Chi2").decode('utf8'), _(u"see").decode('utf8')]
1376 self.sizer1.Add( wx.StaticText(self.spanel, -1, val), 0, wx.ALL, 5)
1378 self.sizer1.Add(wx.StaticLine(self.spanel, -1), 0, wx.ALL, 5)
1379 for i,val in enumerate(result) :
1383 pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
1384 siz = wx.BoxSizer(wx.VERTICAL)
1385 txt = wx.StaticText(pan, -1, forme)
1386 siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
1388 self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
1389 pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
1390 siz = wx.BoxSizer(wx.VERTICAL)
1391 txt = wx.StaticText(pan, -1, str(cl))
1392 siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
1394 self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
1395 pan = wx.Panel(self.spanel, -1, style=wx.SIMPLE_BORDER)
1396 siz = wx.BoxSizer(wx.VERTICAL)
1397 txt = wx.StaticText(pan, -1, str(chi))
1398 siz.Add(txt, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
1400 self.sizer1.Add(pan, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5)
1402 self.formes[idbut] = [forme, cl]
1403 but = wx.Button(self.spanel, idbut, u"voir")
1404 self.sizer1.Add(but, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
1405 self.Bind(wx.EVT_BUTTON, self.showitem, but)
1406 self.button_1 = wx.Button(self, -1, "Fermer")
1407 self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1)
1408 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
1409 self.__set_properties()
1413 def __set_properties(self):
1414 self.SetTitle(_(u"Results").decode('utf8'))
1415 self.spanel.EnableScrolling(True,True)
1416 #self.panel_1.SetSize((1000,1000))
1417 self.spanel.SetScrollRate(20, 20)
1418 h = 60 * len(self.formes)
1423 self.SetSize(wx.Size(400,h))
1425 def __do_layout(self):
1426 # begin wxGlade: MyFrame.__do_layout
1427 sizer_1 = wx.BoxSizer(wx.VERTICAL)
1428 sizer_2 = wx.BoxSizer(wx.VERTICAL)
1429 self.spanel.SetSizer(self.sizer1)
1430 sizer_1.Add(self.spanel, 4, wx.EXPAND, 0)
1431 sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ADJUST_MINSIZE, 0)
1432 #sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
1433 self.SetAutoLayout(True)
1434 self.SetSizer(sizer_1)
1438 def showitem(self, evt) :
1439 idb = evt.GetEventObject().GetId()
1441 profile = nb.GetPage(nb.GetSelection())
1442 cl = self.formes[idb][1] - 1
1443 forme = self.formes[idb][0]
1444 profile.ProfNB.SetSelection(cl)
1445 UnSelectList(profile.ProfNB.GetPage(cl))
1446 datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())])
1447 profile.ProfNB.GetPage(cl).SetItemState(datas[self.formes[idb][0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
1448 profile.ProfNB.GetPage(cl).Focus(datas[forme])
1449 profile.ProfNB.GetPage(cl).SetFocus()
1451 def OnCloseMe(self, evt) :
1454 def OnCloseWindow(self, evt):
1457 class SearchDial ( wx.Frame ):
1459 def __init__( self, parent, listctrl, col, shown):
1460 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE )
1461 self.parent = parent
1462 self.listctrl = listctrl
1465 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1467 bSizer1 = wx.BoxSizer( wx.VERTICAL )
1469 self.search = wx.SearchCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_PROCESS_ENTER )
1470 self.search.ShowSearchButton( True )
1471 self.search.ShowCancelButton( True )
1472 bSizer1.Add( self.search, 0, wx.ALL, 5 )
1473 sizer2 = wx.BoxSizer(wx.HORIZONTAL)
1474 self.backward = wx.Button(self, wx.ID_BACKWARD, _(u"Previous").decode('utf8'))
1475 self.forward = wx.Button(self, wx.ID_FORWARD, _(u"Next").decode('utf8'))
1476 sizer2.Add(self.backward, 0, wx.ALL, 5)
1477 sizer2.Add(self.forward, 0, wx.ALL, 5)
1478 bSizer1.Add( sizer2, 0, wx.ALL, 5 )
1480 self.SetSizer( bSizer1 )
1483 self.Bind(wx.EVT_SEARCHCTRL_SEARCH_BTN, self.OnSearch, self.search)
1484 self.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN, self.OnCancel, self.search)
1485 self.Bind(wx.EVT_TEXT_ENTER, self.OnSearch, self.search)
1486 self.Bind(wx.EVT_BUTTON, self.onforward, self.forward)
1487 self.Bind(wx.EVT_BUTTON, self.onbackward, self.backward)
1488 self.search.SetFocus()
1489 self.forward.Enable(False)
1490 self.backward.Enable(False)
1492 self.Centre( wx.BOTH )
1494 def __del__( self ):
1497 def OnSearch(self, evt):
1498 UnSelectList(self.listctrl)
1499 search_word = self.search.GetValue()
1500 if search_word.strip() != '' :
1501 formes = [self.listctrl.getColumnText(i, self.col) for i in range(self.listctrl.GetItemCount())]
1502 if search_word.endswith(u'*') :
1503 search_word = search_word[0:-1]
1504 result = [j for j, forme in enumerate(formes) if forme.startswith(search_word)]
1506 result = [j for j, forme in enumerate(formes) if forme == search_word]
1509 elif self.shown == True :
1510 self.showitems(result)
1512 self.showresult(result)
1517 def showitems(self, items) :
1518 if len(items) == 1 :
1519 self.listctrl.SetItemState(items[0], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
1520 self.listctrl.Focus(items[0])
1521 self.listctrl.SetFocus()
1525 self.listctrl.SetItemState(i, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
1526 self.listctrl.Focus(items[0])
1527 self.listctrl.SetFocus()
1528 self.forward.Enable(True)
1529 self.backward.Enable(False)
1534 def showresult(self, result) :
1535 toshow = [self.listctrl.itemDataMap[int(self.listctrl.getColumnText(i,0))] for i in result]
1536 proflist = [[[line[1], i+1, val] for i, val in enumerate(line[2:]) if val>=2] for line in toshow]
1537 #FIXME: intervenir en aval en virant les forme avec chi<2
1538 if proflist != [[]] :
1539 proflist = [val for line in proflist for val in line if line !=[]]
1540 nb = self.parent.parent.nb
1541 profile = nb.GetPage(nb.GetSelection())
1542 first_forme = proflist[0]
1543 cl = first_forme[1] - 1
1544 profile.ProfNB.SetSelection(cl)
1545 profile.ProfNB.GetPage(cl).SetFocus()
1546 UnSelectList(profile.ProfNB.GetPage(cl))
1547 datas = dict([[profile.ProfNB.GetPage(cl).getColumnText(i,6),i] for i in range(profile.ProfNB.GetPage(cl).GetItemCount())])
1548 profile.ProfNB.GetPage(cl).SetItemState(datas[first_forme[0]], wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
1549 profile.ProfNB.GetPage(cl).Focus(datas[first_forme[0]])
1550 profile.ProfNB.GetPage(cl).SetFocus()
1551 if len(proflist) == 1 :
1554 SearchResult = FindInCluster(self.parent.parent, -1, proflist)
1560 def onforward(self, evt) :
1561 self.listctrl.Focus(self.items[self.forwitem])
1562 self.listctrl.SetFocus()
1564 if self.forwitem == len(self.items) :
1565 self.forward.Enable(False)
1566 self.backward.Enable(True)
1570 self.backward.Enable(True)
1572 def onbackward(self, evt) :
1573 self.listctrl.Focus(self.items[self.backitem])
1574 self.listctrl.SetFocus()
1576 if self.backitem == -1 :
1578 self.forward.Enable(True)
1579 self.backward.Enable(False)
1582 self.forward.Enable(True)
1584 def noresult(self) :
1585 msg = _(u"Absent form").decode('utf8')
1586 dial = wx.MessageDialog(self, _(u"Absent form").decode('utf8'),_(u"Absent form").decode('utf8'), wx.OK | wx.ICON_INFORMATION)
1587 dial.CenterOnParent()
1591 def OnCancel(self, evt) :
1594 def UnSelectList(liste) :
1595 if liste.GetFirstSelected() != -1 :
1596 last = liste.GetFirstSelected()
1597 liste.Select(liste.GetFirstSelected(), False)
1598 while liste.GetNextSelected(last) != -1 :
1599 last = liste.GetNextSelected(last)
1600 liste.Select(liste.GetFirstSelected(),False)
1603 class OptLexi(wx.Dialog):
1604 def __init__(self, parent, force_chi = False):
1605 # begin wxGlade: MyDialog.__init__
1606 #kwds["style"] = wx.DEFAULT_DIALOG_STYLE
1607 wx.Dialog.__init__(self, parent, style = wx.DEFAULT_DIALOG_STYLE)
1609 self.variables = None
1610 self.force_chi = force_chi
1611 #self.labellem = wx.StaticText(self, -1, u"Lemmatisation : ")
1612 #self.checklem = wx.CheckBox(self, -1)
1613 if not self.force_chi :
1614 self.label_typeformes = wx.StaticText(self, -1, _(u"Used forms").decode('utf8'))
1615 typeformeschoiceChoices = [ _(u"actives and supplementaries").decode('utf8'), _(u"actives").decode('utf8'), _(u"supplementaries").decode('utf8')]
1616 self.typeformes = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, typeformeschoiceChoices, 0 )
1617 self.typeformes.SetSelection( 0 )
1619 self.label_var = wx.StaticText(self, -1, _(u"Select by").decode('utf8'))
1620 self.choice = wx.Choice(self, -1, (100,50), choices = [_(u"variables").decode('utf8'), _(u"modalities").decode('utf8')])
1621 self.label1 = wx.StaticText(self, -1, _(u"Choice").decode('utf8'))
1622 self.list_box_1 = wx.ListBox(self, -1, choices=[], size = wx.Size( 150,200 ), style=wx.LB_EXTENDED | wx.LB_HSCROLL)
1623 self.button_2 = wx.Button(self, wx.ID_CANCEL, "")
1624 self.button_1 = wx.Button(self, wx.ID_OK, "")
1625 if not self.force_chi :
1626 indices = [_(u"hypergeometrical law").decode('utf8'), _(u"chi2").decode('utf8')]
1628 indices = [_(u"chi2").decode('utf8')]
1629 self.label_indice = wx.StaticText(self, -1, _(u"Score").decode('utf8'))
1630 self.choice_indice = wx.Choice(self, -1, (100,50), choices = indices)
1631 if not self.force_chi :
1632 self.label = wx.StaticText(self, -1, _(u"Minimum frequency").decode('utf8'))
1633 self.spin = wx.SpinCtrl(self, -1, min = 1, max = 10000, initial = 10)
1634 self.Bind(wx.EVT_CHOICE, self.onselect, self.choice)
1635 self.__set_properties()
1639 def __set_properties(self):
1640 # begin wxGlade: MyDialog.__set_properties
1641 self.SetTitle(_(u"Variables choice").decode('utf8'))
1642 if not self.force_chi :
1643 self.spin.SetValue(10)
1644 self.choice.SetSelection(0)
1645 self.choice_indice.SetSelection(0)
1646 #self.SetMinSize(wx.Size(300, 400))
1649 def __do_layout(self):
1650 # begin wxGlade: MyDialog.__do_layout
1651 sizer_1 = wx.BoxSizer(wx.VERTICAL)
1652 sizer_2 = wx.FlexGridSizer(0,2,0,0)
1653 sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
1654 #sizer_2.Add(self.labellem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1655 #sizer_2.Add(self.checklem, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1656 if not self.force_chi :
1657 sizer_2.Add(self.label_typeformes, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1658 sizer_2.Add(self.typeformes, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1659 sizer_2.Add(self.label_var, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1660 sizer_2.Add(self.choice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1661 sizer_2.Add(self.label1, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1662 sizer_2.Add(self.list_box_1, 0, wx.ALIGN_RIGHT, 3)
1663 sizer_3.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
1664 sizer_3.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
1665 sizer_2.Add(self.label_indice, 0, wx.ALIGN_CENTER_VERTICAL, 3)
1666 sizer_2.Add(self.choice_indice, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
1667 if not self.force_chi :
1668 sizer_2.Add(self.label, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 3)
1669 sizer_2.Add(self.spin, 0, wx.ALIGN_RIGHT | wx.ALIGN_CENTER_VERTICAL, 3)
1670 sizer_1.Add(sizer_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 3)
1671 sizer_1.Add(sizer_3, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_RIGHT, 3)
1672 self.SetSizer(sizer_1)
1677 def onselect(self, evt):
1678 self.list_box_1.Clear()
1679 if self.choice.GetSelection() == 0 :
1680 for var in self.variables :
1681 self.list_box_1.Append(var)
1683 for et in self.listet :
1684 self.list_box_1.Append(et)
1687 class PrefDendro ( wx.Dialog ):
1689 def __init__( self, parent, param ):
1690 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Dendrogram").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1692 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1694 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1695 fgSizer1.SetFlexibleDirection( wx.BOTH )
1696 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1698 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Picture size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1699 self.m_staticText1.Wrap( -1 )
1700 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1702 bSizer2 = wx.BoxSizer( wx.VERTICAL )
1704 bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
1706 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1707 self.m_staticText2.Wrap( -1 )
1708 bSizer3.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1710 self.m_spinCtrl1 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
1711 bSizer3.Add( self.m_spinCtrl1, 0, wx.ALL, 5 )
1713 bSizer2.Add( bSizer3, 1, wx.EXPAND, 5 )
1715 bSizer31 = wx.BoxSizer( wx.HORIZONTAL )
1717 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1718 self.m_staticText3.Wrap( -1 )
1719 bSizer31.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1721 self.m_spinCtrl2 = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 50, 10000, 600 )
1722 bSizer31.Add( self.m_spinCtrl2, 0, wx.ALL, 5 )
1724 bSizer2.Add( bSizer31, 1, wx.EXPAND, 5 )
1726 fgSizer1.Add( bSizer2, 1, wx.EXPAND, 5 )
1728 self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1729 fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
1731 self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1732 fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
1734 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"Dendrogram type").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1735 self.m_staticText4.Wrap( -1 )
1736 fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1738 m_choice1Choices = [ u"phylogram", u"cladogram", u"fan", u"unrooted", u"radial" ]
1739 self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, m_choice1Choices, 0 )
1740 self.m_choice1.SetSelection( 0 )
1741 fgSizer1.Add( self.m_choice1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1743 self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1744 fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
1746 self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1747 fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
1749 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Color or black and white").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1750 self.m_staticText5.Wrap( -1 )
1751 fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1753 m_radioBox1Choices = [ _(u"color").decode('utf8'), _(u"black and white").decode('utf8') ]
1754 self.m_radioBox1 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox1Choices, 1, wx.RA_SPECIFY_COLS )
1755 self.m_radioBox1.SetSelection( 0 )
1756 fgSizer1.Add( self.m_radioBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1758 self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1759 fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
1761 self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1762 fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
1764 bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
1766 self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, _(u"Add cluster size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1767 self.m_staticText6.Wrap( -1 )
1768 bSizer4.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1770 self.m_checkBox1 = wx.CheckBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1771 self.m_checkBox1.SetValue(True)
1772 bSizer4.Add( self.m_checkBox1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1774 fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
1776 m_radioBox2Choices = [ _(u"circular diagram").decode('utf8'), _(u"bar").decode('utf8') ]
1777 self.m_radioBox2 = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, m_radioBox2Choices, 1, wx.RA_SPECIFY_COLS )
1778 self.m_radioBox2.SetSelection( 0 )
1779 fgSizer1.Add( self.m_radioBox2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1781 self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1782 fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
1784 self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1785 fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
1788 fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
1790 m_sdbSizer2 = wx.StdDialogButtonSizer()
1791 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1792 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1793 self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1794 m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1795 m_sdbSizer2.Realize();
1796 fgSizer1.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
1798 self.__set_properties()
1799 self.SetSizer( fgSizer1 )
1801 fgSizer1.Fit( self )
1803 self.Centre( wx.BOTH )
1805 def __set_properties(self):
1806 self.m_spinCtrl2.SetValue(self.param['width'])
1807 self.m_spinCtrl1.SetValue(self.param['height'])
1808 self.m_choice1.SetSelection(self.param['type_dendro'])
1809 self.m_radioBox1.SetSelection(self.param['color_nb'])
1810 self.m_checkBox1.SetValue(self.param['taille_classe'])
1811 self.m_radioBox2.SetSelection(self.param['type_tclasse'])
1813 def __del__( self ):
1817 class PrefWordCloud ( wx.Dialog ):
1819 def __init__( self, parent, fromcluster = False ):
1820 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Wordcloud settings").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
1822 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1824 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1825 fgSizer1.SetFlexibleDirection( wx.BOTH )
1826 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1828 #self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Sélectionner les formes", wx.DefaultPosition, wx.DefaultSize, 0 )
1829 #self.m_staticText1.Wrap( -1 )
1830 #fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1832 #self.but_selectcol = wx.Button( self, wx.ID_ANY, u"Sélectionner", wx.DefaultPosition, wx.DefaultSize, 0 )
1833 #fgSizer1.Add( self.but_selectcol, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1835 #self.m_staticline1 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1836 #fgSizer1.Add( self.m_staticline1, 0, wx.EXPAND |wx.ALL, 5 )
1838 #self.m_staticline2 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1839 #fgSizer1.Add( self.m_staticline2, 0, wx.EXPAND |wx.ALL, 5 )
1841 bSizer1 = wx.BoxSizer( wx.HORIZONTAL )
1843 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1844 self.m_staticText3.Wrap( -1 )
1845 bSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1847 self.spin_H = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
1848 self.spin_H.SetValue( 800 )
1849 bSizer1.Add( self.spin_H, 0, wx.ALL, 5 )
1851 fgSizer1.Add( bSizer1, 1, wx.EXPAND, 5 )
1853 bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
1855 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1856 self.m_staticText4.Wrap( -1 )
1857 bSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1859 self.spin_L = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 100,30 ), wx.SP_ARROW_KEYS, 0, 10000, 600 )
1860 self.spin_L.SetValue( 800 )
1861 bSizer3.Add( self.spin_L, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1863 fgSizer1.Add( bSizer3, 1, wx.EXPAND, 5 )
1865 self.m_staticline3 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1866 fgSizer1.Add( self.m_staticline3, 0, wx.EXPAND |wx.ALL, 5 )
1868 self.m_staticline4 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1869 fgSizer1.Add( self.m_staticline4, 0, wx.EXPAND |wx.ALL, 5 )
1871 self.m_staticText11 = wx.StaticText( self, wx.ID_ANY, _(u"Picture format").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1872 self.m_staticText11.Wrap( -1 )
1873 fgSizer1.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1875 formatChoices = [ u"png", u"svg" ]
1876 self.format = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, formatChoices, 0 )
1877 self.format.SetSelection( 0 )
1878 fgSizer1.Add( self.format, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1881 self.m_staticText111 = wx.StaticText( self, wx.ID_ANY, _(u"Word size proportional to ...").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1882 self.m_staticText11.Wrap( -1 )
1883 fgSizer1.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1885 IndiceChoices = [ _(u"chi2").decode('utf8'), _(u"frequency").decode('utf8') ]
1886 self.indice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, IndiceChoices, 0 )
1887 self.indice.SetSelection( 0 )
1888 fgSizer1.Add( self.indice, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1890 self.m_staticline13 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1891 fgSizer1.Add( self.m_staticline13, 0, wx.EXPAND |wx.ALL, 5 )
1893 self.m_staticline14 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1894 fgSizer1.Add( self.m_staticline14, 0, wx.EXPAND |wx.ALL, 5 )
1896 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Maximum number of forms").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1897 self.m_staticText5.Wrap( -1 )
1898 fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1900 self.spin_maxword = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 10000, 600 )
1901 self.spin_maxword.SetValue( 600 )
1902 fgSizer1.Add( self.spin_maxword, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1904 self.m_staticline5 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1905 fgSizer1.Add( self.m_staticline5, 0, wx.EXPAND |wx.ALL, 5 )
1907 self.m_staticline6 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1908 fgSizer1.Add( self.m_staticline6, 0, wx.EXPAND |wx.ALL, 5 )
1910 self.typeformes = wx.StaticText( self, wx.ID_ANY, _(u"Used forms").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1911 self.typeformes.Wrap( -1 )
1912 fgSizer1.Add( self.typeformes, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1914 typeformeschoiceChoices = [ _(u"actives").decode('utf8'), _(u"supplementaries").decode('utf8'), _(u"actives and supplementaries").decode('utf8') ]
1915 self.typeformeschoice = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, typeformeschoiceChoices, 0 )
1916 self.typeformeschoice.SetSelection( 0 )
1917 fgSizer1.Add( self.typeformeschoice, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1919 self.m_staticline11 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1920 fgSizer1.Add( self.m_staticline11, 0, wx.EXPAND |wx.ALL, 5 )
1922 self.m_staticline12 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1923 fgSizer1.Add( self.m_staticline12, 0, wx.EXPAND |wx.ALL, 5 )
1925 self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, _(u"Text size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1926 self.m_staticText6.Wrap( -1 )
1927 fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1929 bSizer4 = wx.BoxSizer( wx.VERTICAL )
1931 bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
1933 self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Min", wx.DefaultPosition, wx.DefaultSize, 0 )
1934 self.m_staticText7.Wrap( -1 )
1935 bSizer5.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1937 self.spin_mincex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 5 )
1938 self.spin_mincex.SetValue( 5 )
1939 bSizer5.Add( self.spin_mincex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_RIGHT|wx.ALL, 5 )
1941 bSizer4.Add( bSizer5, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
1943 bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
1945 self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Max", wx.DefaultPosition, wx.DefaultSize, 0 )
1946 self.m_staticText8.Wrap( -1 )
1947 bSizer6.Add( self.m_staticText8, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1949 self.spin_maxcex = wx.SpinCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 1000, 50 )
1950 self.spin_maxcex.SetValue( 50 )
1951 bSizer6.Add( self.spin_maxcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1953 bSizer4.Add( bSizer6, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
1955 fgSizer1.Add( bSizer4, 1, wx.EXPAND, 5 )
1957 self.m_staticline7 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1958 fgSizer1.Add( self.m_staticline7, 0, wx.EXPAND |wx.ALL, 5 )
1960 self.m_staticline8 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1961 fgSizer1.Add( self.m_staticline8, 0, wx.EXPAND |wx.ALL, 5 )
1963 bSizer61 = wx.BoxSizer( wx.HORIZONTAL )
1965 self.m_staticText81 = wx.StaticText( self, wx.ID_ANY, _(u"Text color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1966 self.m_staticText81.Wrap( -1 )
1967 bSizer61.Add( self.m_staticText81, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1969 self.color_text = wx.ColourPickerCtrl( self, wx.ID_ANY, wx.BLACK, wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
1970 bSizer61.Add( self.color_text, 0, wx.ALL, 5 )
1972 fgSizer1.Add( bSizer61, 1, wx.EXPAND, 5 )
1974 bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
1976 self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, _(u"Background color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
1977 self.m_staticText9.Wrap( -1 )
1978 bSizer7.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1980 self.color_bg = wx.ColourPickerCtrl( self, wx.ID_ANY, (255,255,255), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
1981 bSizer7.Add( self.color_bg, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1983 fgSizer1.Add( bSizer7, 1, wx.EXPAND, 5 )
1985 self.m_staticline9 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1986 fgSizer1.Add( self.m_staticline9, 0, wx.EXPAND |wx.ALL, 5 )
1988 self.m_staticline10 = wx.StaticLine( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
1989 fgSizer1.Add( self.m_staticline10, 0, wx.EXPAND |wx.ALL, 5 )
1991 fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
1993 m_sdbSizer1 = wx.StdDialogButtonSizer()
1994 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
1995 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
1996 self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
1997 m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
1998 m_sdbSizer1.Realize();
1999 fgSizer1.Add( m_sdbSizer1, 1, wx.EXPAND, 5 )
2001 self.SetSizer( fgSizer1 )
2003 fgSizer1.Fit( self )
2005 self.Centre( wx.BOTH )
2007 def __del__( self ):
2010 class PrefChi(sc.SizedDialog):
2011 def __init__(self, parent, ID, optionchi, title):
2013 sc.SizedDialog.__init__(self, None, -1, _(u"Settings").decode('utf8'),
2014 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER)
2015 pane = self.GetContentsPane()
2016 pane.SetSizerType("form")
2017 pane.SetSizerProps(border=("all",5))
2018 self.parent = parent
2019 self.optionchi = optionchi
2022 self.label_obs = wx.StaticText(pane, -1, _(u"observed values").decode('utf8'))
2023 self.check1 = wx.CheckBox(pane, -1)
2025 self.label_theo = wx.StaticText(pane, -1, _(u"expected values").decode('utf8'))
2026 self.check2 = wx.CheckBox(pane, -1)
2028 self.label_resi = wx.StaticText(pane, -1, _(u"residuals").decode('utf8'))
2029 self.check3 = wx.CheckBox(pane, -1)
2031 self.label_contrib = wx.StaticText(pane, -1, _(u"standardized residuals").decode('utf8'))
2032 self.check4 = wx.CheckBox(pane, -1)
2033 # self.label_graph = wx.StaticText(pane, -1, u'graphique')
2034 # self.check8 = wx.CheckBox(pane, -1)
2035 self.label_pourcent = wx.StaticText(pane, -1, _(u"total percentage").decode('utf8'))
2036 self.check5 = wx.CheckBox(pane, -1)
2038 self.label_prl = wx.StaticText(pane, -1, _(u"row percentage").decode('utf8'))
2039 self.check6 = wx.CheckBox(pane, -1)
2041 self.label_prc = wx.StaticText(pane, -1, _(u"column percentage").decode('utf8'))
2042 self.check7 = wx.CheckBox(pane, -1)
2044 self.label_graph = wx.StaticText(pane, -1, _(u"graphical").decode('utf8'))
2045 self.check8 = wx.CheckBox(pane, -1)
2047 self.label_graphbw = wx.StaticText(pane, -1, _(u"black and white graphical").decode('utf8'))
2048 self.checkbw = wx.CheckBox(pane, -1)
2050 self.SetButtonSizer(self.CreateStdDialogButtonSizer(wx.OK | wx.CANCEL))
2052 self.__set_properties()
2054 self.SetMinSize(self.GetSize())
2056 def __set_properties(self):
2057 self.check1.SetValue(self.optionchi['valobs'])
2058 self.check2.SetValue(self.optionchi['valtheo'])
2059 self.check3.SetValue(self.optionchi['resi'])
2060 self.check4.SetValue(self.optionchi['contrib'])
2061 self.check5.SetValue(self.optionchi['pourcent'])
2062 self.check6.SetValue(self.optionchi['pourcentl'])
2063 self.check7.SetValue(self.optionchi['pourcentc'])
2064 self.check8.SetValue(self.optionchi['graph'])
2065 self.checkbw.SetValue(self.optionchi['bw'])
2067 class ChiDialog(wx.Dialog):
2069 self, parent, ID, title, optionchi, size=wx.DefaultSize, pos=wx.DefaultPosition,
2070 style=wx.DEFAULT_DIALOG_STYLE
2073 pre = wx.PreDialog()
2074 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
2075 pre.Create(parent, ID, title, pos, size, style)
2077 self.PostCreate(pre)
2078 self.parent = parent
2079 self.optionchi = optionchi
2081 #self.Filename=parent.filename
2082 #self.content=parent.content[:]
2083 self.headers=parent.tableau.get_colnames()
2086 for i in self.headers:
2088 LABELLIST.append(i[0:60])
2093 self.LabelListOK=LABELLIST
2095 self.list_box_1 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2096 self.list_box_2 = wx.ListBox(self, -1, choices=self.LabelListOK, style=wx.LB_EXTENDED|wx.LB_HSCROLL)
2097 self.button_1 = wx.Button(self, wx.ID_OK)
2098 self.button_cancel = wx.Button(self, wx.ID_CANCEL)
2099 self.button_pref = wx.Button(self, wx.ID_PREFERENCES)
2100 self.__set_properties()
2103 self.Bind(wx.EVT_LISTBOX, self.Select1, self.list_box_1)
2104 self.Bind(wx.EVT_BUTTON, self.onparam, self.button_pref)
2106 #-------------------------------
2107 def __set_properties(self):
2108 # begin wxGlade: ConfChi2.__set_properties
2109 self.SetTitle(_(u"Variables selection").decode('utf8'))
2111 def __do_layout(self):
2112 # begin wxGlade: ConfChi2.__do_layout
2113 sizer_1 = wx.BoxSizer(wx.VERTICAL)
2114 sizer_2 = wx.BoxSizer(wx.VERTICAL)
2115 sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
2116 sizer_4 = wx.BoxSizer(wx.HORIZONTAL)
2117 sizer_3.Add(self.list_box_1, 0, wx.EXPAND, 0)
2118 sizer_3.Add(self.list_box_2, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 0)
2119 sizer_2.Add(sizer_3, 1, wx.EXPAND, 0)
2120 sizer_4.Add(self.button_cancel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2121 sizer_4.Add(self.button_pref, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2122 sizer_4.Add(self.button_1, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL, 0)
2123 sizer_2.Add(sizer_4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 0)
2124 sizer_1.Add(sizer_2, 1, wx.EXPAND, 0)
2125 self.SetSizer(sizer_1)
2130 def Select1(self, event): # wxGlade: ConfChi2.<event_handler>
2134 def onparam(self,event):
2135 self.dial = PrefChi(self.parent, -1, self.optionchi, '')
2136 self.dial.CenterOnParent()
2137 self.chiopt = self.dial.ShowModal()
2139 class CorpusPref ( wx.Dialog ):
2141 def __init__( self, parent, parametres ):
2142 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Settings").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2143 self.parent = parent
2144 langues_n = [u'français', u'english', u'german (expérimentale)', u'italian', u'swedish (expérimentale)', u'portuguese (expérimentale)', u'spanish (expérimentale)', u'greek (expériementale)', u'autre...']
2145 self.langues = [u'french', u'english', u'german', u'italian', u'swedish', u'portuguese', u'spanish', u'greek', u'other']
2146 self.encodages = [enc[0].lower() for enc in encodages]
2148 ucimark = [u'****', u'0000']
2149 ucemethod = [_(u"characters").decode('utf8'), _(u"occurrences").decode('utf8'), _(u"paragraphs").decode('utf8')]
2151 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2153 bSizer1 = wx.BoxSizer( wx.VERTICAL )
2155 self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
2156 self.m_panel1 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2157 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2158 fgSizer1.SetFlexibleDirection( wx.BOTH )
2159 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2161 self.m_staticText7 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Corpora").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2162 self.m_staticText7.Wrap( -1 )
2163 fgSizer1.Add( self.m_staticText7, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2165 self.txtpath = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Path").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2166 self.txtpath.Wrap( -1 )
2167 fgSizer1.Add( self.txtpath, 0, wx.ALL, 5 )
2169 self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Characters set").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2170 self.m_staticText1.Wrap( -1 )
2171 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2173 encodage_choicesChoices = [' - '.join(encodage) for encodage in encodages]
2174 self.encodage_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, encodage_choicesChoices, 0 )
2175 self.encodage_choices.SetSelection( 0 )
2176 fgSizer1.Add( self.encodage_choices, 0, wx.ALL, 5 )
2178 self.m_staticText2 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Language").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2179 self.m_staticText2.Wrap( -1 )
2180 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2182 lang_choicesChoices = langues_n
2183 self.lang_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, lang_choicesChoices, 0 )
2184 self.lang_choices.SetSelection( 0 )
2185 fgSizer1.Add( self.lang_choices, 0, wx.ALL, 5 )
2187 self.m_staticText3 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Output folder").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2188 self.m_staticText3.Wrap( -1 )
2189 fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2192 fgSizer41 = wx.FlexGridSizer( 0, 2, 0, 0 )
2193 fgSizer41.SetFlexibleDirection( wx.BOTH )
2194 fgSizer41.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2196 self.repout_choices = wx.TextCtrl( self.m_panel1, wx.ID_ANY, u"MyLabel", wx.DefaultPosition, wx.DefaultSize, 0 )
2197 self.repout_choices.SetMinSize( wx.Size( 400,-1 ) )
2198 fgSizer41.Add( self.repout_choices, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2200 self.m_button1 = wx.Button( self.m_panel1, wx.ID_ANY, _(u"Change ...").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2201 fgSizer41.Add( self.m_button1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2203 fgSizer1.Add( fgSizer41, 1, wx.EXPAND, 5 )
2205 self.m_staticText12 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Text mark").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2206 self.m_staticText12.Wrap( -1 )
2207 fgSizer1.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2209 ucimark_choicesChoices = ucimark
2210 self.ucimark_choices = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, ucimark_choicesChoices, 0 )
2211 self.ucimark_choices.SetSelection( 0 )
2212 fgSizer1.Add( self.ucimark_choices, 0, wx.ALL, 5 )
2214 self.m_staticText6 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Use the expression dictionary").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2215 self.m_staticText6.Wrap( -1 )
2216 fgSizer1.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2218 self.check_expressions = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2219 self.check_expressions.SetValue(True)
2220 fgSizer1.Add( self.check_expressions, 0, wx.ALL, 5 )
2222 self.m_staticText9 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Make text segments").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2223 self.m_staticText9.Wrap( -1 )
2224 fgSizer1.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2226 self.check_makeuce = wx.CheckBox( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2227 self.check_makeuce.SetValue(True)
2228 fgSizer1.Add( self.check_makeuce, 0, wx.ALL, 5 )
2230 self.m_staticText10 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Text segments build process").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2231 self.m_staticText10.Wrap( -1 )
2232 fgSizer1.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2234 uce_modeChoices = ucemethod
2235 self.uce_mode = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, uce_modeChoices, 0 )
2236 self.uce_mode.SetSelection( 0 )
2237 fgSizer1.Add( self.uce_mode, 0, wx.ALL, 5 )
2239 self.m_staticText13 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Text segments size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2240 self.m_staticText13.Wrap( -1 )
2241 fgSizer1.Add( self.m_staticText13, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2243 self.uce_size = wx.SpinCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 1000000, 40 )
2244 fgSizer1.Add( self.uce_size, 0, wx.ALL, 5 )
2247 self.m_panel1.SetSizer( fgSizer1 )
2248 self.m_panel1.Layout()
2249 fgSizer1.Fit( self.m_panel1 )
2250 self.m_notebook1.AddPage( self.m_panel1, _(u"General").decode('utf8'), True )
2251 self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2252 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
2253 fgSizer3.SetFlexibleDirection( wx.BOTH )
2254 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2256 self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Put text in lowercase").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2257 self.m_staticText4.Wrap( -1 )
2258 fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2260 self.check_lower = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2261 self.check_lower.SetValue(True)
2262 fgSizer3.Add( self.check_lower, 0, wx.ALL, 5 )
2264 self.m_staticText5 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Delete characters not in this list").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2265 self.m_staticText5.Wrap( -1 )
2266 fgSizer3.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2268 fgSizer4 = wx.FlexGridSizer( 0, 2, 0, 0 )
2269 fgSizer4.SetFlexibleDirection( wx.BOTH )
2270 fgSizer4.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2272 self.check_charact = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2273 self.check_charact.SetValue(True)
2274 fgSizer4.Add( self.check_charact, 0, wx.ALL, 5 )
2276 self.txt_charact = wx.TextCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2277 self.txt_charact.SetMinSize( wx.Size( 400,-1 ) )
2279 fgSizer4.Add( self.txt_charact, 0, wx.ALL|wx.EXPAND, 5 )
2282 fgSizer3.Add( fgSizer4, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
2284 self.m_staticText14 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Replace apostrophe by space").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2285 self.m_staticText14.Wrap( -1 )
2286 fgSizer3.Add( self.m_staticText14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2288 self.check_apos = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2289 self.check_apos.SetValue(True)
2290 fgSizer3.Add( self.check_apos, 0, wx.ALL, 5 )
2292 self.m_staticText15 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Replace dash by space").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2293 self.m_staticText15.Wrap( -1 )
2294 fgSizer3.Add( self.m_staticText15, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2296 self.check_tirets = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2297 self.check_tirets.SetValue(True)
2298 fgSizer3.Add( self.check_tirets, 0, wx.ALL, 5 )
2300 self.m_staticText17 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Keep punctuation").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2301 self.m_staticText17.Wrap( -1 )
2302 fgSizer3.Add( self.m_staticText17, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2304 self.check_ponct = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2305 fgSizer3.Add( self.check_ponct, 0, wx.ALL, 5 )
2307 self.m_staticText16 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"No space between two forms").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2308 self.m_staticText16.Wrap( -1 )
2309 fgSizer3.Add( self.m_staticText16, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2311 self.check_tolist = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2312 fgSizer3.Add( self.check_tolist, 0, wx.ALL, 5 )
2315 self.m_panel2.SetSizer( fgSizer3 )
2316 self.m_panel2.Layout()
2317 fgSizer3.Fit( self.m_panel2 )
2318 self.m_notebook1.AddPage( self.m_panel2, _(u"Cleaning").decode('utf8'), False )
2320 bSizer1.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
2322 m_sdbSizer1 = wx.StdDialogButtonSizer()
2323 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2324 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2325 self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2326 m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2327 m_sdbSizer1.Realize();
2329 bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
2332 self.Bind(wx.EVT_BUTTON, self.OnChangeDir, self.m_button1)
2333 self.setparametres(parametres)
2334 self.SetSizer( bSizer1 )
2338 self.Centre( wx.BOTH )
2340 def OnChangeDir(self, evt) :
2341 dlg = wx.DirDialog(self.parent, _(u"Choose a folder").decode('utf8'), style = wx.DD_DEFAULT_STYLE)
2342 if dlg.ShowModal() == wx.ID_OK :
2343 self.repout_choices.SetValue(dlg.GetPath())
2345 def __del__( self ):
2348 def setparametres(self, parametres) :
2349 if locale.getpreferredencoding().lower() == 'mac-roman' :
2350 enc = self.encodages.index('macroman')
2353 enc = self.encodages.index(locale.getpreferredencoding().lower())
2355 enc = self.encodages.index('utf-8')
2356 self.encodage_choices.SetSelection(enc)
2357 self.lang_choices.SetSelection(0)
2358 self.repout_choices.SetValue(parametres['pathout'])
2359 self.ucimark_choices.SetSelection(parametres['ucimark'])
2360 self.check_expressions.SetValue(parametres['expressions'])
2361 self.check_makeuce.SetValue(parametres['douce'])
2362 self.uce_mode.SetSelection(parametres['ucemethod'])
2363 self.uce_size.SetValue(parametres['ucesize'])
2364 self.check_lower.SetValue(parametres['lower'])
2365 #self.check_charact.SetValue(parametres['charact'])
2366 self.txt_charact.SetValue(parametres['keep_caract'])
2367 self.check_apos.SetValue(parametres['apos'])
2368 self.check_tirets.SetValue(parametres['tiret'])
2369 self.check_tolist.SetValue(parametres['tolist'])
2370 self.check_ponct.SetValue(parametres['keep_ponct'])
2372 def doparametres(self) :
2374 parametres['encoding'] = encodages[self.encodage_choices.GetSelection()][0]
2375 parametres['lang'] = self.langues[self.lang_choices.GetSelection()]
2376 parametres['pathout'] = self.repout_choices.GetValue()
2377 parametres['ucimark'] = self.ucimark_choices.GetSelection()
2378 parametres['expressions'] = self.check_expressions.GetValue()
2379 parametres['douce'] = self.check_makeuce.GetValue()
2380 parametres['ucemethod'] = self.uce_mode.GetSelection()
2381 parametres['ucesize'] = self.uce_size.GetValue()
2382 parametres['lower'] = self.check_lower.GetValue()
2383 parametres['charact'] = self.check_charact.GetValue()
2384 parametres['keep_caract'] = self.txt_charact.GetValue()
2385 parametres['apos'] = self.check_apos.GetValue()
2386 parametres['tiret'] = self.check_tirets.GetValue()
2387 parametres['tolist'] = self.check_tolist.GetValue()
2388 parametres['keep_ponct'] = self.check_ponct.GetValue()
2389 for val in parametres :
2390 if isinstance(parametres[val], bool) :
2391 if parametres[val] :
2397 class message(wx.Dialog):
2398 def __init__(self, parent, title, size, save = True):
2399 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = title, pos = wx.DefaultPosition, size = size, style = wx.DEFAULT_DIALOG_STYLE )
2401 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2404 self.HtmlPage=wx.html.HtmlWindow(self, -1)
2405 self.HtmlPage.SetMinSize( size )
2406 if "gtk2" in wx.PlatformInfo:
2407 self.HtmlPage.SetStandardFonts()
2408 self.HtmlPage.SetFonts('Courier','Courier')
2410 self.button_1 = wx.Button(self, wx.ID_CANCEL)
2412 self.Bind(wx.EVT_BUTTON, self.OnCloseMe, self.button_1)
2414 self.button_2 = wx.Button(self, wx.ID_SAVE)
2415 self.Bind(wx.EVT_BUTTON, self.OnSavePage, self.button_2)
2416 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
2419 def __do_layout(self):
2420 sizer_2 = wx.BoxSizer(wx.VERTICAL)
2421 sizer_2.Add(self.HtmlPage, 0, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
2422 m_sdbSizer1 = wx.StdDialogButtonSizer()
2423 m_sdbSizer1.AddButton( self.button_1 )
2425 m_sdbSizer1.AddButton( self.button_2 )
2426 m_sdbSizer1.Realize()
2427 sizer_2.Add(m_sdbSizer1, 1, wx.EXPAND, 5)
2428 self.SetSizer(sizer_2)
2432 def OnSavePage(self, evt) :
2433 dlg = wx.FileDialog(
2434 self, message=_(u"Save as ...").decode('utf8'), defaultDir=os.getcwd(),
2435 defaultFile="concordancier.html", wildcard="html|*.html", style=wx.SAVE | wx.OVERWRITE_PROMPT
2437 dlg.SetFilterIndex(2)
2438 dlg.CenterOnParent()
2439 if dlg.ShowModal() == wx.ID_OK:
2440 path = dlg.GetPath()
2441 with open(path, 'w') as f :
2444 def OnCloseMe(self, event):
2447 def OnCloseWindow(self, event):
2450 class ExtractDialog ( wx.Dialog ):
2452 def __init__( self, parent, option ):
2453 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2455 self.option = option
2457 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2459 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2460 fgSizer1.SetFlexibleDirection( wx.BOTH )
2461 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2463 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Corpora").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2464 self.m_staticText1.Wrap( -1 )
2465 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
2467 self.corpusfile = wx.FilePickerCtrl( self, wx.ID_ANY, wx.EmptyString, _(u"Select a file").decode('utf8'), u"*.txt", wx.DefaultPosition, wx.Size( -1,-1 ), wx.FLP_DEFAULT_STYLE|wx.FLP_FILE_MUST_EXIST|wx.FLP_OPEN )
2468 self.corpusfile.SetMinSize( wx.Size( 500,-1 ) )
2470 fgSizer1.Add( self.corpusfile, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
2472 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"Characters set").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2473 self.m_staticText2.Wrap( -1 )
2474 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2476 encodageChoices = [' - '.join(encodage) for encodage in encodages]
2477 self.encodage = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, encodageChoices, 0 )
2478 self.encodage.SetSelection( 0 )
2479 self.encodage.SetMinSize( wx.Size( 200,-1 ) )
2481 fgSizer1.Add( self.encodage, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
2483 if option == 'splitvar' :
2484 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"Variables (with the * but without the _)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2485 self.m_staticText3.Wrap( -1 )
2486 fgSizer1.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2488 self.txtvar = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
2489 self.txtvar.SetMinSize( wx.Size( 200,-1 ) )
2491 fgSizer1.Add( self.txtvar, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
2493 if option == 'mods' :
2494 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"Modalities (one by line, with the *)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2495 self.m_staticText4.Wrap( -1 )
2496 fgSizer1.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2498 self.txtmods = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.TE_MULTILINE )
2499 self.txtmods.SetMinSize( wx.Size( 200,150 ) )
2501 fgSizer1.Add( self.txtmods, 0, wx.ALL|wx.EXPAND, 5 )
2503 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Extraction type").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2504 self.m_staticText5.Wrap( -1 )
2505 fgSizer1.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2507 extractformatChoices = [ _(u"Only one file").decode('utf8'), _(u"One file by modality").decode('utf8') ]
2508 self.extractformat = wx.RadioBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, extractformatChoices, 1, wx.RA_SPECIFY_COLS )
2509 self.extractformat.SetSelection( 0 )
2510 fgSizer1.Add( self.extractformat, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2513 fgSizer1.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
2515 m_sdbSizer1 = wx.StdDialogButtonSizer()
2516 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2517 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2518 self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2519 m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2520 m_sdbSizer1.Realize();
2522 fgSizer1.Add( m_sdbSizer1, 1, wx.EXPAND, 5 )
2525 self.SetSizer( fgSizer1 )
2527 fgSizer1.Fit( self )
2529 self.Centre( wx.BOTH )
2531 def make_param(self) :
2533 le = [enc[0].lower() for enc in encodages]
2534 parametres['filein'] = self.corpusfile.GetPath()
2535 encodage = le[self.encodage.GetSelection()]
2536 parametres['encodein'] = encodage
2537 if self.option == 'splitvar' :
2538 parametres['var'] = self.txtvar.GetValue()
2539 if self.option == 'mods' :
2540 parametres['mods'] = self.txtmods.GetValue().splitlines()
2541 if self.extractformat.GetSelection() == 0 :
2542 parametres['onefile'] = True
2544 parametres['onefile'] = False
2545 parametres['encodeout'] = locale.getpreferredencoding()
2548 def __del__( self ):
2551 class FreqDialog(wx.Dialog):
2552 def __init__(self, parent, ID, listcol, title, size) :
2553 wx.Dialog.__init__(self, parent, ID, title, size=size, pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE | wx.CANCEL | wx.OK )
2554 pre = wx.PreDialog()
2555 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
2556 pre.Create(parent, ID, title, wx.DefaultPosition, size, wx.DEFAULT_DIALOG_STYLE | wx.CANCEL | wx.OK)
2557 self.PostCreate(pre)
2558 self.parent = parent
2559 sizer = wx.BoxSizer(wx.VERTICAL)
2560 #self.content = parent.content
2561 self.header = listcol
2563 #for i in self.header:
2565 # if len(forme) > 60 :
2566 # LABELLIST.append(i[0:60])
2568 # LABELLIST.append(i)
2569 self.list_box_1 = wx.ListBox(self, -1, choices=self.header, style=wx.LB_EXTENDED | wx.LB_HSCROLL)
2570 sizer.Add(self.list_box_1, 0, 5)
2572 btnsizer = wx.BoxSizer(wx.HORIZONTAL)
2574 btn = wx.Button(self, wx.ID_CANCEL)
2577 btn = wx.Button(self, wx.ID_OK)
2581 sizer.Add(btnsizer, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALIGN_CENTER_HORIZONTAL, 5)
2582 self.SetSizer(sizer)
2584 self.SetTitle(_(u"Selection").decode('utf8'))
2588 class ProtoDial ( wx.Dialog ):
2590 def __init__( self, parent, headers ):
2591 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = _(u"Settings").decode('utf8'), pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2593 self.SetSizeHintsSz( wx.Size( 200,300 ), wx.DefaultSize )
2595 bSizer1 = wx.BoxSizer( wx.VERTICAL )
2597 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
2598 fgSizer1.SetFlexibleDirection( wx.BOTH )
2599 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2601 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, _(u"Variables").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2602 self.m_staticText1.Wrap( -1 )
2603 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
2605 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, _(u"Ranks").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2606 self.m_staticText2.Wrap( -1 )
2607 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
2609 variablesChoices = headers
2610 self.variables = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, variablesChoices, wx.LB_MULTIPLE )
2611 self.variables.SetMinSize( wx.Size( 150,-1 ) )
2613 fgSizer1.Add( self.variables, 0, wx.ALL|wx.EXPAND, 5 )
2615 rangsChoices = headers
2616 self.rangs = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, rangsChoices, wx.LB_MULTIPLE )
2617 self.rangs.SetMinSize( wx.Size( 150,-1 ) )
2619 fgSizer1.Add( self.rangs, 0, wx.ALL|wx.EXPAND, 5 )
2622 bSizer1.Add( fgSizer1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 5 )
2624 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
2625 fgSizer3.SetFlexibleDirection( wx.BOTH )
2626 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
2628 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, _(u"Limit frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2629 self.m_staticText3.Wrap( -1 )
2630 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2632 bSizer2 = wx.BoxSizer( wx.HORIZONTAL )
2634 choix_freqChoices = [ _(u"automatic (mean)").decode('utf8'), _(u"manual").decode('utf8') ]
2635 self.choix_freq = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choix_freqChoices, 0 )
2636 self.choix_freq.SetSelection( 0 )
2637 bSizer2.Add( self.choix_freq, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2639 self.freqlim = wx.TextCtrl( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE )
2640 self.freqlim.Enable( False )
2641 self.freqlim.SetMinSize( wx.Size( 100,-1 ) )
2643 bSizer2.Add( self.freqlim, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2646 fgSizer3.Add( bSizer2, 1, wx.EXPAND, 5 )
2648 self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, _(u"Limit rank").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2649 self.m_staticText4.Wrap( -1 )
2650 fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2652 bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
2654 choix_rangChoices = [ _(u"automatic (mean)").decode('utf8'), _(u"manual").decode('utf8')]
2655 self.choix_rang = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choix_rangChoices, 0 )
2656 self.choix_rang.SetSelection( 0 )
2657 bSizer21.Add( self.choix_rang, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2659 self.ranglim = wx.TextCtrl( self, wx.ID_ANY, u"0", wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE )
2660 self.ranglim.Enable( False )
2661 self.ranglim.SetMinSize( wx.Size( 100,-1 ) )
2663 bSizer21.Add( self.ranglim, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2666 fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
2668 self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, _(u"Minimum frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2669 self.m_staticText5.Wrap( -1 )
2670 fgSizer3.Add( self.m_staticText5, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
2672 self.m_textCtrl4 = wx.TextCtrl( self, wx.ID_ANY, u"2", wx.DefaultPosition, wx.DefaultSize, wx.TE_CENTRE )
2673 fgSizer3.Add( self.m_textCtrl4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALL, 5 )
2676 bSizer1.Add( fgSizer3, 1, wx.EXPAND, 5 )
2678 m_sdbSizer1 = wx.StdDialogButtonSizer()
2679 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2680 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2681 self.m_sdbSizer1Cancel = wx.Button( self, wx.ID_CANCEL )
2682 m_sdbSizer1.AddButton( self.m_sdbSizer1Cancel )
2683 m_sdbSizer1.Realize();
2685 bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
2687 self.SetSizer( bSizer1 )
2691 self.Centre( wx.BOTH )
2694 self.choix_freq.Bind( wx.EVT_CHOICE, self.UpdateText )
2695 self.choix_rang.Bind( wx.EVT_CHOICE, self.UpdateText )
2697 def __del__( self ):
2701 # Virtual event handlers, overide them in your derived class
2702 def UpdateText( self, event ):
2705 class SimpleDialog ( wx.Dialog ):
2707 def __init__( self, parent ):
2708 wx.Dialog.__init__ ( self, parent, id = wx.ID_ANY, title = wx.EmptyString, pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_DIALOG_STYLE )
2710 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
2712 bSizer1 = wx.BoxSizer( wx.VERTICAL )
2714 self.m_panel1 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
2715 bSizer2 = wx.BoxSizer( wx.VERTICAL )
2717 self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, _(u"Export finished. Open in a web browser :").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
2718 self.m_staticText1.Wrap( -1 )
2719 bSizer2.Add( self.m_staticText1, 0, wx.ALL, 5 )
2721 self.link = wx.HyperlinkCtrl( self.m_panel1, wx.ID_ANY, u"wxFB Website", u"http://www.wxformbuilder.org", wx.DefaultPosition, wx.DefaultSize, wx.HL_DEFAULT_STYLE )
2722 bSizer2.Add( self.link, 0, wx.ALL, 5 )
2725 self.m_panel1.SetSizer( bSizer2 )
2726 self.m_panel1.Layout()
2727 bSizer2.Fit( self.m_panel1 )
2728 bSizer1.Add( self.m_panel1, 1, wx.EXPAND |wx.ALL, 5 )
2730 m_sdbSizer1 = wx.StdDialogButtonSizer()
2731 self.m_sdbSizer1OK = wx.Button( self, wx.ID_OK )
2732 m_sdbSizer1.AddButton( self.m_sdbSizer1OK )
2733 m_sdbSizer1.Realize();
2735 bSizer1.Add( m_sdbSizer1, 0, wx.EXPAND, 5 )
2738 self.SetSizer( bSizer1 )
2742 self.Centre( wx.BOTH )
2744 def __del__( self ):