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]))
152 if selected is None :
153 selected = [i for i in range(0, len(actives))]
154 with open(pathout, 'w') as f :
155 f.write('\n'.join([`i` for i in selected]))
158 class PrefSimi ( wx.Dialog ):
160 def __init__( self, parent, ID, paramsimi, indices, wordlist = None, selected = None, actives = None):
161 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 )
164 self.paramsimi=paramsimi
165 self.indices = indices
167 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
169 bSizer16 = wx.BoxSizer( wx.HORIZONTAL )
170 if wordlist is not None :
171 self.listcol = ListForSpec(self, self, wordlist, ['eff'])
172 self.listcol.SetMinSize( wx.Size( 270,-1 ) )
173 listsizer = wx.BoxSizer( wx.VERTICAL )
174 countsizer = wx.BoxSizer( wx.HORIZONTAL )
175 self.butcount = wx.Button(self, -1, "count")
176 self.textcount = wx.TextCtrl(self, -1, "", wx.DefaultPosition, wx.Size( 100,-1 ), wx.TE_READONLY )
177 countsizer.Add(self.butcount, 0, wx.ALL, 5)
178 countsizer.Add(self.textcount, 0, wx.ALL, 5 )
179 listsizer.Add(countsizer, 0, wx.ALL, 5)
180 listsizer.Add(self.listcol, 2, wx.ALL|wx.EXPAND, 5 )
181 #bSizer16.Add( self.listcol, 0, wx.ALL|wx.EXPAND, 5 )
182 bSizer16.Add( listsizer, 0, wx.ALL|wx.EXPAND, 5)
183 if selected is None :
184 for row in xrange(self.listcol.GetItemCount()):
185 self.listcol.Select(row)
187 self.orderlex = dict([[self.listcol.getColumnText(i,0),i] for i in range(0,self.listcol.GetItemCount())])
188 for row in selected :
189 self.listcol.Select(self.orderlex[actives[row]])
192 fgSizer10 = wx.FlexGridSizer( 2, 1, 0, 0 )
193 fgSizer10.SetFlexibleDirection( wx.BOTH )
194 fgSizer10.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
196 self.m_notebook1 = wx.Notebook( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0 )
197 self.m_panel2 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
198 bSizer18 = wx.BoxSizer( wx.VERTICAL )
200 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
201 fgSizer3.SetFlexibleDirection( wx.BOTH )
202 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
204 if not self.paramsimi['first'] :
206 self.m_staticText271 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Use previous coordinates").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
207 self.m_staticText271.Wrap( -1 )
208 fgSizer3.Add( self.m_staticText271, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
210 self.check_coord = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
211 fgSizer3.Add( self.check_coord, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
213 self.m_staticline36 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
214 fgSizer3.Add( self.m_staticline36, 0, wx.EXPAND, 5 )
216 self.m_staticline37 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
217 fgSizer3.Add( self.m_staticline37, 0, wx.EXPAND, 5 )
219 self.m_staticText3 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
220 self.m_staticText3.Wrap( -1 )
221 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
224 self.choice1 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.indices, 0 )
225 self.choice1.SetSelection( 0 )
226 fgSizer3.Add( self.choice1, 0, wx.ALL, 5 )
228 self.m_staticline293 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
229 fgSizer3.Add( self.m_staticline293, 0, wx.EXPAND, 5 )
231 self.m_staticline292 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
232 fgSizer3.Add( self.m_staticline292, 0, wx.EXPAND, 5 )
234 self.m_staticText4 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Layout").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
235 self.m_staticText4.Wrap( -1 )
236 fgSizer3.Add( self.m_staticText4, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
238 choice2Choices = [ u"random", u"cercle", u"fruchterman reingold", u"kamada kawai", u"graphopt" ]
239 self.choice2 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice2Choices, 0 )
240 self.choice2.SetSelection( 0 )
241 fgSizer3.Add( self.choice2, 0, wx.ALL, 5 )
243 self.m_staticline294 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
244 fgSizer3.Add( self.m_staticline294, 0, wx.EXPAND, 5 )
246 self.m_staticline295 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
247 fgSizer3.Add( self.m_staticline295, 0, wx.EXPAND, 5 )
249 self.m_staticText5 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Graphic type").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
250 self.m_staticText5.Wrap( -1 )
251 fgSizer3.Add( self.m_staticText5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
253 choice3Choices = [ u"dynamique", u"statique", u"3D", u'web2D', u"web3D" ]
254 self.choice3 = wx.Choice( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, choice3Choices, 0 )
255 self.choice3.SetSelection( 0 )
257 label_format = wx.StaticText(self.m_panel2, -1, _(u"Picture format").decode('utf8'))
258 self.choix_format = wx.Choice(self.m_panel2, -1, (100,50), choices = ['png', 'svg'])
259 self.choix_format.SetSelection( 0 )
260 hsizer = wx.BoxSizer(wx.HORIZONTAL)
261 hsizer.Add(self.choice3, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
262 hsizer.Add(label_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
263 hsizer.Add(self.choix_format, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
264 fgSizer3.Add( hsizer, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
266 self.m_staticline296 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
267 fgSizer3.Add( self.m_staticline296, 0, wx.EXPAND, 5 )
269 self.m_staticline297 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
270 fgSizer3.Add( self.m_staticline297, 0, wx.EXPAND, 5 )
272 self.m_staticText8 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Maximum tree").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
273 self.m_staticText8.Wrap( -1 )
274 fgSizer3.Add( self.m_staticText8, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
276 self.check1 = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
277 fgSizer3.Add( self.check1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
279 self.m_staticline298 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
280 fgSizer3.Add( self.m_staticline298, 0, wx.EXPAND, 5 )
282 self.m_staticline299 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
283 fgSizer3.Add( self.m_staticline299, 0, wx.EXPAND, 5 )
285 self.m_staticText91 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edges threshold").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
286 self.m_staticText91.Wrap( -1 )
287 fgSizer3.Add( self.m_staticText91, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
289 bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
291 self.check_seuil = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
292 bSizer21.Add( self.check_seuil, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
294 self.spin_seuil = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 1, 10000, 1 )
295 bSizer21.Add( self.spin_seuil, 0, wx.ALL, 5 )
298 fgSizer3.Add( bSizer21, 1, wx.EXPAND, 5 )
300 self.m_staticline2910 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
301 fgSizer3.Add( self.m_staticline2910, 0, wx.EXPAND, 5 )
303 self.m_staticline2911 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
304 fgSizer3.Add( self.m_staticline2911, 0, wx.EXPAND, 5 )
306 self.m_staticText19 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text on vertex").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
307 self.m_staticText19.Wrap( -1 )
308 fgSizer3.Add( self.m_staticText19, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
310 self.check_vlab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
311 fgSizer3.Add( self.check_vlab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
313 self.m_staticline2912 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
314 fgSizer3.Add( self.m_staticline2912, 0, wx.EXPAND, 5 )
316 self.m_staticline2913 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
317 fgSizer3.Add( self.m_staticline2913, 0, wx.EXPAND, 5 )
319 self.m_staticText20 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Score on edges").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
320 self.m_staticText20.Wrap( -1 )
321 fgSizer3.Add( self.m_staticText20, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
323 self.check_elab = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
324 fgSizer3.Add( self.check_elab, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
326 self.m_staticline39 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
327 fgSizer3.Add( self.m_staticline39, 0, wx.EXPAND |wx.ALL, 5 )
329 self.m_staticline40 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
330 fgSizer3.Add( self.m_staticline40, 0, wx.EXPAND |wx.ALL, 5 )
332 self.m_staticText321 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Edge curved"), wx.DefaultPosition, wx.DefaultSize, 0 )
333 self.m_staticText321.Wrap( -1 )
334 fgSizer3.Add( self.m_staticText321, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
336 self.check_curved = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
337 fgSizer3.Add( self.check_curved, 0, wx.ALL, 5 )
339 self.m_staticline2914 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
340 fgSizer3.Add( self.m_staticline2914, 0, wx.EXPAND, 5 )
342 self.m_staticline2915 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
343 fgSizer3.Add( self.m_staticline2915, 0, wx.EXPAND, 5 )
345 self.m_staticText27 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Text size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
346 self.m_staticText27.Wrap( -1 )
347 fgSizer3.Add( self.m_staticText27, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
349 self.spin_cex = wx.SpinCtrl( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
350 fgSizer3.Add( self.spin_cex, 0, wx.ALL, 5 )
352 self.m_staticline2916 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
353 fgSizer3.Add( self.m_staticline2916, 0, wx.EXPAND, 5 )
355 self.m_staticline2917 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
356 fgSizer3.Add( self.m_staticline2917, 0, wx.EXPAND, 5 )
358 bsizer34 = wx.BoxSizer(wx.HORIZONTAL)
360 comtext = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Communities").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
362 bsizer34.Add(comtext, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
364 self.comcheck = wx.CheckBox(self.m_panel2, -1)
365 bsizer34.Add(self.comcheck, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
367 fgSizer3.Add(bsizer34 , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
369 sizer54 = wx.BoxSizer(wx.HORIZONTAL)
370 self.comlist = ['edge.betweenness.community','fastgreedy.community','label.propagation.community','leading.eigenvector.community','multilevel.community','optimal.community', 'spinglass.community', 'walktrap.community']
371 self.choix_com = wx.Choice( self.m_panel2, wx.ID_ANY, choices = self.comlist)
372 self.choix_com.SetSelection( 0 )
373 self.halo = wx.CheckBox(self.m_panel2, wx.ID_ANY, u'halo')
374 sizer54.Add(self.choix_com , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
375 sizer54.Add(self.halo , 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
376 fgSizer3.Add( sizer54, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
378 if 'bystar' in self.paramsimi :
379 self.m_staticText40 = wx.StaticText( self.m_panel2, wx.ID_ANY, _(u"Select a variable").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
380 self.m_staticText40.Wrap( -1 )
381 fgSizer3.Add( self.m_staticText40, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
383 self.check_bystar = wx.CheckBox( self.m_panel2, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
384 fgSizer3.Add( self.check_bystar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
386 self.m_staticline3200 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
387 fgSizer3.Add( self.m_staticline3200, 0, wx.EXPAND, 5 )
388 self.m_staticline3201 = wx.StaticLine( self.m_panel2, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
389 fgSizer3.Add( self.m_staticline3201, 0, wx.EXPAND, 5 )
392 bSizer18.Add( fgSizer3, 0, wx.EXPAND, 5 )
395 self.m_panel2.SetSizer( bSizer18 )
396 self.m_panel2.Layout()
397 bSizer18.Fit( self.m_panel2 )
398 self.m_notebook1.AddPage( self.m_panel2, _(u"Graph settings").decode('utf8'), True )
399 self.m_panel3 = wx.Panel( self.m_notebook1, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
400 fgSizer5 = wx.FlexGridSizer( 0, 3, 0, 0 )
401 fgSizer5.SetFlexibleDirection( wx.BOTH )
402 fgSizer5.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
404 fgSizer51 = wx.FlexGridSizer( 0, 2, 0, 0 )
405 fgSizer51.SetFlexibleDirection( wx.BOTH )
406 fgSizer51.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
408 self.m_staticText6 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Picture size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
409 self.m_staticText6.Wrap( -1 )
410 fgSizer51.Add( self.m_staticText6, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
412 fgSizer31 = wx.FlexGridSizer( 0, 2, 0, 0 )
413 fgSizer31.SetFlexibleDirection( wx.BOTH )
414 fgSizer31.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
416 self.m_staticText9 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"height").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
417 self.m_staticText9.Wrap( -1 )
418 fgSizer31.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
420 self.spin_height = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
421 fgSizer31.Add( self.spin_height, 0, wx.ALL, 5 )
423 self.m_staticText10 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"width").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
424 self.m_staticText10.Wrap( -1 )
425 fgSizer31.Add( self.m_staticText10, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
427 self.spin_width = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 10, 100000, 800 )
428 fgSizer31.Add( self.spin_width, 0, wx.ALL, 5 )
431 fgSizer51.Add( fgSizer31, 1, wx.EXPAND, 5 )
433 self.m_staticline3 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
434 fgSizer51.Add( self.m_staticline3, 0, wx.EXPAND, 5 )
436 self.m_staticline4 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
437 fgSizer51.Add( self.m_staticline4, 0, wx.EXPAND, 5 )
439 self.m_staticText101 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size proportional to frequency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
440 self.m_staticText101.Wrap( -1 )
441 fgSizer51.Add( self.m_staticText101, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
443 bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
445 bSizer9 = wx.BoxSizer( wx.VERTICAL )
447 self.check2 = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
448 bSizer9.Add( self.check2, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
450 self.checki = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
451 bSizer9.Add( self.checki, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
454 bSizer7.Add( bSizer9, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
456 fgSizer7 = wx.FlexGridSizer( 0, 2, 0, 0 )
457 fgSizer7.SetFlexibleDirection( wx.BOTH )
458 fgSizer7.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
460 self.m_staticText11 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
461 self.m_staticText11.Wrap( -1 )
462 fgSizer7.Add( self.m_staticText11, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
464 self.spin_tvmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
465 fgSizer7.Add( self.spin_tvmin, 0, wx.ALL, 5 )
467 self.m_staticText12 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
468 self.m_staticText12.Wrap( -1 )
469 fgSizer7.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
471 self.spin_tvmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
472 fgSizer7.Add( self.spin_tvmax, 0, wx.ALL, 5 )
475 bSizer7.Add( fgSizer7, 1, wx.EXPAND, 5 )
478 fgSizer51.Add( bSizer7, 1, wx.EXPAND, 5 )
480 self.m_staticline31 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
481 fgSizer51.Add( self.m_staticline31, 0, wx.EXPAND, 5 )
483 self.m_staticline32 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
484 fgSizer51.Add( self.m_staticline32, 0, wx.EXPAND, 5 )
486 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 )
487 self.m_staticText1011.Wrap( -1 )
488 fgSizer51.Add( self.m_staticText1011, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
490 bSizer71 = wx.BoxSizer( wx.HORIZONTAL )
492 bSizer8 = wx.BoxSizer( wx.VERTICAL )
494 self.check_vcex = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"eff.", wx.DefaultPosition, wx.DefaultSize, 0 )
495 bSizer8.Add( self.check_vcex, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
497 self.checkit = wx.CheckBox( self.m_panel3, wx.ID_ANY, u"chi2", wx.DefaultPosition, wx.DefaultSize, 0 )
498 bSizer8.Add( self.checkit, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
501 bSizer71.Add( bSizer8, 0, wx.ALIGN_CENTER_VERTICAL, 5 )
503 fgSizer71 = wx.FlexGridSizer( 0, 2, 0, 0 )
504 fgSizer71.SetFlexibleDirection( wx.BOTH )
505 fgSizer71.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
507 self.m_staticText111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
508 self.m_staticText111.Wrap( -1 )
509 fgSizer71.Add( self.m_staticText111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
511 self.spin_vcexmin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
512 fgSizer71.Add( self.spin_vcexmin, 0, wx.ALL, 5 )
514 self.m_staticText121 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
515 self.m_staticText121.Wrap( -1 )
516 fgSizer71.Add( self.m_staticText121, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
518 self.spin_vcexmax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
519 fgSizer71.Add( self.spin_vcexmax, 0, wx.ALL, 5 )
522 bSizer71.Add( fgSizer71, 1, wx.EXPAND, 5 )
525 fgSizer51.Add( bSizer71, 1, wx.EXPAND, 5 )
527 self.m_staticline321 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
528 fgSizer51.Add( self.m_staticline321, 0, wx.EXPAND, 5 )
530 self.m_staticline322 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
531 fgSizer51.Add( self.m_staticline322, 0, wx.EXPAND, 5 )
533 self.m_staticText10111 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges width proportional to score").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
534 self.m_staticText10111.Wrap( -1 )
535 fgSizer51.Add( self.m_staticText10111, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
537 bSizer711 = wx.BoxSizer( wx.HORIZONTAL )
539 self.check3 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
540 bSizer711.Add( self.check3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
542 fgSizer711 = wx.FlexGridSizer( 0, 2, 0, 0 )
543 fgSizer711.SetFlexibleDirection( wx.BOTH )
544 fgSizer711.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
546 self.m_staticText1111 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
547 self.m_staticText1111.Wrap( -1 )
548 fgSizer711.Add( self.m_staticText1111, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
550 self.spin_temin = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
551 fgSizer711.Add( self.spin_temin, 0, wx.ALL, 5 )
553 self.m_staticText1211 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
554 self.m_staticText1211.Wrap( -1 )
555 fgSizer711.Add( self.m_staticText1211, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
557 self.spin_temax = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
558 fgSizer711.Add( self.spin_temax, 0, wx.ALL, 5 )
561 bSizer711.Add( fgSizer711, 1, wx.EXPAND, 5 )
564 fgSizer51.Add( bSizer711, 1, wx.EXPAND, 5 )
566 self.m_staticline33 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
567 fgSizer51.Add( self.m_staticline33, 0, wx.EXPAND, 5 )
569 self.m_staticline34 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
570 fgSizer51.Add( self.m_staticline34, 0, wx.EXPAND, 5 )
572 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 )
573 self.m_staticText28.Wrap( -1 )
574 fgSizer51.Add( self.m_staticText28, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
576 bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
578 self.m_checkBox14 = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
579 bSizer10.Add( self.m_checkBox14, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
581 bSizer11 = wx.BoxSizer( wx.VERTICAL )
583 bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
585 self.m_staticText31 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"min", wx.DefaultPosition, wx.DefaultSize, 0 )
586 self.m_staticText31.Wrap( -1 )
587 bSizer12.Add( self.m_staticText31, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
589 self.m_spinCtrl14 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 0 )
590 bSizer12.Add( self.m_spinCtrl14, 0, wx.ALL, 5 )
593 bSizer11.Add( bSizer12, 1, wx.EXPAND, 5 )
595 bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
597 self.m_staticText32 = wx.StaticText( self.m_panel3, wx.ID_ANY, u"max", wx.DefaultPosition, wx.DefaultSize, 0 )
598 self.m_staticText32.Wrap( -1 )
599 bSizer13.Add( self.m_staticText32, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
601 self.m_spinCtrl15 = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
602 bSizer13.Add( self.m_spinCtrl15, 0, wx.ALL, 5 )
605 bSizer11.Add( bSizer13, 1, wx.EXPAND, 5 )
608 bSizer10.Add( bSizer11, 1, wx.EXPAND, 5 )
611 fgSizer51.Add( bSizer10, 1, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND, 5 )
613 self.m_staticline3311 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
614 fgSizer51.Add( self.m_staticline3311, 0, wx.EXPAND |wx.ALL, 5 )
616 self.m_staticline33111 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
617 fgSizer51.Add( self.m_staticline33111, 0, wx.EXPAND |wx.ALL, 5 )
619 bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
621 self.m_staticText21 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
622 self.m_staticText21.Wrap( -1 )
623 bSizer5.Add( self.m_staticText21, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
625 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 )
626 bSizer5.Add( self.cols, 0, wx.ALL, 5 )
629 fgSizer51.Add( bSizer5, 1, wx.EXPAND, 5 )
631 bSizer6 = wx.BoxSizer( wx.HORIZONTAL )
633 self.m_staticText22 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Edges color").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
634 self.m_staticText22.Wrap( -1 )
635 bSizer6.Add( self.m_staticText22, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
637 self.cola = wx.ColourPickerCtrl( self.m_panel3, wx.ID_ANY, wx.Colour( 208, 208, 208 ), wx.DefaultPosition, wx.DefaultSize, wx.CLRP_DEFAULT_STYLE )
638 bSizer6.Add( self.cola, 0, wx.ALL, 5 )
641 fgSizer51.Add( bSizer6, 1, wx.EXPAND, 5 )
643 self.m_staticline331 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
644 fgSizer51.Add( self.m_staticline331, 0, wx.EXPAND, 5 )
646 self.m_staticline332 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
647 fgSizer51.Add( self.m_staticline332, 0, wx.EXPAND, 5 )
649 self.m_staticText23 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Vertex size").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
650 self.m_staticText23.Wrap( -1 )
651 fgSizer51.Add( self.m_staticText23, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
653 bSizer72 = wx.BoxSizer( wx.HORIZONTAL )
655 self.check_s_size = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
656 bSizer72.Add( self.check_s_size, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
658 self.spin_tv = wx.SpinCtrl( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, wx.SP_ARROW_KEYS, 0, 100, 10 )
659 bSizer72.Add( self.spin_tv, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
662 fgSizer51.Add( bSizer72, 1, wx.EXPAND, 5 )
664 self.m_staticline333 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
665 fgSizer51.Add( self.m_staticline333, 0, wx.EXPAND, 5 )
667 self.m_staticline334 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
668 fgSizer51.Add( self.m_staticline334, 0, wx.EXPAND, 5 )
670 self.m_staticText24 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Spheres transparency").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
671 self.m_staticText24.Wrap( -1 )
672 fgSizer51.Add( self.m_staticText24, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
674 self.slider_sphere = wx.Slider( self.m_panel3, wx.ID_ANY, 10, 0, 100, wx.DefaultPosition, wx.DefaultSize, wx.SL_HORIZONTAL|wx.SL_LABELS )
675 fgSizer51.Add( self.slider_sphere, 0, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_VERTICAL, 5 )
677 self.m_staticline335 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
678 fgSizer51.Add( self.m_staticline335, 0, wx.EXPAND, 5 )
680 self.m_staticline336 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
681 fgSizer51.Add( self.m_staticline336, 0, wx.EXPAND, 5 )
683 self.m_staticText25 = wx.StaticText( self.m_panel3, wx.ID_ANY, _(u"Make a movie").decode('utf8'), wx.DefaultPosition, wx.DefaultSize, 0 )
684 self.m_staticText25.Wrap( -1 )
685 fgSizer51.Add( self.m_staticText25, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
687 self.film = wx.CheckBox( self.m_panel3, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
688 fgSizer51.Add( self.film, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
690 self.m_staticline2918 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
691 fgSizer51.Add( self.m_staticline2918, 0, wx.EXPAND, 5 )
693 self.m_staticline2919 = wx.StaticLine( self.m_panel3, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL )
694 fgSizer51.Add( self.m_staticline2919, 0, wx.EXPAND, 5 )
697 fgSizer51.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 )
700 fgSizer5.Add( fgSizer51, 1, wx.EXPAND, 5 )
703 self.m_panel3.SetSizer( fgSizer5 )
704 self.m_panel3.Layout()
705 fgSizer5.Fit( self.m_panel3 )
706 self.m_notebook1.AddPage( self.m_panel3, _(u"Graphical settings").decode('utf8'), False )
708 fgSizer10.Add( self.m_notebook1, 1, wx.EXPAND |wx.ALL, 5 )
710 m_sdbSizer2 = wx.StdDialogButtonSizer()
711 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
712 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
713 self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
714 m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
715 m_sdbSizer2.Realize();
717 fgSizer10.Add( m_sdbSizer2, 1, wx.EXPAND, 5 )
720 bSizer16.Add( fgSizer10, 1, wx.EXPAND, 5 )
723 self.SetSizer( bSizer16 )
727 self.Centre( wx.BOTH )
728 self.__set_properties()
731 # if not self.paramsimi['first'] :
732 # self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
733 # self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
734 # self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
735 # self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
736 # self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
737 # self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
738 # self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
741 if not self.paramsimi['first'] :
742 self.check_coord.Bind( wx.EVT_CHECKBOX, self.OnKeepCoords )
743 self.choice3.Bind( wx.EVT_CHOICE, self.OnChangeType )
744 self.check2.Bind( wx.EVT_CHECKBOX, self.OnCheck2 )
745 if 'cexfromchi' in self.paramsimi :
746 self.checkit.Bind( wx.EVT_CHECKBOX, self.OnCheckit )
747 if 'sfromchi' in self.paramsimi :
748 self.checki.Bind( wx.EVT_CHECKBOX, self.OnChecki )
749 self.check_vcex.Bind( wx.EVT_CHECKBOX, self.OnCheck_vcex )
750 self.check_s_size.Bind( wx.EVT_CHECKBOX, self.OnCheck_s_size )
751 self.listcol.Bind( wx.EVT_LIST_ITEM_SELECTED, self.ChangeCount)
752 self.listcol.Bind( wx.EVT_LIST_ITEM_DESELECTED, self.ChangeCount)
753 self.butcount.Bind( wx.EVT_BUTTON, self.ChangeCount)
754 self.ChangeCount(wx.EVT_BUTTON)
757 def __set_properties(self):
758 self.choice1.SetSelection(self.paramsimi['coeff'])
759 self.choice2.SetSelection(self.paramsimi['layout'])
760 self.choice3.SetSelection(self.paramsimi['type_graph'])
761 if self.paramsimi['type_graph'] not in [2,3] :
762 self.film.Enable(False)
763 self.slider_sphere.Enable(False)
765 self.film.Enable(True)
766 self.slider_sphere.Enable(True)
767 self.check1.SetValue(self.paramsimi['arbremax'])
768 self.check_vlab.SetValue(self.paramsimi['label_v'])
769 self.check_elab.SetValue(self.paramsimi['label_e'])
770 self.check2.SetValue(self.paramsimi['tvprop'])
771 self.spin_tv.SetValue(self.paramsimi['coeff_tv_nb'])
772 self.check_s_size.SetValue(self.paramsimi['coeff_tv'])
773 self.spin_tvmin.SetValue(self.paramsimi['tvmin'])
774 self.spin_tvmax.SetValue(self.paramsimi['tvmax'])
775 self.check3.SetValue(self.paramsimi['coeff_te'])
776 self.spin_temin.SetValue(self.paramsimi['coeff_temin'])
777 self.spin_temax.SetValue(self.paramsimi['coeff_temax'])
778 self.check_vcex.SetValue(self.paramsimi['vcex'])
779 self.spin_vcexmin.SetValue(self.paramsimi['vcexmin'])
780 self.spin_vcexmax.SetValue(self.paramsimi['vcexmax'])
781 self.spin_cex.SetValue(self.paramsimi['cex'])
782 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
783 self.spin_seuil.SetValue(self.paramsimi['seuil'])
784 self.cols.SetColour(self.paramsimi['cols'])
785 self.cola.SetColour(self.paramsimi['cola'])
786 self.spin_width.SetValue(self.paramsimi['width'])
787 self.spin_height.SetValue(self.paramsimi['height'])
788 if 'cexfromchi' in self.paramsimi :
789 self.checkit.SetValue(self.paramsimi['cexfromchi'])
790 if 'sfromchi' in self.paramsimi :
791 self.checki.SetValue(self.paramsimi['sfromchi'])
792 if not self.paramsimi['first'] :
793 self.check_coord.SetValue(self.paramsimi['keep_coord'])
794 self.OnKeepCoords(wx.EVT_CHECKBOX)
795 if self.paramsimi.get('bystar', False) :
796 self.check_bystar.SetValue(True)
797 self.stars = self.paramsimi['stars']
798 self.slider_sphere.SetValue(self.paramsimi['alpha'])
799 self.film.SetValue(self.paramsimi['film'])
800 self.comcheck.SetValue(self.paramsimi['com'])
801 self.choix_com.SetSelection(self.paramsimi['communities'])
802 self.halo.SetValue(self.paramsimi['halo'])
803 self.check_curved.SetValue(self.paramsimi.get('edgecurved', True))
805 def ChangeCount(self, evt) :
806 self.textcount.SetValue('%i' % self.listcol.GetSelectedItemCount())
808 def OnCheck_s_size(self, evt):
809 if self.check_s_size.GetValue() :
810 if 'cexfromchi' in self.paramsimi :
811 self.checki.SetValue(False)
812 self.check2.SetValue(False)
813 self.spin_tvmin.Enable(False)
814 self.spin_tvmax.Enable(False)
815 self.spin_tv.Enable(True)
817 self.check2.SetValue(True)
818 self.spin_tvmin.Enable(True)
819 self.spin_tvmax.Enable(True)
820 self.spin_tv.Enable(False)
822 def OnCheck2(self, evt):
823 if self.check2.GetValue():
824 self.check_s_size.SetValue(False)
825 if 'cexfromchi' in self.paramsimi :
826 self.checki.SetValue(False)
827 self.spin_tvmin.Enable(True)
828 self.spin_tvmax.Enable(True)
829 self.spin_tv.Enable(False)
831 self.check_s_size.SetValue(True)
832 self.spin_tvmin.Enable(False)
833 self.spin_tvmax.Enable(False)
834 self.spin_tv.Enable(True)
836 def OnChecki(self, evt):
837 if 'sfromchi' in self.paramsimi :
838 if self.checki.GetValue() :
839 self.check_s_size.SetValue(False)
840 self.check2.SetValue(False)
841 self.spin_tvmin.Enable(True)
842 self.spin_tvmax.Enable(True)
843 self.spin_tv.Enable(False)
845 self.check_s_size.SetValue(True)
846 #self.check2.SetValue(True)
847 self.spin_tvmin.Enable(False)
848 self.spin_tvmax.Enable(False)
849 self.spin_tv.Enable(True)
851 def OnCheckit(self,evt) :
852 if 'cexfromchi' in self.paramsimi :
853 if self.checkit.GetValue() :
854 if self.check_vcex.GetValue() :
855 self.check_vcex.SetValue(False)
857 def OnCheck_vcex(self, evt):
858 if self.check_vcex.GetValue() :
859 if 'checkit' in dir(self) :
860 if self.checkit.GetValue() :
861 self.checkit.SetValue(False)
863 def OnChangeType(self, event) :
864 if event.GetInt() != 1 :
865 self.spin_width.Enable(False)
866 self.spin_height.Enable(False)
868 self.spin_width.Enable(True)
869 self.spin_height.Enable(True)
870 if event.GetInt() not in [2,3] :
871 self.film.Enable(False)
872 self.slider_sphere.Enable(False)
874 self.film.Enable(True)
875 self.slider_sphere.Enable(True)
877 def OnKeepCoords(self, event):
878 if self.check_coord.GetValue() :
879 self.choice1.SetSelection(self.paramsimi['coeff'])
880 self.choice2.SetSelection(self.paramsimi['layout'])
881 self.check_seuil.SetValue(self.paramsimi['seuil_ok'])
882 self.spin_seuil.SetValue(self.paramsimi['seuil'])
883 self.choice1.Disable()
884 self.choice2.Disable()
885 self.check_seuil.Disable()
886 self.spin_seuil.Disable()
887 #self.check_colch.SetValue(False)
888 #self.check_colch.Disable()
890 self.choice1.Enable(True)
891 self.choice2.Enable(True)
892 self.check_seuil.Enable(True)
893 self.spin_seuil.Enable(True)
894 #self.check_colch.Enable(True)
898 def __init__(self, parent, source, parametres, pathout, actives, indices_simi, wordlist = None, selected = None) :
899 self.parametres = parametres
901 self.dial = PrefSimi(parent, -1, self.parametres, indices_simi, wordlist = wordlist, selected = selected, actives = actives)
902 self.dial.CenterOnParent()
903 self.val = self.dial.ShowModal()
904 if self.val == wx.ID_OK :
905 if 'bystar' in self.parametres :
906 if self.dial.check_bystar.GetValue() :
907 variables = treat_var_mod(self.parametres['stars'])
908 vardial = dialog.OptLexi(parent, force_chi = True)
909 vardial.listet = self.parametres['stars']
910 vardial.variables = [v for v in variables]
911 for et in vardial.variables :
912 vardial.list_box_1.Append(et)
913 nval = vardial.ShowModal()
914 if nval == wx.ID_OK :
915 if vardial.choice.GetSelection() == 1 :
916 listet = [vardial.listet[i] for i in vardial.list_box_1.GetSelections()]
918 listet = variables[vardial.variables[vardial.list_box_1.GetSelections()[0]]]
921 self.etline = source.corpus.make_etline(listet)
922 self.parametres['selectedstars'] = listet
923 self.parametres['listet'] = self.etline
926 last = self.dial.listcol.GetFirstSelected()
927 lastl = [self.dial.listcol.GetFirstSelected()]
928 indexes = [self.dial.listcol.getColumnText(self.dial.listcol.GetFirstSelected(),0)]
929 while self.dial.listcol.GetNextSelected(last) != -1:
930 last = self.dial.listcol.GetNextSelected(last)
932 indexes.append(self.dial.listcol.getColumnText(last,0))
933 column = [actives.index(val) for val in indexes]
935 with open(pathout, 'w') as f :
936 f.write('\n'.join([`val` for val in column]))
942 def make_param(self) :
943 #self.select = self.dial.check_colch.GetValue()
944 if self.parametres.get('first', True) :
947 keep_coord = self.dial.check_coord.GetValue()
948 param = {'coeff' : self.dial.choice1.GetSelection(),
949 'layout' : self.dial.choice2.GetSelection(),
950 'type_graph' : self.dial.choice3.GetSelection(),
951 'arbremax' : self.dial.check1.GetValue(),
952 'coeff_tv' : self.dial.check_s_size.GetValue(),
953 'coeff_tv_nb' : self.dial.spin_tv.GetValue(),
954 'tvprop' : self.dial.check2.GetValue(),
955 'tvmin' : self.dial.spin_tvmin.GetValue(),
956 'tvmax' : self.dial.spin_tvmax.GetValue(),
957 'coeff_te' : self.dial.check3.GetValue(),
958 'coeff_temin' : self.dial.spin_temin.GetValue(),
959 'coeff_temax' : self.dial.spin_temax.GetValue(),
960 'label_e' : self.dial.check_elab.GetValue(),
961 'label_v' : self.dial.check_vlab.GetValue(),
962 'vcex' : self.dial.check_vcex.GetValue(),
963 'vcexmin' : self.dial.spin_vcexmin.GetValue(),
964 'vcexmax' : self.dial.spin_vcexmax.GetValue(),
965 'cex' : self.dial.spin_cex.GetValue(),
966 'seuil_ok' : self.dial.check_seuil.GetValue(),
967 'seuil' : self.dial.spin_seuil.GetValue(),
968 'cols' : self.dial.cols.GetColour(),
969 'cola' : self.dial.cola.GetColour(),
970 'width' : self.dial.spin_width.GetValue(),
971 'height' : self.dial.spin_height.GetValue(),
973 'keep_coord' : keep_coord,
974 'alpha' : self.dial.slider_sphere.GetValue(),
975 'film' : self.dial.film.GetValue(),
976 'svg' : self.dial.choix_format.GetSelection(),
977 'com' :self.dial.comcheck.GetValue(),
978 'communities' : self.dial.choix_com.GetSelection(),
979 'halo' : self.dial.halo.GetValue(),
980 'edgecurved' : self.dial.check_curved.GetValue(),
982 if 'cexfromchi' in self.parametres :
983 param['cexfromchi'] = self.dial.checkit.GetValue()
984 if 'sfromchi' in self.parametres :
985 param['sfromchi'] = self.dial.checki.GetValue()
986 if 'vlabcolor' in self.parametres :
987 param['vlabcolor'] = self.parametres['vlabcolor']
988 if 'check_bystar' in dir(self.dial) :
989 param['bystar'] = self.dial.check_bystar.GetValue()
990 param['stars'] = self.parametres['stars']
991 self.parametres.update(param)
993 class CreateTgenDialog ( wx.Frame ):
995 def __init__( self, parent, lemlist, tgen = None, tgens = None ):
996 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 )
1000 self.parent = parent
1001 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1003 bSizer2 = wx.BoxSizer( wx.VERTICAL )
1005 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
1006 fgSizer3.SetFlexibleDirection( wx.BOTH )
1007 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1009 self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Name", wx.DefaultPosition, wx.DefaultSize, 0 )
1010 self.m_staticText3.Wrap( -1 )
1011 fgSizer3.Add( self.m_staticText3, 0, wx.ALIGN_CENTER_VERTICAL|wx.ALIGN_LEFT|wx.ALL, 5 )
1013 self.m_textCtrl1 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, 0 )
1014 self.m_textCtrl1.SetMinSize( wx.Size( 250,-1 ) )
1017 fgSizer3.Add( self.m_textCtrl1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1020 bSizer2.Add( fgSizer3, 1, wx.ALIGN_CENTER_HORIZONTAL, 5 )
1022 self.ip = VItemsPicker(self,-1, lemlist,'Forms', 'Selected')
1023 self.ip._source.SetMinSize( wx.Size( 250, 400 ) )
1025 bSizer2.Add( self.ip, 0, wx.ALL, 5 )
1027 m_sdbSizer3 = wx.StdDialogButtonSizer()
1028 self.m_sdbSizer3OK = wx.Button( self, wx.ID_OK )
1029 m_sdbSizer3.AddButton( self.m_sdbSizer3OK )
1030 self.m_sdbSizer3Cancel = wx.Button( self, wx.ID_CANCEL )
1031 m_sdbSizer3.AddButton( self.m_sdbSizer3Cancel )
1032 m_sdbSizer3.Realize();
1034 bSizer2.Add( m_sdbSizer3, 1, wx.EXPAND, 5 )
1037 self.SetSizer( bSizer2 )
1041 self.Centre( wx.BOTH )
1043 self.m_textCtrl1.Bind( wx.EVT_TEXT, self.OnTextEnter )
1044 self.ip.Bind(EVT_IP_SELECTION_CHANGED, self.OnSelectionChange)
1045 self.m_sdbSizer3OK.Bind(wx.EVT_BUTTON, self.OnClose)
1046 self.m_sdbSizer3Cancel.Bind(wx.EVT_BUTTON, self.OnCancel)
1048 #self.ip.SetItems(lemlist)
1049 self.m_sdbSizer3OK.Enable(False)
1051 if tgen is not None :
1052 self.m_textCtrl1.SetValue(tgen)
1053 self.ip._destData = dict([[i,[word,'']] for i, word in enumerate(tgens[tgen])])
1054 self.ip._SetDestItems()
1055 #self.ip.SetSelections(tgens[tgen])
1056 self.m_sdbSizer3OK.Enable(True)
1061 def __del__( self ):
1064 def OnTextEnter(self, evt):
1065 if self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens and self.ip.GetSelections() != []:
1066 self.m_sdbSizer3OK.Enable(True)
1068 self.m_sdbSizer3OK.Enable(False)
1069 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1070 self.m_sdbSizer3OK.Enable(True)
1072 def OnSelectionChange(self, evt):
1073 if self.ip.GetSelections() != [] and self.m_textCtrl1.GetValue() != '' and self.m_textCtrl1.GetValue() not in self.tgens :
1074 self.m_sdbSizer3OK.Enable(True)
1076 self.m_sdbSizer3OK.Enable(False)
1077 if self.m_textCtrl1.GetValue() != '' and self.ip.GetSelections() and self.edit:
1078 self.m_sdbSizer3OK.Enable(True)
1080 def OnClose(self, evt):
1083 def OnCancel(self, evt):
1086 class TGenFrame ( wx.Frame ):
1088 def __init__( self, parent, corpus, Tgen ):
1089 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 )
1092 self.parent = parent
1093 self.corpus = corpus
1094 self.activetgen = None
1096 self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
1098 bSizer1 = wx.BoxSizer( wx.VERTICAL )
1100 fgSizer1 = wx.FlexGridSizer( 0, 2, 0, 0 )
1101 fgSizer1.SetFlexibleDirection( wx.BOTH )
1102 fgSizer1.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1104 self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Tgen", wx.DefaultPosition, wx.DefaultSize, 0 )
1105 self.m_staticText1.Wrap( -1 )
1106 fgSizer1.Add( self.m_staticText1, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1108 self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Content", wx.DefaultPosition, wx.DefaultSize, 0 )
1109 self.m_staticText2.Wrap( -1 )
1110 fgSizer1.Add( self.m_staticText2, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1112 tgensChoices = Tgen.tgen.keys()
1113 self.tgens = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgensChoices, 0 )
1114 self.tgens.SetMinSize( wx.Size( 200,250 ) )
1116 fgSizer1.Add( self.tgens, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1118 tgencontentChoices = []
1119 self.tgencontent = wx.ListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, tgencontentChoices, 0|wx.VSCROLL )
1120 self.tgencontent.SetMinSize( wx.Size( 200,250 ) )
1122 fgSizer1.Add( self.tgencontent, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1124 fgSizer2 = wx.FlexGridSizer( 0, 2, 0, 0 )
1125 fgSizer2.SetFlexibleDirection( wx.BOTH )
1126 fgSizer2.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1128 self.but_new = wx.Button( self, wx.ID_ANY, u"New...", wx.DefaultPosition, wx.DefaultSize, 0 )
1129 fgSizer2.Add( self.but_new, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1131 self.but_del = wx.Button( self, wx.ID_ANY, u"Delete", wx.DefaultPosition, wx.DefaultSize, 0 )
1132 fgSizer2.Add( self.but_del, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1135 fgSizer1.Add( fgSizer2, 0, wx.EXPAND, 5 )
1137 fgSizer3 = wx.FlexGridSizer( 0, 2, 0, 0 )
1138 fgSizer3.SetFlexibleDirection( wx.BOTH )
1139 fgSizer3.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED )
1140 self.but_edit = wx.Button( self, wx.ID_ANY, u"Edit", wx.DefaultPosition, wx.DefaultSize, 0 )
1141 fgSizer3.Add( self.but_edit, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1143 self.but_compute = wx.Button( self, wx.ID_ANY, u"Compute", wx.DefaultPosition, wx.DefaultSize, 0 )
1144 fgSizer3.Add( self.but_compute, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1146 fgSizer1.Add( fgSizer3, 0, wx.EXPAND, 5 )
1148 bSizer1.Add( fgSizer1, 1, wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL|wx.ALL, 5 )
1150 m_sdbSizer2 = wx.StdDialogButtonSizer()
1151 self.m_sdbSizer2OK = wx.Button( self, wx.ID_OK )
1152 m_sdbSizer2.AddButton( self.m_sdbSizer2OK )
1153 #self.m_sdbSizer2Cancel = wx.Button( self, wx.ID_CANCEL )
1154 #m_sdbSizer2.AddButton( self.m_sdbSizer2Cancel )
1155 m_sdbSizer2.Realize();
1157 bSizer1.Add( m_sdbSizer2, 0, wx.EXPAND, 5 )
1160 self.SetSizer( bSizer1 )
1163 self.Centre( wx.BOTH )
1166 self.tgens.Bind( wx.EVT_LISTBOX, self.GetContent )
1167 self.but_new.Bind( wx.EVT_BUTTON, self.OnNewTgen )
1168 self.but_del.Bind( wx.EVT_BUTTON, self.OnDeleteTgen )
1169 self.but_edit.Bind( wx.EVT_BUTTON, self.OnEditTgen )
1170 self.but_compute.Bind(wx.EVT_BUTTON, self.OnCompute)
1171 self.m_sdbSizer2OK.Bind( wx.EVT_BUTTON, self.OnOK )
1173 def __del__( self ):
1176 def GetContent( self, event ):
1177 tgen = event.GetString()
1179 self.tgencontent.Clear()
1180 for word in self.Tgen[tgen] :
1181 self.tgencontent.Append(word)
1183 def OnNewTgen( self, event, tgen = None ):
1185 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)
1187 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)
1188 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1189 self.activetgen = tgen
1191 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1193 def OnDeleteTgen( self, event ):
1194 if self.tgens.GetSelection() != -1 :
1195 tgens = self.tgens.GetItems()
1196 del self.Tgen.tgen[tgens[self.tgens.GetSelection()]]
1199 self.tgencontent.Clear()
1200 for val in self.Tgen.tgen :
1201 self.tgens.Append(val)
1204 def OnEditTgen( self, event ):
1205 if self.tgens.GetSelection() != -1 :
1206 tgens = self.tgens.GetItems()
1207 tgen = tgens[self.tgens.GetSelection()]
1208 self.activetgen = tgen
1209 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)
1210 self.dial.Bind(wx.EVT_CLOSE, self.OnDialClose)
1211 self.dial.m_textCtrl1.Enable(False)
1212 self.dial.ip._source.selected = dict(zip(self.Tgen.tgen[tgen], self.Tgen.tgen[tgen]))
1216 def OnCompute(self, evt):
1217 ira = wx.GetApp().GetTopWindow()
1218 ira.tree.OnTgenCompute(evt)
1220 def OnOK(self, evt):
1223 def OnDialClose(self, evt):
1225 del self.Tgen.tgen[self.activetgen]
1227 self.tgencontent.Clear()
1228 for val in self.Tgen.tgen :
1229 self.tgens.Append(val)
1230 self.Tgen.tgen[self.dial.m_textCtrl1.GetValue()] = self.dial.ip.GetSelections()
1232 self.tgens.Append(self.dial.m_textCtrl1.GetValue())