1 # -*- coding: utf-8 -*-
2 #Author: Pierre Ratinaud
3 #Copyright (c) 2008-2011 Pierre Ratinaud
12 from vitemspicker import VItemsPicker, EVT_IP_SELECTION_CHANGED, IP_SORT_CHOICES, IP_SORT_SELECTED, IP_REMOVE_FROM_CHOICES
13 from functions import treat_var_mod
16 def OnOpen(self, type):
18 wildcard = u"Fichiers supportés|*.ods;*.xls;*.csv;*.txt|Openoffice Calc|*.ods|Excel 97/2000/XP/2003|*.xls|Fichier csv|*.csv|Fichier texte|*.txt|Tous les fichiers|*"
20 wildcard = "Fichier texte|*.txt|Tous les fichiers|*"
21 elif type == "Analyse":
22 wildcard = "Fichier analyse/Corpus|*.ira;*.cira"
23 defaultDir = self.PathPath.get('PATHS', 'lastpath')
24 if defaultDir.strip() == '':
25 defaultDir = self.UserConfigPath.replace('.iramuteq','')
27 self, message=_(u"Choose a file").decode('utf8'), defaultDir=defaultDir,
28 defaultFile="", wildcard=wildcard, style=wx.OPEN | wx.CHANGE_DIR)
30 if dlg.ShowModal() == wx.ID_OK :
31 fileName = dlg.GetFilename()
34 self.PathPath.set('PATHS', 'lastpath', os.path.dirname(path[0]))
43 elif type == "Analyse":
46 def getfileextension(file) :
47 return os.path.splitext(file)[1]
49 def get_table_param(self, filename) :
50 if getfileextension(filename) == '.csv':
51 dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=True, size=(350, 200),
52 style=wx.DEFAULT_DIALOG_STYLE)
56 self.tableau.parametres['colsep'] = dlg.colsep[dlg.choice3.GetSelection()]
57 self.tableau.parametres['txtsep'] = dlg.txtsep[dlg.choice4.GetSelection()]
58 if self.tableau.parametres['colsep'] == 'tabulation' :
59 self.tableau.parametres['colsep'] = '\t'
60 self.tableau.parametres['filetype'] = 'csv'
61 elif getfileextension(filename) == '.xls' :
62 dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, sheet = True, size=(350, 200),
63 style=wx.DEFAULT_DIALOG_STYLE)
67 self.tableau.parametres['colsep'] = ';'
68 self.tableau.parametres['txtsep'] = '\"'
69 self.tableau.parametres['encodage'] = sys.getdefaultencoding()
70 self.tableau.parametres['sheetnb'] = dlg.spin1.GetValue()
71 self.tableau.parametres['filetype'] = 'xls'
72 elif getfileextension(filename) == '.ods':
73 dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, size=(350, 200),
74 style=wx.DEFAULT_DIALOG_STYLE)
78 self.tableau.parametres['colsep'] = ';'
79 self.tableau.parametres['txtsep'] = '\"'
80 self.tableau.parametres['filetype'] = 'ods'
84 if dlg.radio_box_1.GetSelection() == 0:
85 self.tableau.firstrowiscolnames = True
87 self.tableau.firstrowiscolnames = False
88 if dlg.radio_box_2.GetSelection() == 0:
89 self.tableau.firstcolisrownames = True
91 self.tableau.firstcolisrownames = False
96 if '_mgr' in dir(ira) :
97 if not ira._mgr.GetPane('Text').IsShown() :
98 if ira.nb.GetPageCount() >= 1:
99 return ira.nb.GetPage(ira.nb.GetSelection())
107 def getCorpus(page) :
108 if 'corpus' in page.__dict__:
109 return copy(page.corpus)
114 def __init__(self, parent, dictcol, actives, pathout, selected = None, dlg = False) :
117 dial = dialog.SelectColDial(self.ira)
118 listcol = ListForSpec(dial, self, dictcol, ['eff'])
119 dial.bSizer2.Add( listcol, 2, wx.ALL|wx.EXPAND, 5 )
120 dial.m_sdbSizer2.AddButton( dial.m_sdbSizer2OK )
121 dial.m_sdbSizer2.AddButton( dial.butok)
122 dial.m_sdbSizer2.Realize()
123 dial.bSizer2.Add( dial.m_sdbSizer2, 0, wx.EXPAND, 5 )
125 if selected is None :
126 for row in xrange(listcol.GetItemCount()):
129 orderlex = dict([[listcol.getColumnText(i,0),i] for i in range(0,listcol.GetItemCount())])
130 for row in selected :
131 listcol.Select(orderlex[actives[row]])
132 dial.CenterOnParent()
133 val = dial.ShowModal()
135 last = listcol.GetFirstSelected()
136 lastl = [listcol.GetFirstSelected()]
137 indexes = [listcol.getColumnText(listcol.GetFirstSelected(),0)]
138 while listcol.GetNextSelected(last) != -1:
139 last = listcol.GetNextSelected(last)
141 indexes.append(listcol.getColumnText(last,0))
143 column = [actives.index(val) for val in indexes]
145 with open(pathout, 'w') as f :
146 f.write('\n'.join([`val` for val in column]))
151 if selected is None :
152 selected = [i for i in range(0, len(actives))]
153 with open(pathout, 'w') as f :
154 f.write('\n'.join([`i` for i in selected]))
157 class PrefSimi ( wx.Dialog ):
159 def __init__( self, parent, ID, paramsimi, indices, wordlist = None, selected = None, actives = None):
160 wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = _(u"Settings").decode('utf8'), pos = wx.DefaultPosition, size = wx.Size( -1,-1 ), style = wx.DEFAULT_DIALOG_STYLE )
163 self.paramsimi=paramsimi
164 self.indices = indices
166 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
168 bSizer16 = wx.BoxSizer( wx.HORIZONTAL )
169 if wordlist is not None :
170 self.listcol = ListForSpec(self, self, wordlist, ['eff'])
171 self.listcol.SetMinSize( wx.Size( 270,-1 ) )
172 listsizer = wx.BoxSizer( wx.VERTICAL )
173 countsizer = wx.BoxSizer( wx.HORIZONTAL )
174 self.butcount = wx.Button(self, -1, "count")
175 self.textcount = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size( 100,-1 ), wx.TE_READONLY )
176 countsizer.Add(self.butcount, 0, wx.ALL, 5)
177 countsizer.Add(self.textcount, 0, wx.ALL, 5 )
178 listsizer.Add(countsizer, 0, wx.ALL, 5)
179 listsizer.Add(self.listcol, 2, wx.ALL|wx.EXPAND, 5 )
180 #bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 )
181 bSizer16.Add( listsizer, 0, wx.ALL|wx.EXPAND, 5)
182 if selected is None :
183 for row in xrange(self.listcol.GetItemCount()):
184 self.listcol.Select(row)
186 self.orderlex = dict([[self.listcol.getColumnText(i,0),i] for i in range(0,self.listcol.GetItemCount())])
187 for row in selected :
188 self.listcol.Select(self.orderlex[actives[row]])
191 fgSizer10 = wx.FlexGridSizer( 2, 1, 0, 0 )
192 fgSizer10.SetFlexibleDirection( wx.BOTH )
193 fgSizer10.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
195 self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
196 self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
197 bSizer18 = wx.BoxSizer( wx.VERTICAL )
199 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
200 fgSizer3.SetFlexibleDirection( wx.BOTH )
201 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
203 if not self.paramsimi['first'] :
205 self.m_staticText271 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Use previous coordinates").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
206 self.m_staticText271.Wrap( -1 )
207 fgSizer3.Add( self.m_staticText271, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
209 self.check_coord = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
210 fgSizer3.Add( self.check_coord, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
212 self.m_staticline36 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
213 fgSizer3.Add( self.m_staticline36, 0, wx.EXPAND, 5 )
215 self.m_staticline37 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
216 fgSizer3.Add( self.m_staticline37, 0, wx.EXPAND, 5 )
218 self.m_staticText3 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
219 self.m_staticText3.Wrap( -1 )
220 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
223 self.choice1 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.indices, 0 )
224 self.choice1.SetSelection( 0 )
225 fgSizer3.Add( self.choice1, 0, wx.ALL, 5 )
227 self.m_staticline293 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
228 fgSizer3.Add( self.m_staticline293, 0, wx.EXPAND, 5 )
230 self.m_staticline292 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
231 fgSizer3.Add( self.m_staticline292, 0, wx.EXPAND, 5 )
233 self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Layout").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
234 self.m_staticText4.Wrap( -1 )
235 fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
237 choice2Choices = [ u"random", u"cercle", u"fruchterman reingold", u"kamada kawai", u"graphopt" ]
238 self.choice2 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice2Choices, 0 )
239 self.choice2.SetSelection( 0 )
240 fgSizer3.Add( self.choice2, 0, wx.ALL, 5 )
242 self.m_staticline294 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
243 fgSizer3.Add( self.m_staticline294, 0, wx.EXPAND, 5 )
245 self.m_staticline295 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
246 fgSizer3.Add( self.m_staticline295, 0, wx.EXPAND, 5 )
248 self.m_staticText5 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Graphic type").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
249 self.m_staticText5.Wrap( -1 )
250 fgSizer3.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
252 choice3Choices = [ u"dynamique", u"statique", u"3D", u'web2D', u"web3D" ]
253 self.choice3 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice3Choices, 0 )
254 self.choice3.SetSelection( 0 )
256 label_format = wx.StaticText(self.m_panel2, -1, _(u"Picture format").decode('utf8'))
257 self.choix_format = wx.Choice(self.m_panel2, -1, (100,50), choices = ['png', 'svg'])
258 self.choix_format.SetSelection( 0 )
259 hsizer = wx.BoxSizer(wx.HORIZONTAL)
260 hsizer.Add(self.choice3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
261 hsizer.Add(label_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
262 hsizer.Add(self.choix_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
263 fgSizer3.Add( hsizer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
265 self.m_staticline296 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
266 fgSizer3.Add( self.m_staticline296, 0, wx.EXPAND, 5 )
268 self.m_staticline297 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
269 fgSizer3.Add( self.m_staticline297, 0, wx.EXPAND, 5 )
271 self.m_staticText8 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Maximum tree").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
272 self.m_staticText8.Wrap( -1 )
273 fgSizer3.Add( self.m_staticText8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
275 self.check1 = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
276 fgSizer3.Add( self.check1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
278 self.m_staticline298 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
279 fgSizer3.Add( self.m_staticline298, 0, wx.EXPAND, 5 )
281 self.m_staticline299 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
282 fgSizer3.Add( self.m_staticline299, 0, wx.EXPAND, 5 )
284 self.m_staticText91 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edges threshold").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
285 self.m_staticText91.Wrap( -1 )
286 fgSizer3.Add( self.m_staticText91, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
288 bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
290 self.check_seuil = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
291 bSizer21.Add( self.check_seuil, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
293 self.spin_seuil = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 10000, 1 )
294 bSizer21.Add( self.spin_seuil, 0, wx.ALL, 5 )
297 fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
299 self.m_staticline2910 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
300 fgSizer3.Add( self.m_staticline2910, 0, wx.EXPAND, 5 )
302 self.m_staticline2911 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
303 fgSizer3.Add( self.m_staticline2911, 0, wx.EXPAND, 5 )
305 self.m_staticText19 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text on vertex").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
306 self.m_staticText19.Wrap( -1 )
307 fgSizer3.Add( self.m_staticText19, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
309 self.check_vlab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
310 fgSizer3.Add( self.check_vlab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
312 self.m_staticline2912 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
313 fgSizer3.Add( self.m_staticline2912, 0, wx.EXPAND, 5 )
315 self.m_staticline2913 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
316 fgSizer3.Add( self.m_staticline2913, 0, wx.EXPAND, 5 )
318 self.m_staticText20 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score on edges").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
319 self.m_staticText20.Wrap( -1 )
320 fgSizer3.Add( self.m_staticText20, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
322 self.check_elab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
323 fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
325 self.m_staticline2914 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
326 fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
328 self.m_staticline2915 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
329 fgSizer3.Add( self.m_staticline2915, 0, wx.EXPAND, 5 )
331 self.m_staticText27 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
332 self.m_staticText27.Wrap( -1 )
333 fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
335 self.spin_cex = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
336 fgSizer3.Add( self.spin_cex, 0, wx.ALL, 5 )
338 self.m_staticline2916 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
339 fgSizer3.Add( self.m_staticline2916, 0, wx.EXPAND, 5 )
341 self.m_staticline2917 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
342 fgSizer3.Add( self.m_staticline2917, 0, wx.EXPAND, 5 )
344 bsizer34 = wx.BoxSizer(wx.HORIZONTAL)
346 comtext = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Communities").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
348 bsizer34.Add(comtext, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
350 self.comcheck = wx.CheckBox(self.m_panel2, -1)
351 bsizer34.Add(self.comcheck, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
353 fgSizer3.Add(bsizer34 , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
355 sizer54 = wx.BoxSizer(wx.HORIZONTAL)
356 self.comlist = ['edge.betweenness.community','fastgreedy.community','label.propagation.community','leading.eigenvector.community','multilevel.community','optimal.community', 'spinglass.community', 'walktrap.community']
357 self.choix_com = wx.Choice( self.m_panel2, wx.ID_ANY, choices = self.comlist)
358 self.choix_com.SetSelection( 0 )
359 self.halo = wx.CheckBox(self.m_panel2, wx.ID_ANY, u'halo')
360 sizer54.Add(self.choix_com , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
361 sizer54.Add(self.halo , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
362 fgSizer3.Add( sizer54, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
364 if 'bystar' in self.paramsimi :
365 self.m_staticText40 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Select a variable").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
366 self.m_staticText40.Wrap( -1 )
367 fgSizer3.Add( self.m_staticText40, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
369 self.check_bystar = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
370 fgSizer3.Add( self.check_bystar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
372 self.m_staticline3200 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
373 fgSizer3.Add( self.m_staticline3200, 0, wx.EXPAND, 5 )
374 self.m_staticline3201 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
375 fgSizer3.Add( self.m_staticline3201, 0, wx.EXPAND, 5 )
378 bSizer18.Add( fgSizer3, 0, wx.EXPAND, 5 )
381 self.m_panel2.SetSizer( bSizer18 )
382 self.m_panel2.Layout()
383 bSizer18.Fit( self.m_panel2 )
384 self.m_notebook1.AddPage( self.m_panel2, _(u"Graph settings").decode('utf8'), True )
385 self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
386 fgSizer5 = wx.FlexGridSizer( 0, 3, 0, 0 )
387 fgSizer5.SetFlexibleDirection( wx.BOTH )
388 fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
390 fgSizer51 = wx.FlexGridSizer( 0, 2, 0, 0 )
391 fgSizer51.SetFlexibleDirection( wx.BOTH )
392 fgSizer51.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
394 self.m_staticText6 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Picture size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
395 self.m_staticText6.Wrap( -1 )
396 fgSizer51.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
398 fgSizer31 = wx.FlexGridSizer( 0, 2, 0, 0 )
399 fgSizer31.SetFlexibleDirection( wx.BOTH )
400 fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
402 self.m_staticText9 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
403 self.m_staticText9.Wrap( -1 )
404 fgSizer31.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
406 self.spin_height = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
407 fgSizer31.Add( self.spin_height, 0, wx.ALL, 5 )
409 self.m_staticText10 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
410 self.m_staticText10.Wrap( -1 )
411 fgSizer31.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
413 self.spin_width = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
414 fgSizer31.Add( self.spin_width, 0, wx.ALL, 5 )
417 fgSizer51.Add( fgSizer31, 1, wx.EXPAND, 5 )
419 self.m_staticline3 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
420 fgSizer51.Add( self.m_staticline3, 0, wx.EXPAND, 5 )
422 self.m_staticline4 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
423 fgSizer51.Add( self.m_staticline4, 0, wx.EXPAND, 5 )
425 self.m_staticText101 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size proportional to frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
426 self.m_staticText101.Wrap( -1 )
427 fgSizer51.Add( self.m_staticText101, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
429 bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
431 bSizer9 = wx.BoxSizer( wx.VERTICAL )
433 self.check2 = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
434 bSizer9.Add( self.check2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
436 self.checki = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
437 bSizer9.Add( self.checki, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
440 bSizer7.Add( bSizer9, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
442 fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 )
443 fgSizer7.SetFlexibleDirection( wx.BOTH )
444 fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
446 self.m_staticText11 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
447 self.m_staticText11.Wrap( -1 )
448 fgSizer7.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
450 self.spin_tvmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
451 fgSizer7.Add( self.spin_tvmin, 0, wx.ALL, 5 )
453 self.m_staticText12 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
454 self.m_staticText12.Wrap( -1 )
455 fgSizer7.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
457 self.spin_tvmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
458 fgSizer7.Add( self.spin_tvmax, 0, wx.ALL, 5 )
461 bSizer7.Add( fgSizer7, 1, wx.EXPAND, 5 )
464 fgSizer51.Add( bSizer7, 1, wx.EXPAND, 5 )
466 self.m_staticline31 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
467 fgSizer51.Add( self.m_staticline31, 0, wx.EXPAND, 5 )
469 self.m_staticline32 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
470 fgSizer51.Add( self.m_staticline32, 0, wx.EXPAND, 5 )
472 self.m_staticText1011 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex text size proportional to frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
473 self.m_staticText1011.Wrap( -1 )
474 fgSizer51.Add( self.m_staticText1011, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
476 bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
478 bSizer8 = wx.BoxSizer( wx.VERTICAL )
480 self.check_vcex = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
481 bSizer8.Add( self.check_vcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
483 self.checkit = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
484 bSizer8.Add( self.checkit, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
487 bSizer71.Add( bSizer8, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
489 fgSizer71 = wx.FlexGridSizer( 0, 2, 0, 0 )
490 fgSizer71.SetFlexibleDirection( wx.BOTH )
491 fgSizer71.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
493 self.m_staticText111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
494 self.m_staticText111.Wrap( -1 )
495 fgSizer71.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
497 self.spin_vcexmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
498 fgSizer71.Add( self.spin_vcexmin, 0, wx.ALL, 5 )
500 self.m_staticText121 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
501 self.m_staticText121.Wrap( -1 )
502 fgSizer71.Add( self.m_staticText121, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
504 self.spin_vcexmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
505 fgSizer71.Add( self.spin_vcexmax, 0, wx.ALL, 5 )
508 bSizer71.Add( fgSizer71, 1, wx.EXPAND, 5 )
511 fgSizer51.Add( bSizer71, 1, wx.EXPAND, 5 )
513 self.m_staticline321 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
514 fgSizer51.Add( self.m_staticline321, 0, wx.EXPAND, 5 )
516 self.m_staticline322 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
517 fgSizer51.Add( self.m_staticline322, 0, wx.EXPAND, 5 )
519 self.m_staticText10111 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges width proportional to score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
520 self.m_staticText10111.Wrap( -1 )
521 fgSizer51.Add( self.m_staticText10111, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
523 bSizer711 = wx.BoxSizer( wx.HORIZONTAL )
525 self.check3 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
526 bSizer711.Add( self.check3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
528 fgSizer711 = wx.FlexGridSizer( 0, 2, 0, 0 )
529 fgSizer711.SetFlexibleDirection( wx.BOTH )
530 fgSizer711.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
532 self.m_staticText1111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
533 self.m_staticText1111.Wrap( -1 )
534 fgSizer711.Add( self.m_staticText1111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
536 self.spin_temin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
537 fgSizer711.Add( self.spin_temin, 0, wx.ALL, 5 )
539 self.m_staticText1211 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
540 self.m_staticText1211.Wrap( -1 )
541 fgSizer711.Add( self.m_staticText1211, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
543 self.spin_temax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
544 fgSizer711.Add( self.spin_temax, 0, wx.ALL, 5 )
547 bSizer711.Add( fgSizer711, 1, wx.EXPAND, 5 )
550 fgSizer51.Add( bSizer711, 1, wx.EXPAND, 5 )
552 self.m_staticline33 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
553 fgSizer51.Add( self.m_staticline33, 0, wx.EXPAND, 5 )
555 self.m_staticline34 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
556 fgSizer51.Add( self.m_staticline34, 0, wx.EXPAND, 5 )
558 self.m_staticText28 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Gray scale on text proportional to frequency (0=black, 1=white)").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
559 self.m_staticText28.Wrap( -1 )
560 fgSizer51.Add( self.m_staticText28, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
562 bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
564 self.m_checkBox14 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
565 bSizer10.Add( self.m_checkBox14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
567 bSizer11 = wx.BoxSizer( wx.VERTICAL )
569 bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
571 self.m_staticText31 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
572 self.m_staticText31.Wrap( -1 )
573 bSizer12.Add( self.m_staticText31, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
575 self.m_spinCtrl14 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
576 bSizer12.Add( self.m_spinCtrl14, 0, wx.ALL, 5 )
579 bSizer11.Add( bSizer12, 1, wx.EXPAND, 5 )
581 bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
583 self.m_staticText32 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
584 self.m_staticText32.Wrap( -1 )
585 bSizer13.Add( self.m_staticText32, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
587 self.m_spinCtrl15 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
588 bSizer13.Add( self.m_spinCtrl15, 0, wx.ALL, 5 )
591 bSizer11.Add( bSizer13, 1, wx.EXPAND, 5 )
594 bSizer10.Add( bSizer11, 1, wx.EXPAND, 5 )
597 fgSizer51.Add( bSizer10, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
599 self.m_staticline3311 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
600 fgSizer51.Add( self.m_staticline3311, 0, wx.EXPAND |wx.ALL, 5 )
602 self.m_staticline33111 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
603 fgSizer51.Add( self.m_staticline33111, 0, wx.EXPAND |wx.ALL, 5 )
605 bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
607 self.m_staticText21 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
608 self.m_staticText21.Wrap( -1 )
609 bSizer5.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
611 self.cols = wx.ColourPickerCtrl( self.m_panel3, wx.ID_ANY, wx.Colour( 255, 0, 0 ), wx.DefaultPosition, wx.Size( 10,10 ), wx.CLRP_DEFAULT_STYLE )
612 bSizer5.Add( self.cols, 0, wx.ALL, 5 )
615 fgSizer51.Add( bSizer5, 1, wx.EXPAND, 5 )
617 bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
619 self.m_staticText22 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
620 self.m_staticText22.Wrap( -1 )
621 bSizer6.Add( self.m_staticText22, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
623 self.cola = wx.ColourPickerCtrl( self.m_panel3, wx.ID_ANY, wx.Colour( 208, 208, 208 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
624 bSizer6.Add( self.cola, 0, wx.ALL, 5 )
627 fgSizer51.Add( bSizer6, 1, wx.EXPAND, 5 )
629 self.m_staticline331 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
630 fgSizer51.Add( self.m_staticline331, 0, wx.EXPAND, 5 )
632 self.m_staticline332 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
633 fgSizer51.Add( self.m_staticline332, 0, wx.EXPAND, 5 )
635 self.m_staticText23 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
636 self.m_staticText23.Wrap( -1 )
637 fgSizer51.Add( self.m_staticText23, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
639 bSizer72 = wx.BoxSizer( wx.HORIZONTAL )
641 self.check_s_size = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
642 bSizer72.Add( self.check_s_size, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
644 self.spin_tv = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
645 bSizer72.Add( self.spin_tv, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
648 fgSizer51.Add( bSizer72, 1, wx.EXPAND, 5 )
650 self.m_staticline333 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
651 fgSizer51.Add( self.m_staticline333, 0, wx.EXPAND, 5 )
653 self.m_staticline334 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
654 fgSizer51.Add( self.m_staticline334, 0, wx.EXPAND, 5 )
656 self.m_staticText24 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Spheres transparency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
657 self.m_staticText24.Wrap( -1 )
658 fgSizer51.Add( self.m_staticText24, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
660 self.slider_sphere = wx.Slider( self.m_panel3, wx.ID_ANY, 10, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL|wx.SL_LABELS )
661 fgSizer51.Add( self.slider_sphere, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
663 self.m_staticline335 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
664 fgSizer51.Add( self.m_staticline335, 0, wx.EXPAND, 5 )
666 self.m_staticline336 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
667 fgSizer51.Add( self.m_staticline336, 0, wx.EXPAND, 5 )
669 self.m_staticText25 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Make a movie").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
670 self.m_staticText25.Wrap( -1 )
671 fgSizer51.Add( self.m_staticText25, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
673 self.film = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
674 fgSizer51.Add( self.film, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
676 self.m_staticline2918 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
677 fgSizer51.Add( self.m_staticline2918, 0, wx.EXPAND, 5 )
679 self.m_staticline2919 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
680 fgSizer51.Add( self.m_staticline2919, 0, wx.EXPAND, 5 )
683 fgSizer51.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
686 fgSizer5.Add( fgSizer51, 1, wx.EXPAND, 5 )
689 self.m_panel3.SetSizer( fgSizer5 )
690 self.m_panel3.Layout()
691 fgSizer5.Fit( self.m_panel3 )
692 self.m_notebook1.AddPage( self.m_panel3, _(u"Graphical settings").decode('utf8'), False )
694 fgSizer10.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
696 m_sdbSizer2 = wx.StdDialogButtonSizer()
697 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
698 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
699 self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
700 m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
701 m_sdbSizer2.Realize();
703 fgSizer10.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
706 bSizer16.Add( fgSizer10, 1, wx.EXPAND, 5 )
709 self.SetSizer( bSizer16 )
713 self.Centre( wx.BOTH )
714 self.__set_properties()
717 # if not self.paramsimi['first'] :
718 # self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
719 # self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
720 # self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
721 # self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
722 # self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
723 # self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
724 # self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
727 if not self.paramsimi['first'] :
728 self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
729 self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
730 self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
731 if 'cexfromchi' in self.paramsimi :
732 self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
733 if 'sfromchi' in self.paramsimi :
734 self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
735 self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
736 self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
737 self.listcol.Bind( wx.EVT_LIST_ITEM_SELECTED, self.ChangeCount)
738 self.listcol.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.ChangeCount)
739 self.butcount.Bind( wx.EVT_BUTTON, self.ChangeCount)
740 self.ChangeCount(wx.EVT_BUTTON)
743 def __set_properties(self):
744 self.choice1.SetSelection(self.paramsimi['coeff'])
745 self.choice2.SetSelection(self.paramsimi['layout'])
746 self.choice3.SetSelection(self.paramsimi['type_graph'])
747 if self.paramsimi['type_graph'] not in [2,3] :
748 self.film.Enable(False)
749 self.slider_sphere.Enable(False)
751 self.film.Enable(True)
752 self.slider_sphere.Enable(True)
753 self.check1.SetValue(self.paramsimi['arbremax'])
754 self.check_vlab.SetValue(self.paramsimi['label_v'])
755 self.check_elab.SetValue(self.paramsimi['label_e'])
756 self.check2.SetValue(self.paramsimi['tvprop'])
757 self.spin_tv.SetValue(self.paramsimi['coeff_tv_nb'])
758 self.check_s_size.SetValue(self.paramsimi['coeff_tv'])
759 self.spin_tvmin.SetValue(self.paramsimi['tvmin'])
760 self.spin_tvmax.SetValue(self.paramsimi['tvmax'])
761 self.check3.SetValue(self.paramsimi['coeff_te'])
762 self.spin_temin.SetValue(self.paramsimi['coeff_temin'])
763 self.spin_temax.SetValue(self.paramsimi['coeff_temax'])
764 self.check_vcex.SetValue(self.paramsimi['vcex'])
765 self.spin_vcexmin.SetValue(self.paramsimi['vcexmin'])
766 self.spin_vcexmax.SetValue(self.paramsimi['vcexmax'])
767 self.spin_cex.SetValue(self.paramsimi['cex'])
768 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
769 self.spin_seuil.SetValue(self.paramsimi['seuil'])
770 self.cols.SetColour(self.paramsimi['cols'])
771 self.cola.SetColour(self.paramsimi['cola'])
772 self.spin_width.SetValue(self.paramsimi['width'])
773 self.spin_height.SetValue(self.paramsimi['height'])
774 if 'cexfromchi' in self.paramsimi :
775 self.checkit.SetValue(self.paramsimi['cexfromchi'])
776 if 'sfromchi' in self.paramsimi :
777 self.checki.SetValue(self.paramsimi['sfromchi'])
778 if not self.paramsimi['first'] :
779 self.check_coord.SetValue(self.paramsimi['keep_coord'])
780 self.OnKeepCoords(wx.EVT_CHECKBOX)
781 if self.paramsimi.get('bystar', False) :
782 self.check_bystar.SetValue(True)
783 self.stars = self.paramsimi['stars']
784 self.slider_sphere.SetValue(self.paramsimi['alpha'])
785 self.film.SetValue(self.paramsimi['film'])
786 self.comcheck.SetValue(self.paramsimi['com'])
787 self.choix_com.SetSelection(self.paramsimi['communities'])
788 self.halo.SetValue(self.paramsimi['halo'])
790 def ChangeCount(self, evt) :
791 self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount())
793 def OnCheck_s_size(self, evt):
794 if self.check_s_size.GetValue() :
795 if 'cexfromchi' in self.paramsimi :
796 self.checki.SetValue(False)
797 self.check2.SetValue(False)
798 self.spin_tvmin.Enable(False)
799 self.spin_tvmax.Enable(False)
800 self.spin_tv.Enable(True)
802 self.check2.SetValue(True)
803 self.spin_tvmin.Enable(True)
804 self.spin_tvmax.Enable(True)
805 self.spin_tv.Enable(False)
807 def OnCheck2(self, evt):
808 if self.check2.GetValue():
809 self.check_s_size.SetValue(False)
810 if 'cexfromchi' in self.paramsimi :
811 self.checki.SetValue(False)
812 self.spin_tvmin.Enable(True)
813 self.spin_tvmax.Enable(True)
814 self.spin_tv.Enable(False)
816 self.check_s_size.SetValue(True)
817 self.spin_tvmin.Enable(False)
818 self.spin_tvmax.Enable(False)
819 self.spin_tv.Enable(True)
821 def OnChecki(self, evt):
822 if 'sfromchi' in self.paramsimi :
823 if self.checki.GetValue() :
824 self.check_s_size.SetValue(False)
825 self.check2.SetValue(False)
826 self.spin_tvmin.Enable(True)
827 self.spin_tvmax.Enable(True)
828 self.spin_tv.Enable(False)
830 self.check_s_size.SetValue(True)
831 #self.check2.SetValue(True)
832 self.spin_tvmin.Enable(False)
833 self.spin_tvmax.Enable(False)
834 self.spin_tv.Enable(True)
836 def OnCheckit(self,evt) :
837 if 'cexfromchi' in self.paramsimi :
838 if self.checkit.GetValue() :
839 if self.check_vcex.GetValue() :
840 self.check_vcex.SetValue(False)
842 def OnCheck_vcex(self, evt):
843 if self.check_vcex.GetValue() :
844 if 'checkit' in dir(self) :
845 if self.checkit.GetValue() :
846 self.checkit.SetValue(False)
848 def OnChangeType(self, event) :
849 if event.GetInt() != 1 :
850 self.spin_width.Enable(False)
851 self.spin_height.Enable(False)
853 self.spin_width.Enable(True)
854 self.spin_height.Enable(True)
855 if event.GetInt() not in [2,3] :
856 self.film.Enable(False)
857 self.slider_sphere.Enable(False)
859 self.film.Enable(True)
860 self.slider_sphere.Enable(True)
862 def OnKeepCoords(self, event):
863 if self.check_coord.GetValue() :
864 self.choice1.SetSelection(self.paramsimi['coeff'])
865 self.choice2.SetSelection(self.paramsimi['layout'])
866 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
867 self.spin_seuil.SetValue(self.paramsimi['seuil'])
868 self.choice1.Disable()
869 self.choice2.Disable()
870 self.check_seuil.Disable()
871 self.spin_seuil.Disable()
872 #self.check_colch.SetValue(False)
873 #self.check_colch.Disable()
875 self.choice1.Enable(True)
876 self.choice2.Enable(True)
877 self.check_seuil.Enable(True)
878 self.spin_seuil.Enable(True)
879 #self.check_colch.Enable(True)
883 def __init__(self, parent, source, parametres, pathout, actives, indices_simi, wordlist = None, selected = None) :
884 self.parametres = parametres
886 self.dial = PrefSimi(parent, -1, self.parametres, indices_simi, wordlist = wordlist, selected = selected, actives = actives)
887 self.dial.CenterOnParent()
888 self.val = self.dial.ShowModal()
889 if self.val == wx.ID_OK :
890 if 'bystar' in self.parametres :
891 if self.dial.check_bystar.GetValue() :
892 variables = treat_var_mod(self.parametres['stars'])
893 vardial = dialog.OptLexi(parent, force_chi = True)
894 vardial.listet = self.parametres['stars']
895 vardial.variables = [v for v in variables]
896 for et in vardial.variables :
897 vardial.list_box_1.Append(et)
898 nval = vardial.ShowModal()
899 if nval == wx.ID_OK :
900 if vardial.choice.GetSelection() == 1 :
901 listet = [vardial.listet[i] for i in vardial.list_box_1.GetSelections()]
903 listet = variables[vardial.variables[vardial.list_box_1.GetSelections()[0]]]
906 self.etline = source.corpus.make_etline(listet)
907 self.parametres['selectedstars'] = listet
908 self.parametres['listet'] = self.etline
911 last = self.dial.listcol.GetFirstSelected()
912 lastl = [self.dial.listcol.GetFirstSelected()]
913 indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
914 while self.dial.listcol.GetNextSelected(last) != -1:
915 last = self.dial.listcol.GetNextSelected(last)
917 indexes.append(self.dial.listcol.getColumnText(last,0))
918 column = [actives.index(val) for val in indexes]
920 with open(pathout, 'w') as f :
921 f.write('\n'.join([`val` for val in column]))
927 def make_param(self) :
928 #self.select = self.dial.check_colch.GetValue()
929 if self.parametres.get('first', True) :
932 keep_coord = self.dial.check_coord.GetValue()
933 param = {'coeff' : self.dial.choice1.GetSelection(),
934 'layout' : self.dial.choice2.GetSelection(),
935 'type_graph' : self.dial.choice3.GetSelection(),
936 'arbremax' : self.dial.check1.GetValue(),
937 'coeff_tv' : self.dial.check_s_size.GetValue(),
938 'coeff_tv_nb' : self.dial.spin_tv.GetValue(),
939 'tvprop' : self.dial.check2.GetValue(),
940 'tvmin' : self.dial.spin_tvmin.GetValue(),
941 'tvmax' : self.dial.spin_tvmax.GetValue(),
942 'coeff_te' : self.dial.check3.GetValue(),
943 'coeff_temin' : self.dial.spin_temin.GetValue(),
944 'coeff_temax' : self.dial.spin_temax.GetValue(),
945 'label_e' : self.dial.check_elab.GetValue(),
946 'label_v' : self.dial.check_vlab.GetValue(),
947 'vcex' : self.dial.check_vcex.GetValue(),
948 'vcexmin' : self.dial.spin_vcexmin.GetValue(),
949 'vcexmax' : self.dial.spin_vcexmax.GetValue(),
950 'cex' : self.dial.spin_cex.GetValue(),
951 'seuil_ok' : self.dial.check_seuil.GetValue(),
952 'seuil' : self.dial.spin_seuil.GetValue(),
953 'cols' : self.dial.cols.GetColour(),
954 'cola' : self.dial.cola.GetColour(),
955 'width' : self.dial.spin_width.GetValue(),
956 'height' : self.dial.spin_height.GetValue(),
958 'keep_coord' : keep_coord,
959 'alpha' : self.dial.slider_sphere.GetValue(),
960 'film' : self.dial.film.GetValue(),
961 'svg' : self.dial.choix_format.GetSelection(),
962 'com' :self.dial.comcheck.GetValue(),
963 'communities' : self.dial.choix_com.GetSelection(),
964 'halo' : self.dial.halo.GetValue(),
966 if 'cexfromchi' in self.parametres :
967 param['cexfromchi'] = self.dial.checkit.GetValue()
968 if 'sfromchi' in self.parametres :
969 param['sfromchi'] = self.dial.checki.GetValue()
971 if 'vlabcolor' in self.parametres :
972 param['vlabcolor'] = self.parametres['vlabcolor']
973 if 'check_bystar' in dir(self.dial) :
974 param['bystar'] = self.dial.check_bystar.GetValue()
975 param['stars'] = self.parametres['stars']
976 self.parametres.update(param)
978 class CreateTgenDialog ( wx.Frame ):
980 def __init__( self, parent, lemlist, tgen = None, tgens = None ):
981 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u'Tgen Creator', pos = wx.DefaultPosition, size = wx.DefaultSize, style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP )
986 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
988 bSizer2 = wx.BoxSizer( wx.VERTICAL )
990 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
991 fgSizer3.SetFlexibleDirection( wx.BOTH )
992 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
994 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Name", wx.DefaultPosition, wx.DefaultSize, 0 )
995 self.m_staticText3.Wrap( -1 )
996 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
998 self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
999 self.m_textCtrl1.SetMinSize( wx.Size( 250,-1 ) )
1002 fgSizer3.Add( self.m_textCtrl1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1005 bSizer2.Add( fgSizer3, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 )
1007 self.ip = VItemsPicker(self,-1, lemlist,'Forms', 'Selected')
1008 self.ip._source.SetMinSize( wx.Size( 250, 400 ) )
1010 bSizer2.Add( self.ip, 0, wx.ALL, 5 )
1012 m_sdbSizer3 = wx.StdDialogButtonSizer()
1013 self.m_sdbSizer3OK = wx.Button( self, wx.ID_OK )
1014 m_sdbSizer3.AddButton( self.m_sdbSizer3OK )
1015 self.m_sdbSizer3Cancel = wx.Button( self, wx.ID_CANCEL )
1016 m_sdbSizer3.AddButton( self.m_sdbSizer3Cancel )
1017 m_sdbSizer3.Realize();
1019 bSizer2.Add( m_sdbSizer3, 1, wx.EXPAND, 5 )
1022 self.SetSizer( bSizer2 )
1026 self.Centre( wx.BOTH )
1028 self.m_textCtrl1.Bind( wx.EVT_TEXT, self.OnTextEnter )
1029 self.ip.Bind(EVT_IP_SELECTION_CHANGED, self.OnSelectionChange)
1030 self.m_sdbSizer3OK.Bind(wx.EVT_BUTTON, self.OnClose)
1031 self.m_sdbSizer3Cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
1033 #self.ip.SetItems(lemlist)
1034 self.m_sdbSizer3OK.Enable(False)
1036 if tgen is not None :
1037 self.m_textCtrl1.SetValue(tgen)
1038 self.ip._destData = dict([[i,[word,'']] for i, word in enumerate(tgens[tgen])])
1039 self.ip._SetDestItems()
1040 #self.ip.SetSelections(tgens[tgen])
1041 self.m_sdbSizer3OK.Enable(True)
1046 def __del__( self ):
1049 def OnTextEnter(self, evt):
1050 if self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens and self.ip.GetSelections() != []:
1051 self.m_sdbSizer3OK.Enable(True)
1053 self.m_sdbSizer3OK.Enable(False)
1054 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1055 self.m_sdbSizer3OK.Enable(True)
1057 def OnSelectionChange(self, evt):
1058 if self.ip.GetSelections() != [] and self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens :
1059 self.m_sdbSizer3OK.Enable(True)
1061 self.m_sdbSizer3OK.Enable(False)
1062 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1063 self.m_sdbSizer3OK.Enable(True)
1065 def OnClose(self, evt):
1068 def OnCancel(self, evt):
1071 class TGenFrame ( wx.Frame ):
1073 def __init__( self, parent, corpus, Tgen ):
1074 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Tgen", pos = wx.DefaultPosition, size = wx.Size( 600,434 ), style = wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.FRAME_FLOAT_ON_PARENT|wx.STAY_ON_TOP )
1077 self.parent = parent
1078 self.corpus = corpus
1079 self.activetgen = None
1081 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1083 bSizer1 = wx.BoxSizer( wx.VERTICAL )
1085 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1086 fgSizer1.SetFlexibleDirection( wx.BOTH )
1087 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1089 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Tgen", wx.DefaultPosition, wx.DefaultSize, 0 )
1090 self.m_staticText1.Wrap( -1 )
1091 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1093 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Content", wx.DefaultPosition, wx.DefaultSize, 0 )
1094 self.m_staticText2.Wrap( -1 )
1095 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1097 tgensChoices = Tgen.tgen.keys()
1098 self.tgens = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgensChoices, 0 )
1099 self.tgens.SetMinSize( wx.Size( 200,250 ) )
1101 fgSizer1.Add( self.tgens, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1103 tgencontentChoices = []
1104 self.tgencontent = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgencontentChoices, 0|wx.VSCROLL )
1105 self.tgencontent.SetMinSize( wx.Size( 200,250 ) )
1107 fgSizer1.Add( self.tgencontent, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1109 fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 )
1110 fgSizer2.SetFlexibleDirection( wx.BOTH )
1111 fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1113 self.but_new = wx.Button( self, wx.ID_ANY, u"New...", wx.DefaultPosition, wx.DefaultSize, 0 )
1114 fgSizer2.Add( self.but_new, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1116 self.but_del = wx.Button( self, wx.ID_ANY, u"Delete", wx.DefaultPosition, wx.DefaultSize, 0 )
1117 fgSizer2.Add( self.but_del, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1120 fgSizer1.Add( fgSizer2, 0, wx.EXPAND, 5 )
1122 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
1123 fgSizer3.SetFlexibleDirection( wx.BOTH )
1124 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1125 self.but_edit = wx.Button( self, wx.ID_ANY, u"Edit", wx.DefaultPosition, wx.DefaultSize, 0 )
1126 fgSizer3.Add( self.but_edit, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1128 self.but_compute = wx.Button( self, wx.ID_ANY, u"Compute", wx.DefaultPosition, wx.DefaultSize, 0 )
1129 fgSizer3.Add( self.but_compute, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1131 fgSizer1.Add( fgSizer3, 0, wx.EXPAND, 5 )
1133 bSizer1.Add( fgSizer1, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1135 m_sdbSizer2 = wx.StdDialogButtonSizer()
1136 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1137 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1138 #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1139 #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1140 m_sdbSizer2.Realize();
1142 bSizer1.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
1145 self.SetSizer( bSizer1 )
1148 self.Centre( wx.BOTH )
1151 self.tgens.Bind( wx.EVT_LISTBOX, self.GetContent )
1152 self.but_new.Bind( wx.EVT_BUTTON, self.OnNewTgen )
1153 self.but_del.Bind( wx.EVT_BUTTON, self.OnDeleteTgen )
1154 self.but_edit.Bind( wx.EVT_BUTTON, self.OnEditTgen )
1155 self.but_compute.Bind(wx.EVT_BUTTON, self.OnCompute)
1156 self.m_sdbSizer2OK.Bind( wx.EVT_BUTTON, self.OnOK )
1158 def __del__( self ):
1161 def GetContent( self, event ):
1162 tgen = event.GetString()
1164 self.tgencontent.Clear()
1165 for word in self.Tgen[tgen] :
1166 self.tgencontent.Append(word)
1168 def OnNewTgen( self, event, tgen = None ):
1170 self.dial = CreateTgenDialog(self, dict([[i, [lem, self.corpus.lems[lem].freq]] for i, lem in enumerate(self.corpus.lems.keys())]), tgens = self.Tgen.tgen)
1172 self.dial = CreateTgenDialog(self, dict([[i, [lem, self.corpus.lems[lem].freq]] for i, lem in enumerate(self.corpus.lems.keys())]), tgen = tgen, tgens = self.Tgen.tgen)
1173 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1174 self.activetgen = tgen
1176 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1178 def OnDeleteTgen( self, event ):
1179 if self.tgens.GetSelection() != -1 :
1180 tgens = self.tgens.GetItems()
1181 del self.Tgen.tgen[tgens[self.tgens.GetSelection()]]
1184 self.tgencontent.Clear()
1185 for val in self.Tgen.tgen :
1186 self.tgens.Append(val)
1189 def OnEditTgen( self, event ):
1190 if self.tgens.GetSelection() != -1 :
1191 tgens = self.tgens.GetItems()
1192 tgen = tgens[self.tgens.GetSelection()]
1193 self.activetgen = tgen
1194 self.dial = CreateTgenDialog(self, dict([[i, [lem, self.corpus.lems[lem].freq]] for i, lem in enumerate(self.corpus.lems.keys())]), tgen = tgen, tgens = self.Tgen.tgen)
1195 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1196 self.dial.m_textCtrl1.Enable(False)
1197 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1201 def OnCompute(self, evt):
1202 ira = wx.GetApp().GetTopWindow()
1203 ira.tree.OnTgenCompute(evt)
1205 def OnOK(self, evt):
1208 def OnDialClose(self, evt):
1210 del self.Tgen.tgen[self.activetgen]
1212 self.tgencontent.Clear()
1213 for val in self.Tgen.tgen :
1214 self.tgens.Append(val)
1215 self.Tgen.tgen[self.dial.m_textCtrl1.GetValue()] = self.dial.ip.GetSelections()
1217 self.tgens.Append(self.dial.m_textCtrl1.GetValue())