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 self.tableau.parametres['encodage'] = dlg.le[dlg.list_encodages.GetSelection()]
62 elif getfileextension(filename) == '.xls' :
63 dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, sheet = True, size=(350, 200),
64 style=wx.DEFAULT_DIALOG_STYLE)
68 self.tableau.parametres['colsep'] = ';'
69 self.tableau.parametres['txtsep'] = '\"'
70 self.tableau.parametres['encodage'] = sys.getdefaultencoding()
71 self.tableau.parametres['sheetnb'] = dlg.spin1.GetValue()
72 self.tableau.parametres['filetype'] = 'xls'
73 elif getfileextension(filename) == '.ods':
74 dlg = dialog.FileOptionDialog(self, -1, _(u"File format").decode('utf8'), sep=False, size=(350, 200),
75 style=wx.DEFAULT_DIALOG_STYLE)
79 self.tableau.parametres['colsep'] = ';'
80 self.tableau.parametres['txtsep'] = '\"'
81 self.tableau.parametres['filetype'] = 'ods'
85 if dlg.radio_box_1.GetSelection() == 0:
86 self.tableau.firstrowiscolnames = True
88 self.tableau.firstrowiscolnames = False
89 if dlg.radio_box_2.GetSelection() == 0:
90 self.tableau.firstcolisrownames = True
92 self.tableau.firstcolisrownames = False
97 if '_mgr' in dir(ira) :
98 if not ira._mgr.GetPane('Text').IsShown() :
99 if ira.nb.GetPageCount() >= 1:
100 return ira.nb.GetPage(ira.nb.GetSelection())
108 def getCorpus(page) :
109 if 'corpus' in page.__dict__:
110 return copy(page.corpus)
115 def __init__(self, parent, dictcol, actives, pathout, selected = None, dlg = False) :
118 dial = dialog.SelectColDial(self.ira)
119 listcol = ListForSpec(dial, self, dictcol, ['eff'])
120 dial.bSizer2.Add( listcol, 2, wx.ALL|wx.EXPAND, 5 )
121 dial.m_sdbSizer2.AddButton( dial.m_sdbSizer2OK )
122 dial.m_sdbSizer2.AddButton( dial.butok)
123 dial.m_sdbSizer2.Realize()
124 dial.bSizer2.Add( dial.m_sdbSizer2, 0, wx.EXPAND, 5 )
126 if selected is None :
127 for row in xrange(listcol.GetItemCount()):
130 orderlex = dict([[listcol.getColumnText(i,0),i] for i in range(0,listcol.GetItemCount())])
131 for row in selected :
132 listcol.Select(orderlex[actives[row]])
133 dial.CenterOnParent()
134 val = dial.ShowModal()
136 last = listcol.GetFirstSelected()
137 lastl = [listcol.GetFirstSelected()]
138 indexes = [listcol.getColumnText(listcol.GetFirstSelected(),0)]
139 while listcol.GetNextSelected(last) != -1:
140 last = listcol.GetNextSelected(last)
142 indexes.append(listcol.getColumnText(last,0))
144 column = [actives.index(val) for val in indexes]
146 with open(pathout, 'w') as f :
147 f.write('\n'.join([`val` for val in column]))
153 if selected is None :
154 selected = [i for i in range(0, len(actives))]
155 with open(pathout, 'w') as f :
156 f.write('\n'.join([`i` for i in selected]))
159 class PrefSimi ( wx.Dialog ):
161 def __init__( self, parent, ID, paramsimi, indices, wordlist = None, selected = None, actives = None):
162 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 )
165 self.paramsimi=paramsimi
166 self.indices = indices
168 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
170 bSizer16 = wx.BoxSizer( wx.HORIZONTAL )
171 if wordlist is not None :
172 self.listcol = ListForSpec(self, self, wordlist, ['eff'])
173 self.listcol.SetMinSize( wx.Size( 270,-1 ) )
174 listsizer = wx.BoxSizer( wx.VERTICAL )
175 countsizer = wx.BoxSizer( wx.HORIZONTAL )
176 self.butcount = wx.Button(self, -1, "count")
177 self.textcount = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size( 100,-1 ), wx.TE_READONLY )
178 countsizer.Add(self.butcount, 0, wx.ALL, 5)
179 countsizer.Add(self.textcount, 0, wx.ALL, 5 )
180 listsizer.Add(countsizer, 0, wx.ALL, 5)
181 listsizer.Add(self.listcol, 2, wx.ALL|wx.EXPAND, 5 )
182 #bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 )
183 bSizer16.Add( listsizer, 0, wx.ALL|wx.EXPAND, 5)
184 if selected is None :
185 for row in xrange(self.listcol.GetItemCount()):
186 self.listcol.Select(row)
188 self.orderlex = dict([[self.listcol.getColumnText(i,0),i] for i in range(0,self.listcol.GetItemCount())])
189 for row in selected :
190 self.listcol.Select(self.orderlex[actives[row]])
193 fgSizer10 = wx.FlexGridSizer( 2, 1, 0, 0 )
194 fgSizer10.SetFlexibleDirection( wx.BOTH )
195 fgSizer10.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
197 self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
198 self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
199 bSizer18 = wx.BoxSizer( wx.VERTICAL )
201 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
202 fgSizer3.SetFlexibleDirection( wx.BOTH )
203 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
205 if not self.paramsimi['first'] :
207 self.m_staticText271 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Use previous coordinates").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
208 self.m_staticText271.Wrap( -1 )
209 fgSizer3.Add( self.m_staticText271, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
211 self.check_coord = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
212 fgSizer3.Add( self.check_coord, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
214 self.m_staticline36 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
215 fgSizer3.Add( self.m_staticline36, 0, wx.EXPAND, 5 )
217 self.m_staticline37 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
218 fgSizer3.Add( self.m_staticline37, 0, wx.EXPAND, 5 )
220 self.m_staticText3 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
221 self.m_staticText3.Wrap( -1 )
222 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
225 self.choice1 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.indices, 0 )
226 self.choice1.SetSelection( 0 )
227 fgSizer3.Add( self.choice1, 0, wx.ALL, 5 )
229 self.m_staticline293 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
230 fgSizer3.Add( self.m_staticline293, 0, wx.EXPAND, 5 )
232 self.m_staticline292 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
233 fgSizer3.Add( self.m_staticline292, 0, wx.EXPAND, 5 )
235 self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Layout").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
236 self.m_staticText4.Wrap( -1 )
237 fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
239 choice2Choices = [ u"random", u"cercle", u"fruchterman reingold", u"kamada kawai", u"graphopt" ]
240 self.choice2 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice2Choices, 0 )
241 self.choice2.SetSelection( 0 )
242 fgSizer3.Add( self.choice2, 0, wx.ALL, 5 )
244 self.m_staticline294 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
245 fgSizer3.Add( self.m_staticline294, 0, wx.EXPAND, 5 )
247 self.m_staticline295 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
248 fgSizer3.Add( self.m_staticline295, 0, wx.EXPAND, 5 )
250 self.m_staticText5 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Graphic type").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
251 self.m_staticText5.Wrap( -1 )
252 fgSizer3.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
254 choice3Choices = [ u"dynamique", u"statique", u"3D"]#, u'web2D', u"web3D" ]
255 self.choice3 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice3Choices, 0 )
256 self.choice3.SetSelection( 0 )
258 label_format = wx.StaticText(self.m_panel2, -1, _(u"Picture format").decode('utf8'))
259 self.choix_format = wx.Choice(self.m_panel2, -1, (100,50), choices = ['png', 'svg'])
260 self.choix_format.SetSelection( 0 )
261 hsizer = wx.BoxSizer(wx.HORIZONTAL)
262 hsizer.Add(self.choice3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
263 hsizer.Add(label_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
264 hsizer.Add(self.choix_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
265 fgSizer3.Add( hsizer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
267 self.m_staticline296 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
268 fgSizer3.Add( self.m_staticline296, 0, wx.EXPAND, 5 )
270 self.m_staticline297 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
271 fgSizer3.Add( self.m_staticline297, 0, wx.EXPAND, 5 )
273 self.m_staticText8 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Maximum tree").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
274 self.m_staticText8.Wrap( -1 )
275 fgSizer3.Add( self.m_staticText8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
277 self.check1 = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
278 fgSizer3.Add( self.check1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
280 self.m_staticline298 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
281 fgSizer3.Add( self.m_staticline298, 0, wx.EXPAND, 5 )
283 self.m_staticline299 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
284 fgSizer3.Add( self.m_staticline299, 0, wx.EXPAND, 5 )
286 self.m_staticText91 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edges threshold").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
287 self.m_staticText91.Wrap( -1 )
288 fgSizer3.Add( self.m_staticText91, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
290 bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
292 self.check_seuil = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
293 bSizer21.Add( self.check_seuil, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
295 self.spin_seuil = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 10000, 1 )
296 bSizer21.Add( self.spin_seuil, 0, wx.ALL, 5 )
299 fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
301 self.m_staticline2910 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
302 fgSizer3.Add( self.m_staticline2910, 0, wx.EXPAND, 5 )
304 self.m_staticline2911 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
305 fgSizer3.Add( self.m_staticline2911, 0, wx.EXPAND, 5 )
307 self.m_staticText19 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text on vertex").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
308 self.m_staticText19.Wrap( -1 )
309 fgSizer3.Add( self.m_staticText19, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
311 self.check_vlab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
312 fgSizer3.Add( self.check_vlab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
314 self.m_staticline2912 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
315 fgSizer3.Add( self.m_staticline2912, 0, wx.EXPAND, 5 )
317 self.m_staticline2913 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
318 fgSizer3.Add( self.m_staticline2913, 0, wx.EXPAND, 5 )
320 self.m_staticText20 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score on edges").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
321 self.m_staticText20.Wrap( -1 )
322 fgSizer3.Add( self.m_staticText20, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
324 self.check_elab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
325 fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
327 self.m_staticline39 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
328 fgSizer3.Add( self.m_staticline39, 0, wx.EXPAND |wx.ALL, 5 )
330 self.m_staticline40 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
331 fgSizer3.Add( self.m_staticline40, 0, wx.EXPAND |wx.ALL, 5 )
333 self.m_staticText321 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edge curved").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
334 self.m_staticText321.Wrap( -1 )
335 fgSizer3.Add( self.m_staticText321, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
337 self.check_curved = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
338 fgSizer3.Add( self.check_curved, 0, wx.ALL, 5 )
340 self.m_staticline2914 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
341 fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
343 self.m_staticline2915 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
344 fgSizer3.Add( self.m_staticline2915, 0, wx.EXPAND, 5 )
346 self.m_staticText27 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
347 self.m_staticText27.Wrap( -1 )
348 fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
350 self.spin_cex = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
351 fgSizer3.Add( self.spin_cex, 0, wx.ALL, 5 )
353 self.m_staticline2916 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
354 fgSizer3.Add( self.m_staticline2916, 0, wx.EXPAND, 5 )
356 self.m_staticline2917 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
357 fgSizer3.Add( self.m_staticline2917, 0, wx.EXPAND, 5 )
359 bsizer34 = wx.BoxSizer(wx.HORIZONTAL)
361 comtext = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Communities").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
363 bsizer34.Add(comtext, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
365 self.comcheck = wx.CheckBox(self.m_panel2, -1)
366 bsizer34.Add(self.comcheck, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
368 fgSizer3.Add(bsizer34 , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
370 sizer54 = wx.BoxSizer(wx.HORIZONTAL)
371 self.comlist = ['edge.betweenness.community','fastgreedy.community','label.propagation.community','leading.eigenvector.community','multilevel.community','optimal.community', 'spinglass.community', 'walktrap.community']
372 self.choix_com = wx.Choice( self.m_panel2, wx.ID_ANY, choices = self.comlist)
373 self.choix_com.SetSelection( 0 )
374 self.halo = wx.CheckBox(self.m_panel2, wx.ID_ANY, u'halo')
375 sizer54.Add(self.choix_com , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
376 sizer54.Add(self.halo , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
377 fgSizer3.Add( sizer54, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
379 if 'bystar' in self.paramsimi :
380 self.m_staticText40 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Select a variable").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
381 self.m_staticText40.Wrap( -1 )
382 fgSizer3.Add( self.m_staticText40, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
384 self.check_bystar = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
385 fgSizer3.Add( self.check_bystar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
387 self.m_staticline3200 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
388 fgSizer3.Add( self.m_staticline3200, 0, wx.EXPAND, 5 )
389 self.m_staticline3201 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
390 fgSizer3.Add( self.m_staticline3201, 0, wx.EXPAND, 5 )
393 bSizer18.Add( fgSizer3, 0, wx.EXPAND, 5 )
396 self.m_panel2.SetSizer( bSizer18 )
397 self.m_panel2.Layout()
398 bSizer18.Fit( self.m_panel2 )
399 self.m_notebook1.AddPage( self.m_panel2, _(u"Graph settings").decode('utf8'), True )
400 self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
401 fgSizer5 = wx.FlexGridSizer( 0, 3, 0, 0 )
402 fgSizer5.SetFlexibleDirection( wx.BOTH )
403 fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
405 fgSizer51 = wx.FlexGridSizer( 0, 2, 0, 0 )
406 fgSizer51.SetFlexibleDirection( wx.BOTH )
407 fgSizer51.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
409 self.m_staticText6 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Picture size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
410 self.m_staticText6.Wrap( -1 )
411 fgSizer51.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
413 fgSizer31 = wx.FlexGridSizer( 0, 2, 0, 0 )
414 fgSizer31.SetFlexibleDirection( wx.BOTH )
415 fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
417 self.m_staticText9 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
418 self.m_staticText9.Wrap( -1 )
419 fgSizer31.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
421 self.spin_height = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
422 fgSizer31.Add( self.spin_height, 0, wx.ALL, 5 )
424 self.m_staticText10 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
425 self.m_staticText10.Wrap( -1 )
426 fgSizer31.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
428 self.spin_width = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
429 fgSizer31.Add( self.spin_width, 0, wx.ALL, 5 )
432 fgSizer51.Add( fgSizer31, 1, wx.EXPAND, 5 )
434 self.m_staticline3 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
435 fgSizer51.Add( self.m_staticline3, 0, wx.EXPAND, 5 )
437 self.m_staticline4 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
438 fgSizer51.Add( self.m_staticline4, 0, wx.EXPAND, 5 )
440 self.m_staticText101 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size proportional to frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
441 self.m_staticText101.Wrap( -1 )
442 fgSizer51.Add( self.m_staticText101, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
444 bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
446 bSizer9 = wx.BoxSizer( wx.VERTICAL )
448 self.check2 = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
449 bSizer9.Add( self.check2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
451 self.checki = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
452 bSizer9.Add( self.checki, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
455 bSizer7.Add( bSizer9, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
457 fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 )
458 fgSizer7.SetFlexibleDirection( wx.BOTH )
459 fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
461 self.m_staticText11 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
462 self.m_staticText11.Wrap( -1 )
463 fgSizer7.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
465 self.spin_tvmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
466 fgSizer7.Add( self.spin_tvmin, 0, wx.ALL, 5 )
468 self.m_staticText12 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
469 self.m_staticText12.Wrap( -1 )
470 fgSizer7.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
472 self.spin_tvmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
473 fgSizer7.Add( self.spin_tvmax, 0, wx.ALL, 5 )
476 bSizer7.Add( fgSizer7, 1, wx.EXPAND, 5 )
479 fgSizer51.Add( bSizer7, 1, wx.EXPAND, 5 )
481 self.m_staticline31 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
482 fgSizer51.Add( self.m_staticline31, 0, wx.EXPAND, 5 )
484 self.m_staticline32 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
485 fgSizer51.Add( self.m_staticline32, 0, wx.EXPAND, 5 )
487 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 )
488 self.m_staticText1011.Wrap( -1 )
489 fgSizer51.Add( self.m_staticText1011, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
491 bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
493 bSizer8 = wx.BoxSizer( wx.VERTICAL )
495 self.check_vcex = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
496 bSizer8.Add( self.check_vcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
498 self.checkit = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
499 bSizer8.Add( self.checkit, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
502 bSizer71.Add( bSizer8, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
504 fgSizer71 = wx.FlexGridSizer( 0, 2, 0, 0 )
505 fgSizer71.SetFlexibleDirection( wx.BOTH )
506 fgSizer71.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
508 self.m_staticText111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
509 self.m_staticText111.Wrap( -1 )
510 fgSizer71.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
512 self.spin_vcexmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
513 fgSizer71.Add( self.spin_vcexmin, 0, wx.ALL, 5 )
515 self.m_staticText121 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
516 self.m_staticText121.Wrap( -1 )
517 fgSizer71.Add( self.m_staticText121, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
519 self.spin_vcexmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
520 fgSizer71.Add( self.spin_vcexmax, 0, wx.ALL, 5 )
523 bSizer71.Add( fgSizer71, 1, wx.EXPAND, 5 )
526 fgSizer51.Add( bSizer71, 1, wx.EXPAND, 5 )
528 self.m_staticline321 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
529 fgSizer51.Add( self.m_staticline321, 0, wx.EXPAND, 5 )
531 self.m_staticline322 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
532 fgSizer51.Add( self.m_staticline322, 0, wx.EXPAND, 5 )
534 self.m_staticText10111 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges width proportional to score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
535 self.m_staticText10111.Wrap( -1 )
536 fgSizer51.Add( self.m_staticText10111, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
538 bSizer711 = wx.BoxSizer( wx.HORIZONTAL )
540 self.check3 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
541 bSizer711.Add( self.check3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
543 fgSizer711 = wx.FlexGridSizer( 0, 2, 0, 0 )
544 fgSizer711.SetFlexibleDirection( wx.BOTH )
545 fgSizer711.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
547 self.m_staticText1111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
548 self.m_staticText1111.Wrap( -1 )
549 fgSizer711.Add( self.m_staticText1111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
551 self.spin_temin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
552 fgSizer711.Add( self.spin_temin, 0, wx.ALL, 5 )
554 self.m_staticText1211 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
555 self.m_staticText1211.Wrap( -1 )
556 fgSizer711.Add( self.m_staticText1211, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
558 self.spin_temax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
559 fgSizer711.Add( self.spin_temax, 0, wx.ALL, 5 )
562 bSizer711.Add( fgSizer711, 1, wx.EXPAND, 5 )
565 fgSizer51.Add( bSizer711, 1, wx.EXPAND, 5 )
567 self.m_staticline33 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
568 fgSizer51.Add( self.m_staticline33, 0, wx.EXPAND, 5 )
570 self.m_staticline34 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
571 fgSizer51.Add( self.m_staticline34, 0, wx.EXPAND, 5 )
573 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 )
574 self.m_staticText28.Wrap( -1 )
575 fgSizer51.Add( self.m_staticText28, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
577 bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
579 self.m_checkBox14 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
580 bSizer10.Add( self.m_checkBox14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
582 bSizer11 = wx.BoxSizer( wx.VERTICAL )
584 bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
586 self.m_staticText31 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
587 self.m_staticText31.Wrap( -1 )
588 bSizer12.Add( self.m_staticText31, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
590 self.m_spinCtrl14 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
591 bSizer12.Add( self.m_spinCtrl14, 0, wx.ALL, 5 )
594 bSizer11.Add( bSizer12, 1, wx.EXPAND, 5 )
596 bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
598 self.m_staticText32 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
599 self.m_staticText32.Wrap( -1 )
600 bSizer13.Add( self.m_staticText32, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
602 self.m_spinCtrl15 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
603 bSizer13.Add( self.m_spinCtrl15, 0, wx.ALL, 5 )
606 bSizer11.Add( bSizer13, 1, wx.EXPAND, 5 )
609 bSizer10.Add( bSizer11, 1, wx.EXPAND, 5 )
612 fgSizer51.Add( bSizer10, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
614 self.m_staticline3311 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
615 fgSizer51.Add( self.m_staticline3311, 0, wx.EXPAND |wx.ALL, 5 )
617 self.m_staticline33111 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
618 fgSizer51.Add( self.m_staticline33111, 0, wx.EXPAND |wx.ALL, 5 )
620 bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
622 self.m_staticText21 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
623 self.m_staticText21.Wrap( -1 )
624 bSizer5.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
626 self.cols = wx.ColourPickerCtrl( self.m_panel3, wx.ID_ANY, wx.Colour( 255, 0, 0 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
627 bSizer5.Add( self.cols, 0, wx.ALL, 5 )
630 fgSizer51.Add( bSizer5, 1, wx.EXPAND, 5 )
632 bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
634 self.m_staticText22 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
635 self.m_staticText22.Wrap( -1 )
636 bSizer6.Add( self.m_staticText22, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
638 self.cola = wx.ColourPickerCtrl( self.m_panel3, wx.ID_ANY, wx.Colour( 208, 208, 208 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
639 bSizer6.Add( self.cola, 0, wx.ALL, 5 )
642 fgSizer51.Add( bSizer6, 1, wx.EXPAND, 5 )
644 self.m_staticline331 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
645 fgSizer51.Add( self.m_staticline331, 0, wx.EXPAND, 5 )
647 self.m_staticline332 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
648 fgSizer51.Add( self.m_staticline332, 0, wx.EXPAND, 5 )
650 self.m_staticText23 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
651 self.m_staticText23.Wrap( -1 )
652 fgSizer51.Add( self.m_staticText23, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
654 bSizer72 = wx.BoxSizer( wx.HORIZONTAL )
656 self.check_s_size = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
657 bSizer72.Add( self.check_s_size, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
659 self.spin_tv = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
660 bSizer72.Add( self.spin_tv, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
663 fgSizer51.Add( bSizer72, 1, wx.EXPAND, 5 )
665 self.m_staticline333 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
666 fgSizer51.Add( self.m_staticline333, 0, wx.EXPAND, 5 )
668 self.m_staticline334 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
669 fgSizer51.Add( self.m_staticline334, 0, wx.EXPAND, 5 )
671 self.m_staticText24 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Spheres transparency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
672 self.m_staticText24.Wrap( -1 )
673 fgSizer51.Add( self.m_staticText24, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
675 self.slider_sphere = wx.Slider( self.m_panel3, wx.ID_ANY, 10, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL|wx.SL_LABELS )
676 fgSizer51.Add( self.slider_sphere, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
678 self.m_staticline335 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
679 fgSizer51.Add( self.m_staticline335, 0, wx.EXPAND, 5 )
681 self.m_staticline336 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
682 fgSizer51.Add( self.m_staticline336, 0, wx.EXPAND, 5 )
684 self.m_staticText25 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Make a movie").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
685 self.m_staticText25.Wrap( -1 )
686 fgSizer51.Add( self.m_staticText25, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
688 self.film = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
689 fgSizer51.Add( self.film, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
691 self.m_staticline2918 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
692 fgSizer51.Add( self.m_staticline2918, 0, wx.EXPAND, 5 )
694 self.m_staticline2919 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
695 fgSizer51.Add( self.m_staticline2919, 0, wx.EXPAND, 5 )
698 fgSizer51.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
701 fgSizer5.Add( fgSizer51, 1, wx.EXPAND, 5 )
704 self.m_panel3.SetSizer( fgSizer5 )
705 self.m_panel3.Layout()
706 fgSizer5.Fit( self.m_panel3 )
707 self.m_notebook1.AddPage( self.m_panel3, _(u"Graphical settings").decode('utf8'), False )
709 fgSizer10.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
711 m_sdbSizer2 = wx.StdDialogButtonSizer()
712 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
713 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
714 self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
715 m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
716 m_sdbSizer2.Realize();
718 fgSizer10.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
721 bSizer16.Add( fgSizer10, 1, wx.EXPAND, 5 )
724 self.SetSizer( bSizer16 )
728 self.Centre( wx.BOTH )
729 self.__set_properties()
732 if not self.paramsimi['first'] :
733 self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
734 self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
735 self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
736 if 'cexfromchi' in self.paramsimi :
737 self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
738 if 'sfromchi' in self.paramsimi :
739 self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
740 self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
741 self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
742 self.listcol.Bind( wx.EVT_LIST_ITEM_SELECTED, self.ChangeCount)
743 self.listcol.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.ChangeCount)
744 self.butcount.Bind( wx.EVT_BUTTON, self.ChangeCount)
745 self.ChangeCount(wx.EVT_BUTTON)
748 def __set_properties(self):
749 self.choice1.SetSelection(self.paramsimi['coeff'])
750 self.choice2.SetSelection(self.paramsimi['layout'])
751 self.choice3.SetSelection(self.paramsimi['type_graph'])
752 if self.paramsimi['type_graph'] not in [2,3] :
753 self.film.Enable(False)
754 self.slider_sphere.Enable(False)
756 self.film.Enable(True)
757 self.slider_sphere.Enable(True)
758 self.check1.SetValue(self.paramsimi['arbremax'])
759 self.check_vlab.SetValue(self.paramsimi['label_v'])
760 self.check_elab.SetValue(self.paramsimi['label_e'])
761 self.check2.SetValue(self.paramsimi['tvprop'])
762 self.spin_tv.SetValue(self.paramsimi['coeff_tv_nb'])
763 self.check_s_size.SetValue(self.paramsimi['coeff_tv'])
764 self.spin_tvmin.SetValue(self.paramsimi['tvmin'])
765 self.spin_tvmax.SetValue(self.paramsimi['tvmax'])
766 self.check3.SetValue(self.paramsimi['coeff_te'])
767 self.spin_temin.SetValue(self.paramsimi['coeff_temin'])
768 self.spin_temax.SetValue(self.paramsimi['coeff_temax'])
769 self.check_vcex.SetValue(self.paramsimi['vcex'])
770 self.spin_vcexmin.SetValue(self.paramsimi['vcexmin'])
771 self.spin_vcexmax.SetValue(self.paramsimi['vcexmax'])
772 self.spin_cex.SetValue(self.paramsimi['cex'])
773 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
774 self.spin_seuil.SetValue(self.paramsimi['seuil'])
775 self.cols.SetColour(self.paramsimi['cols'])
776 self.cola.SetColour(self.paramsimi['cola'])
777 self.spin_width.SetValue(self.paramsimi['width'])
778 self.spin_height.SetValue(self.paramsimi['height'])
779 if 'cexfromchi' in self.paramsimi :
780 self.checkit.SetValue(self.paramsimi['cexfromchi'])
781 if 'sfromchi' in self.paramsimi :
782 self.checki.SetValue(self.paramsimi['sfromchi'])
783 if not self.paramsimi['first'] :
784 self.check_coord.SetValue(self.paramsimi['keep_coord'])
785 self.OnKeepCoords(wx.EVT_CHECKBOX)
786 if self.paramsimi.get('bystar', False) :
787 self.check_bystar.SetValue(True)
788 self.stars = self.paramsimi['stars']
789 self.slider_sphere.SetValue(self.paramsimi['alpha'])
790 self.film.SetValue(self.paramsimi['film'])
791 self.comcheck.SetValue(self.paramsimi['com'])
792 self.choix_com.SetSelection(self.paramsimi['communities'])
793 self.halo.SetValue(self.paramsimi['halo'])
794 self.check_curved.SetValue(self.paramsimi.get('edgecurved', True))
796 def ChangeCount(self, evt) :
797 self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount())
799 def OnCheck_s_size(self, evt):
800 if self.check_s_size.GetValue() :
801 if 'cexfromchi' in self.paramsimi :
802 self.checki.SetValue(False)
803 self.check2.SetValue(False)
804 self.spin_tvmin.Enable(False)
805 self.spin_tvmax.Enable(False)
806 self.spin_tv.Enable(True)
808 self.check2.SetValue(True)
809 self.spin_tvmin.Enable(True)
810 self.spin_tvmax.Enable(True)
811 self.spin_tv.Enable(False)
813 def OnCheck2(self, evt):
814 if self.check2.GetValue():
815 self.check_s_size.SetValue(False)
816 if 'cexfromchi' in self.paramsimi :
817 self.checki.SetValue(False)
818 self.spin_tvmin.Enable(True)
819 self.spin_tvmax.Enable(True)
820 self.spin_tv.Enable(False)
822 self.check_s_size.SetValue(True)
823 self.spin_tvmin.Enable(False)
824 self.spin_tvmax.Enable(False)
825 self.spin_tv.Enable(True)
827 def OnChecki(self, evt):
828 if 'sfromchi' in self.paramsimi :
829 if self.checki.GetValue() :
830 self.check_s_size.SetValue(False)
831 self.check2.SetValue(False)
832 self.spin_tvmin.Enable(True)
833 self.spin_tvmax.Enable(True)
834 self.spin_tv.Enable(False)
836 self.check_s_size.SetValue(True)
837 #self.check2.SetValue(True)
838 self.spin_tvmin.Enable(False)
839 self.spin_tvmax.Enable(False)
840 self.spin_tv.Enable(True)
842 def OnCheckit(self,evt) :
843 if 'cexfromchi' in self.paramsimi :
844 if self.checkit.GetValue() :
845 if self.check_vcex.GetValue() :
846 self.check_vcex.SetValue(False)
848 def OnCheck_vcex(self, evt):
849 if self.check_vcex.GetValue() :
850 if 'checkit' in dir(self) :
851 if self.checkit.GetValue() :
852 self.checkit.SetValue(False)
854 def OnChangeType(self, event) :
855 if event.GetInt() != 1 :
856 self.spin_width.Enable(False)
857 self.spin_height.Enable(False)
859 self.spin_width.Enable(True)
860 self.spin_height.Enable(True)
861 if event.GetInt() not in [2,3] :
862 self.film.Enable(False)
863 self.slider_sphere.Enable(False)
865 self.film.Enable(True)
866 self.slider_sphere.Enable(True)
868 def OnKeepCoords(self, event):
869 if self.check_coord.GetValue() :
870 self.choice1.SetSelection(self.paramsimi['coeff'])
871 self.choice2.SetSelection(self.paramsimi['layout'])
872 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
873 self.spin_seuil.SetValue(self.paramsimi['seuil'])
874 self.choice1.Disable()
875 self.choice2.Disable()
876 self.check_seuil.Disable()
877 self.spin_seuil.Disable()
878 #self.check_colch.SetValue(False)
879 #self.check_colch.Disable()
881 self.choice1.Enable(True)
882 self.choice2.Enable(True)
883 self.check_seuil.Enable(True)
884 self.spin_seuil.Enable(True)
885 #self.check_colch.Enable(True)
889 def __init__(self, parent, source, parametres, pathout, actives, indices_simi, wordlist = None, selected = None) :
890 self.parametres = parametres
892 self.dial = PrefSimi(parent, -1, self.parametres, indices_simi, wordlist = wordlist, selected = selected, actives = actives)
893 self.dial.CenterOnParent()
894 self.val = self.dial.ShowModal()
895 if self.val == wx.ID_OK :
896 if 'bystar' in self.parametres :
897 if self.dial.check_bystar.GetValue() :
898 variables = treat_var_mod(self.parametres['stars'])
899 vardial = dialog.OptLexi(parent, force_chi = True)
900 vardial.listet = self.parametres['stars']
901 vardial.variables = [v for v in variables]
902 for et in vardial.variables :
903 vardial.list_box_1.Append(et)
904 nval = vardial.ShowModal()
905 if nval == wx.ID_OK :
906 if vardial.choice.GetSelection() == 1 :
907 listet = [vardial.listet[i] for i in vardial.list_box_1.GetSelections()]
909 listet = variables[vardial.variables[vardial.list_box_1.GetSelections()[0]]]
912 self.etline = source.corpus.make_etline(listet)
913 self.parametres['selectedstars'] = listet
914 self.parametres['listet'] = self.etline
920 last = self.dial.listcol.GetFirstSelected()
921 lastl = [self.dial.listcol.GetFirstSelected()]
922 indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
923 while self.dial.listcol.GetNextSelected(last) != -1:
924 last = self.dial.listcol.GetNextSelected(last)
926 indexes.append(self.dial.listcol.getColumnText(last,0))
927 column = [actives.index(val) for val in indexes]
929 with open(pathout, 'w') as f :
930 f.write('\n'.join([`val` for val in column]))
936 def make_param(self) :
937 #self.select = self.dial.check_colch.GetValue()
938 if self.parametres.get('first', True) :
941 keep_coord = self.dial.check_coord.GetValue()
942 param = {'coeff' : self.dial.choice1.GetSelection(),
943 'layout' : self.dial.choice2.GetSelection(),
944 'type_graph' : self.dial.choice3.GetSelection(),
945 'arbremax' : self.dial.check1.GetValue(),
946 'coeff_tv' : self.dial.check_s_size.GetValue(),
947 'coeff_tv_nb' : self.dial.spin_tv.GetValue(),
948 'tvprop' : self.dial.check2.GetValue(),
949 'tvmin' : self.dial.spin_tvmin.GetValue(),
950 'tvmax' : self.dial.spin_tvmax.GetValue(),
951 'coeff_te' : self.dial.check3.GetValue(),
952 'coeff_temin' : self.dial.spin_temin.GetValue(),
953 'coeff_temax' : self.dial.spin_temax.GetValue(),
954 'label_e' : self.dial.check_elab.GetValue(),
955 'label_v' : self.dial.check_vlab.GetValue(),
956 'vcex' : self.dial.check_vcex.GetValue(),
957 'vcexmin' : self.dial.spin_vcexmin.GetValue(),
958 'vcexmax' : self.dial.spin_vcexmax.GetValue(),
959 'cex' : self.dial.spin_cex.GetValue(),
960 'seuil_ok' : self.dial.check_seuil.GetValue(),
961 'seuil' : self.dial.spin_seuil.GetValue(),
962 'cols' : self.dial.cols.GetColour(),
963 'cola' : self.dial.cola.GetColour(),
964 'width' : self.dial.spin_width.GetValue(),
965 'height' : self.dial.spin_height.GetValue(),
967 'keep_coord' : keep_coord,
968 'alpha' : self.dial.slider_sphere.GetValue(),
969 'film' : self.dial.film.GetValue(),
970 'svg' : self.dial.choix_format.GetSelection(),
971 'com' :self.dial.comcheck.GetValue(),
972 'communities' : self.dial.choix_com.GetSelection(),
973 'halo' : self.dial.halo.GetValue(),
974 'edgecurved' : self.dial.check_curved.GetValue(),
976 if 'cexfromchi' in self.parametres :
977 param['cexfromchi'] = self.dial.checkit.GetValue()
978 if 'sfromchi' in self.parametres :
979 param['sfromchi'] = self.dial.checki.GetValue()
980 if 'vlabcolor' in self.parametres :
981 param['vlabcolor'] = self.parametres['vlabcolor']
982 if 'check_bystar' in dir(self.dial) :
983 param['bystar'] = self.dial.check_bystar.GetValue()
984 param['stars'] = self.parametres['stars']
985 self.parametres.update(param)
987 class CreateTgenDialog ( wx.Frame ):
989 def __init__( self, parent, lemlist, tgen = None, tgens = None ):
990 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 )
995 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
997 bSizer2 = wx.BoxSizer( wx.VERTICAL )
999 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
1000 fgSizer3.SetFlexibleDirection( wx.BOTH )
1001 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1003 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Name", wx.DefaultPosition, wx.DefaultSize, 0 )
1004 self.m_staticText3.Wrap( -1 )
1005 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1007 self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1008 self.m_textCtrl1.SetMinSize( wx.Size( 250,-1 ) )
1011 fgSizer3.Add( self.m_textCtrl1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1014 bSizer2.Add( fgSizer3, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 )
1016 self.ip = VItemsPicker(self,-1, lemlist,'Forms', 'Selected')
1017 self.ip._source.SetMinSize( wx.Size( 250, 400 ) )
1019 bSizer2.Add( self.ip, 0, wx.ALL, 5 )
1021 m_sdbSizer3 = wx.StdDialogButtonSizer()
1022 self.m_sdbSizer3OK = wx.Button( self, wx.ID_OK )
1023 m_sdbSizer3.AddButton( self.m_sdbSizer3OK )
1024 self.m_sdbSizer3Cancel = wx.Button( self, wx.ID_CANCEL )
1025 m_sdbSizer3.AddButton( self.m_sdbSizer3Cancel )
1026 m_sdbSizer3.Realize();
1028 bSizer2.Add( m_sdbSizer3, 1, wx.EXPAND, 5 )
1031 self.SetSizer( bSizer2 )
1035 self.Centre( wx.BOTH )
1037 self.m_textCtrl1.Bind( wx.EVT_TEXT, self.OnTextEnter )
1038 self.ip.Bind(EVT_IP_SELECTION_CHANGED, self.OnSelectionChange)
1039 self.m_sdbSizer3OK.Bind(wx.EVT_BUTTON, self.OnClose)
1040 self.m_sdbSizer3Cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
1042 #self.ip.SetItems(lemlist)
1043 self.m_sdbSizer3OK.Enable(False)
1045 if tgen is not None :
1046 self.m_textCtrl1.SetValue(tgen)
1047 self.ip._destData = dict([[i,[word,'']] for i, word in enumerate(tgens[tgen])])
1048 self.ip._SetDestItems()
1049 #self.ip.SetSelections(tgens[tgen])
1050 self.m_sdbSizer3OK.Enable(True)
1055 def __del__( self ):
1058 def OnTextEnter(self, evt):
1059 if self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens and self.ip.GetSelections() != []:
1060 self.m_sdbSizer3OK.Enable(True)
1062 self.m_sdbSizer3OK.Enable(False)
1063 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1064 self.m_sdbSizer3OK.Enable(True)
1066 def OnSelectionChange(self, evt):
1067 if self.ip.GetSelections() != [] and self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens :
1068 self.m_sdbSizer3OK.Enable(True)
1070 self.m_sdbSizer3OK.Enable(False)
1071 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1072 self.m_sdbSizer3OK.Enable(True)
1074 def OnClose(self, evt):
1077 def OnCancel(self, evt):
1080 class TGenFrame ( wx.Frame ):
1082 def __init__( self, parent, corpus, Tgen ):
1083 wx.Frame.__init__ ( self, parent, id = wx.ID_ANY, title = u"Tgen", pos = wx.DefaultPosition, size = wx.Size( -1, -1 ), style = wx.CLOSE_BOX|wx.DEFAULT_FRAME_STYLE|wx.TAB_TRAVERSAL|wx.STAY_ON_TOP )
1086 self.parent = parent
1087 self.corpus = corpus
1088 self.activetgen = None
1090 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1092 bSizer1 = wx.BoxSizer( wx.VERTICAL )
1094 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1095 fgSizer1.SetFlexibleDirection( wx.BOTH )
1096 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1098 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Tgen", wx.DefaultPosition, wx.DefaultSize, 0 )
1099 self.m_staticText1.Wrap( -1 )
1100 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1102 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Content", wx.DefaultPosition, wx.DefaultSize, 0 )
1103 self.m_staticText2.Wrap( -1 )
1104 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1106 tgensChoices = Tgen.tgen.keys()
1107 self.tgens = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgensChoices, 0 )
1108 #self.tgens.SetMinSize( wx.Size( 200,250 ) )
1110 fgSizer1.Add( self.tgens, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1112 tgencontentChoices = []
1113 self.tgencontent = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgencontentChoices, 0|wx.VSCROLL )
1114 #self.tgencontent.SetMinSize( wx.Size( 200,250 ) )
1116 fgSizer1.Add( self.tgencontent, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL|wx.EXPAND, 5 )
1118 fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 )
1119 fgSizer2.SetFlexibleDirection( wx.BOTH )
1120 fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1122 self.but_new = wx.Button( self, wx.ID_ANY, u"New...", wx.DefaultPosition, wx.DefaultSize, 0 )
1123 fgSizer2.Add( self.but_new, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1125 self.but_del = wx.Button( self, wx.ID_ANY, u"Delete", wx.DefaultPosition, wx.DefaultSize, 0 )
1126 fgSizer2.Add( self.but_del, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1129 fgSizer1.Add( fgSizer2, 0, wx.EXPAND, 0 )
1131 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
1132 fgSizer3.SetFlexibleDirection( wx.BOTH )
1133 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1134 self.but_edit = wx.Button( self, wx.ID_ANY, u"Edit", wx.DefaultPosition, wx.DefaultSize, 0 )
1135 fgSizer3.Add( self.but_edit, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1137 self.but_compute = wx.Button( self, wx.ID_ANY, u"Compute", wx.DefaultPosition, wx.DefaultSize, 0 )
1138 fgSizer3.Add( self.but_compute, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1140 fgSizer1.Add( fgSizer3, 0, wx.EXPAND, 0 )
1142 bSizer1.Add( fgSizer1, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1144 m_sdbSizer2 = wx.StdDialogButtonSizer()
1145 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1146 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1147 #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1148 #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1149 m_sdbSizer2.Realize();
1151 bSizer1.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
1154 self.SetSizer( bSizer1 )
1158 self.Centre( wx.BOTH )
1161 self.tgens.Bind( wx.EVT_LISTBOX, self.GetContent )
1162 self.but_new.Bind( wx.EVT_BUTTON, self.OnNewTgen )
1163 self.but_del.Bind( wx.EVT_BUTTON, self.OnDeleteTgen )
1164 self.but_edit.Bind( wx.EVT_BUTTON, self.OnEditTgen )
1165 self.but_compute.Bind(wx.EVT_BUTTON, self.OnCompute)
1166 self.m_sdbSizer2OK.Bind( wx.EVT_BUTTON, self.OnOK )
1168 def __del__( self ):
1171 def GetContent( self, event ):
1172 tgen = event.GetString()
1174 self.tgencontent.Clear()
1175 for word in self.Tgen[tgen] :
1176 self.tgencontent.Append(word)
1178 def OnNewTgen( self, event, tgen = None ):
1180 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)
1182 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)
1183 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1184 self.activetgen = tgen
1186 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1188 def OnDeleteTgen( self, event ):
1189 if self.tgens.GetSelection() != -1 :
1190 tgens = self.tgens.GetItems()
1191 del self.Tgen.tgen[tgens[self.tgens.GetSelection()]]
1194 self.tgencontent.Clear()
1195 for val in self.Tgen.tgen :
1196 self.tgens.Append(val)
1199 def OnEditTgen( self, event ):
1200 if self.tgens.GetSelection() != -1 :
1201 tgens = self.tgens.GetItems()
1202 tgen = tgens[self.tgens.GetSelection()]
1203 self.activetgen = tgen
1204 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)
1205 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1206 self.dial.m_textCtrl1.Enable(False)
1207 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1211 def OnCompute(self, evt):
1212 ira = wx.GetApp().GetTopWindow()
1213 ira.tree.OnTgenCompute(evt)
1215 def OnOK(self, evt):
1218 def OnDialClose(self, evt):
1220 del self.Tgen.tgen[self.activetgen]
1222 self.tgencontent.Clear()
1223 for val in self.Tgen.tgen :
1224 self.tgens.Append(val)
1225 self.Tgen.tgen[self.dial.m_textCtrl1.GetValue()] = self.dial.ip.GetSelections()
1227 self.tgens.Append(self.dial.m_textCtrl1.GetValue())