ID_proto = wx.NewId()
ID_ImportTXM = wx.NewId()
ID_FreqMulti = wx.NewId()
+ID_Splitfromvar = wx.NewId()
+ID_Subtxtfrommeta = wx.NewId()
+ID_Subtxtfromthem = wx.NewId()
+ID_WC = wx.NewId()
##########################################################
#elements de configuration
##########################################################
'italian' : 'it_IT',
'spanish' : 'es_ES'
}
+
+images_analyses = {
+ 'textroot' : 'textroot.png',
+ 'alceste' : 'reinert.png',
+ 'corpus' : 'textcorpus.png',
+ 'wordcloud' :'wordcloud.png',
+ 'stat' :'stats.png',
+ 'simitxt' : 'simitxt.png',
+ 'clustersimitxt' :'clustersimitxt.png',
+ 'clustercloud' : 'clustercloud.png',
+ 'spec' : 'spec.png',
+ 'matroot' : 'matroot.png',
+ 'matrix' : 'matrix.png',
+ 'freq' : 'frequences.png',
+ 'freqmulti' : 'frequences.png',
+ 'chi2' : 'chi2.png',
+ 'reinertmatrix' : 'reinertmatrix.png',
+ 'simimatrix' : 'simimatrix.png',
+ 'simiclustermatrix' : 'simimatrix.png',
+ 'proto' : 'proto.png',
+ }
#####################################################################
class IraFrame(wx.Frame):
self.x = 0
# create menu
#--------------------------------------------------------------------------------
+ self.images_analyses = images_analyses
+ for img in images_analyses :
+ self.images_analyses[img] = wx.Image(os.path.join(self.images_path, self.images_analyses[img]), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()
self.mb = wx.MenuBar()
file_menu = wx.Menu()
item = wx.MenuItem(file_menu, ID_OpenData, _(u"Open a matrix").decode('utf8'), _(u"Open a matrix").decode('utf8'))
- item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
+ #item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
+ item.SetBitmap(self.images_analyses['matroot'])
file_menu.AppendItem(item)
item = wx.MenuItem(file_menu, ID_OpenText, _(u"Open a text corpus").decode('utf8'), _(u"Open a text corpus").decode('utf8'))
- item.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN))
+ item.SetBitmap(self.images_analyses['textroot'])
file_menu.AppendItem(item)
item = wx.MenuItem(file_menu, ID_OnOpenAnalyse, _(u"Open an analysis").decode('utf8'), _(u"Open an analysis").decode('utf8'))
view_menu.Append(ID_RESULT, _(u'Show results').decode('utf8'))
#view_menu.AppendSeparator()
matrix_menu = wx.Menu()
- matrix_menu.Append(ID_Freq, _(u"Frequencies").decode('utf8'))
- matrix_menu.Append(ID_FreqMulti, _(u'Multiple frequencies').decode('utf8'))
- matrix_menu.Append(ID_Chi2, _(u"Chi2").decode('utf8'))
+ matanalyses = [[ID_Freq, _(u"Frequencies").decode('utf8'), 'freq'],
+ [ID_Freq, _(u"Multiple Frequencies").decode('utf8'), 'freqmulti'],
+ [ID_Chi2, _(u"Chi2").decode('utf8'), 'chi2'],
+ {'name' : _(u"Clustering").decode('utf8'),
+ 'content' : [[ID_CHDReinert, _(u"Reinert's Method").decode('utf8'), 'reinertmatrix']]},
+ [ID_SIMI, _(u"Similarities Analysis").decode('utf8'), 'simimatrix'],
+ [ID_proto, _(u"Prototypical Analysis").decode('utf8'), 'proto'],
+ [ID_Splitfromvar, _(u"Split from variable").decode('utf8'), '']]
+
+ for analyse in matanalyses :
+ if not isinstance(analyse, dict) :
+ item = wx.MenuItem(matrix_menu, analyse[0], analyse[1])
+ item.SetBitmap(self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)))
+ matrix_menu.AppendItem(item)
+ else :
+ nmenu = wx.Menu()
+ for subana in analyse['content'] :
+ item = wx.MenuItem(nmenu, subana[0], subana[1])
+ item.SetBitmap(self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)))
+ nmenu.AppendItem(item)
+ matrix_menu.AppendMenu(-1, analyse['name'], nmenu)
+ #item = wx.MenuItem(matrix_menu, ID_Freq, _(u"Frequencies").decode('utf8'))
+ #item.SetBitmap(self.images_analyses['freq'])
+ #matrix_menu.AppendItem(item)
+ #matrix_menu.Append(ID_Freq, _(u"Frequencies").decode('utf8'))
+ #item = wx.MenuItem(matrix_menu, ID_Freq, _(u"Multiple Frequencies").decode('utf8'))
+ #item.SetBitmap(self.images_analyses['freqmulti'])
+ #matrix_menu.Append(ID_FreqMulti, _(u'Multiple frequencies').decode('utf8'))
+ #matrix_menu.AppendItem(item)
+ #matrix_menu.Append(ID_Chi2, _(u"Chi2").decode('utf8'))
#matrix_menu.Append(ID_Student, u"t de Student")
- menu_classif = wx.Menu()
- menu_classif.Append(ID_CHDReinert, _(u"Reinert's Method").decode('utf8'))
+ #menu_classif = wx.Menu()
+ #menu_classif.Append(ID_CHDReinert, _(u"Reinert's Method").decode('utf8'))
#menu_classif.Append(ID_CHDSIM, u"Par matrice des distances")
- matrix_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classif)
+ #matrix_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classif)
#matrix_menu.Append(ID_AFCM, u"AFCM")
- matrix_menu.Append(ID_SIMI, _(u"Similarities Analysis").decode('utf8'))
- matrix_menu.Append(ID_proto, _(u"Prototypical Analysis").decode('utf8'))
+ #matrix_menu.Append(ID_SIMI, _(u"Similarities Analysis").decode('utf8'))
+ #matrix_menu.Append(ID_proto, _(u"Prototypical Analysis").decode('utf8'))
ID_RCODE = wx.NewId()
#matrix_menu.Append(ID_RCODE, u"Code R...")
#menu_splittab = wx.Menu()
self.matrix_menu = matrix_menu
text_menu = wx.Menu()
+ analyses_text = [[ID_TEXTSTAT, _(u"Statistics").decode('utf8'), 'stat'],
+ [ID_ASLEX, _(u"Specificities and CA").decode('utf8'), 'spec'],
+ {'name' : _(u"Clustering").decode('utf8'),
+ 'content' : [[ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8'), 'alceste']]},
+ [ID_SimiTxt, _(u"Similarities Analysis").decode('utf8'), 'simitxt'],
+ [ID_WC, _(u"WordCloud").decode('utf8'), 'wordcloud'],
+ {'name' : _(u"Sub corpus").decode('utf8'),
+ 'content' : [[ID_Subtxtfrommeta, _(u'Sub corpus from metadata').decode('utf8'), None],
+ [ID_Subtxtfromthem, _(u'Sub corpus from thematic').decode('utf8'), None]]},
+ ]
+
+ for analyse in analyses_text :
+ if not isinstance(analyse, dict) :
+ item = wx.MenuItem(text_menu, analyse[0], analyse[1])
+ item.SetBitmap(self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)))
+ text_menu.AppendItem(item)
+ else :
+ nmenu = wx.Menu()
+ for subana in analyse['content'] :
+ item = wx.MenuItem(nmenu, subana[0], subana[1])
+ item.SetBitmap(self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)))
+ nmenu.AppendItem(item)
+ text_menu.AppendMenu(-1, analyse['name'], nmenu)
#text_menu.Append(ID_CHECKCORPUS, u"Vérifier le corpus")
- text_menu.Append(ID_TEXTSTAT, _(u"Statistics").decode('utf8'))
- text_menu.Append(ID_ASLEX, _(u"Specificities and CA").decode('utf8'))
- #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire")
- menu_classiftxt = wx.Menu()
- menu_classiftxt.Append(ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8'))
- #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances")
- text_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classiftxt)
- text_menu.Append(ID_SimiTxt, _(u"Similarities Analysis").decode('utf8'))
- ID_WC = wx.NewId()
- text_menu.Append(ID_WC, _(u"WordCloud").decode('utf8'))
+# text_menu.Append(ID_TEXTSTAT, _(u"Statistics").decode('utf8'))
+# text_menu.Append(ID_ASLEX, _(u"Specificities and CA").decode('utf8'))
+# #text_menu.Append(ID_TEXTAFCM, u"AFC sur UCI / Vocabulaire")
+# menu_classiftxt = wx.Menu()
+# menu_classiftxt.Append(ID_TEXTREINERT, _(u"Reinert's Method").decode('utf8'))
+# #menu_classiftxt.Append(ID_TEXTPAM, u"Par matrice des distances")
+# text_menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), menu_classiftxt)
+# text_menu.Append(ID_SimiTxt, _(u"Similarities Analysis").decode('utf8'))
+#
+# text_menu.Append(ID_WC, _(u"WordCloud").decode('utf8'))
self.text_menu = text_menu
help_menu = wx.Menu()
tb1 = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
wx.TB_FLAT | wx.TB_NODIVIDER)
tb1.SetToolBitmapSize(wx.Size(16, 16))
- tb1.AddLabelTool(ID_OpenData, "OpenData", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Questionnaire", longHelp="Ouvrir un questionnaire")
+ tb1.AddLabelTool(ID_OpenData, "OpenData", self.images_analyses['matroot'], shortHelp=_(u"Matrix").decode('utf8'), longHelp=_(u"Open a matrix").decode('utf8'))
tb1.AddSeparator()
- tb1.AddLabelTool(ID_OpenText, "OpenText", wx.ArtProvider_GetBitmap(wx.ART_FILE_OPEN, wx.ART_OTHER, wx.Size(16, 16)), shortHelp="Texte", longHelp="Ouvrir un corpus texte")
-
+ tb1.AddLabelTool(ID_OpenText, "OpenText", self.images_analyses['textroot'], shortHelp=_(u"Text").decode('utf8'), longHelp=_(u"Open a text corpus").decode('utf8'))
+
tb1.Realize()
+ tb_text = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
+ wx.TB_FLAT | wx.TB_NODIVIDER)
+ for analyse in analyses_text :
+ if not isinstance(analyse, dict) :
+ tb_text.AddLabelTool(analyse[0], analyse[1], self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)), shortHelp = analyse[1], longHelp = analyse[1])
+ else :
+ for subana in analyse['content'] :
+ tb_text.AddLabelTool(subana[0], subana[1], self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)), shortHelp = subana[1], longHelp = subana[1])
+ tb_text.Realize()
+
+ tb_mat = wx.ToolBar(self, -1, wx.DefaultPosition, wx.DefaultSize,
+ wx.TB_FLAT | wx.TB_NODIVIDER)
+ for analyse in matanalyses :
+ if not isinstance(analyse, dict) :
+ tb_mat.AddLabelTool(analyse[0], analyse[1], self.images_analyses.get(analyse[2], wx.EmptyBitmap(16,16)), shortHelp = analyse[1], longHelp = analyse[1])
+ else :
+ for subana in analyse['content'] :
+ tb_mat.AddLabelTool(subana[0], subana[1], self.images_analyses.get(subana[2], wx.EmptyBitmap(16,16)), shortHelp = subana[1], longHelp = subana[1])
+ tb_mat.Realize()
#------------------------------------------------------------------------------------------------
self.text_ctrl_txt = wx.TextCtrl(self, -1, "", wx.Point(0, 0), wx.Size(200, 200), wx.NO_BORDER | wx.TE_MULTILINE | wx.TE_RICH2 | wx.TE_READONLY)
self._mgr.AddPane(tb1, aui.AuiPaneInfo().
Name("tb1").Caption("Fichiers").
ToolbarPane().Top().
- LeftDockable(True).RightDockable(False))
+ LeftDockable(True).RightDockable(False))
+
+ self._mgr.AddPane(tb_text, aui.AuiPaneInfo().
+ Name("tb_text").Caption("analyse_text").
+ ToolbarPane().Top().
+ LeftDockable(True).RightDockable(False))
+
+ self._mgr.AddPane(tb_mat, aui.AuiPaneInfo().
+ Name("tb_mat").Caption("analyse_matrix").
+ ToolbarPane().Top().
+ LeftDockable(True).RightDockable(False))
+
+ self._mgr.GetPane('tb_text').Hide()
+ self._mgr.GetPane('tb_mat').Hide()
self.ShowAPane("Intro_Text")
self._mgr.GetPane("lefttree").Show()
self.Bind(wx.EVT_MENU, self.OnCHDReinert, id=ID_CHDReinert)
self.Bind(wx.EVT_MENU, self.OnAFCM, id=ID_AFCM)
self.Bind(wx.EVT_MENU, self.OnProto, id=ID_proto)
+ self.Bind(wx.EVT_MENU, self.OnSplitVar, id = ID_Splitfromvar)
#self.Bind(wx.EVT_MENU, self.OnRCode, id=ID_RCODE)
#self.Bind(wx.EVT_MENU, self.OnSplitVar, id=ID_SPLITVAR)
#self.Bind(wx.EVT_MENU, self.OnCheckcorpus, id = ID_CHECKCORPUS)
self.Bind(wx.EVT_MENU, self.OnPamSimple, id=ID_TEXTPAM)
self.Bind(wx.EVT_MENU, self.OnSimiTxt, id=ID_SimiTxt)
self.Bind(wx.EVT_MENU, self.OnWordCloud, id=ID_WC)
+ self.Bind(wx.EVT_MENU, self.OnSubText, id = ID_Subtxtfrommeta)
+ self.Bind(wx.EVT_MENU, self.OnSubText, id = ID_Subtxtfromthem)
self.Bind(wx.EVT_MENU, self.OnSimiTab, id=ID_SIMI)
self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
#self.Bind(wx.EVT_MENU, self.OnSaveTabAs, id=ID_SaveTab)
def ShowMenu(self, menu, Show=True):
if menu == 'text' :
menu_pos = 4
+ if Show :
+ self._mgr.GetPane('tb_text').Show()
+ else :
+ self._mgr.GetPane('tb_text').Hide()
elif menu == 'matrix' :
menu_pos = 3
+ if Show :
+ self._mgr.GetPane('tb_mat').Show()
+ else :
+ self._mgr.GetPane('tb_mat').Hide()
elif menu == 'view' :
menu_pos = 2
else :
if not menu_pos is None :
self.mb.EnableTop(menu_pos, Show)
self.mb.UpdateMenus()
-
+ self._mgr.Update()
#--------------------------------------------------------------------
def OnClose(self, event):
self.ShowAPane(u"Text")
self._mgr.Update()
- def OnSubText(self, corpus, parametres = None):
+ def OnSubText(self, evt, corpus = None, parametres = None):
if corpus is None :
corpus = self.tree.getcorpus()
+ if evt.GetId() == ID_Subtxtfrommeta :
+ parametres = {'frommeta' : True}
+ elif evt.GetId() == ID_Subtxtfromthem :
+ parametres = {'fromtheme' : True}
builder = SubBuilder(self, corpus, parametres)
if builder.res == wx.ID_OK :
busy = wx.BusyInfo(_("Please wait...").decode('utf8'), self)
#Prototypical(self, {'type' : 'proto'})
def OnSplitVar(self, evt, matrix = None):
+ if matrix is None :
+ matrix = self.tree.getmatrix()
self.analyse_matrix(SplitMatrixFromVar, matrix = matrix, analyse_type = 'splitvar', parametres = {'pathout': matrix.pathout.dirout}, dlgnb = 3)
- matrix = self.tree.getmatrix()
+ #matrix = self.tree.getmatrix()
def OnSimiTxt(self, evt, corpus = None) :
log = logging.getLogger('iramuteq.tree')
+def buildmenu(menu, parent_menu):
+ for i in range(parent_menu.GetMenuItemCount()) :
+ item = parent_menu.FindItemByPosition(i)
+ itemid = item.GetId()
+ itemtext = item.GetText()
+ itemicon = item.GetBitmap()
+ nitem = wx.MenuItem(menu, itemid, itemtext)
+ nitem.SetBitmap(itemicon)
+ if item.IsSubMenu() :
+ nmenu = wx.Menu()
+ for val in item.GetSubMenu().GetMenuItems() :
+ itemid = val.GetId()
+ itemtext = val.GetText()
+ itemicon = val.GetBitmap()
+ nitem = wx.MenuItem(menu, itemid, itemtext)
+ nitem.SetBitmap(itemicon)
+ nmenu.AppendItem(nitem)
+ menu.AppendMenu(-1, item.GetText(), nmenu)
+ else :
+ menu.AppendItem(nitem)
+
class InfoDialog ( wx.Dialog ):
def __init__( self, parent, txt, parametres ):
self.styles = treestyles
self.item = None
+
self.il = wx.ImageList(16, 16)
self.ild = {}
- imgtextroot = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'textroot.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['alceste'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'reinert.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['corpus'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'textcorpus.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['wordcloud'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'wordcloud.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['stat'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'stats.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['simitxt'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simitxt.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['clustersimitxt'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'clustersimitxt.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['clustercloud'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'clustercloud.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['spec'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'spec.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- imgmatroot = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matroot.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['matrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'matrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['freq'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['freqmulti'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'frequences.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['chi2'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'chi2.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['reinertmatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'reinertmatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['simimatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simimatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['simiclustermatrix'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'simimatrix.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
- self.ild['proto'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'proto.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap())
+ for img in self.ira.images_analyses :
+ self.ild[img] = self.il.Add(self.ira.images_analyses[img])
self.SetImageList(self.il)
self.count = 0
self.textroot = self.AppendItem(self.root, _(u'Textual corpus'))
self.SetPyData(self.textroot, {'uuid': 'textroot'})
- self.SetItemImage(self.textroot, imgtextroot, CT.TreeItemIcon_Normal)
- self.SetItemImage(self.textroot, imgtextroot, CT.TreeItemIcon_Expanded)
+ self.SetItemImage(self.textroot, self.ild['textroot'], CT.TreeItemIcon_Normal)
+ self.SetItemImage(self.textroot, self.ild['textroot'], CT.TreeItemIcon_Expanded)
for corpus in reversed(self.h) :
child = self.AppendItem(self.textroot, corpus['corpus_name'])
self.matroot = self.AppendItem(self.root, _(u'Matrix'))
self.SetPyData(self.matroot, {'uuid': 'matroot'})
- self.SetItemImage(self.matroot, imgmatroot, CT.TreeItemIcon_Normal)
- self.SetItemImage(self.matroot, imgmatroot, CT.TreeItemIcon_Expanded)
+ self.SetItemImage(self.matroot, self.ild['matroot'], CT.TreeItemIcon_Normal)
+ self.SetItemImage(self.matroot, self.ild['matroot'], CT.TreeItemIcon_Expanded)
orphmat = []
for matrix in reversed(self.history.matrix) :
menu.AppendSeparator()
if 'corpus_name' in pydata :
- stat = menu.Append(wx.ID_ANY, _(u"Statistics").decode('utf8'))
- spec = menu.Append(wx.ID_ANY, _(u"Specificities and CA").decode('utf8'))
- classification = wx.Menu()
- reinert = classification.Append(wx.ID_ANY, _(u"Reinert's Method").decode('utf8'))
- #pam = classification.Append(wx.ID_ANY, u"Par matrice des distances")
- menu.AppendMenu(-1, _(u"Clustering").decode('utf8'), classification)
- simi = menu.Append(wx.ID_ANY, _(u"Similarities Analysis").decode('utf8'))
- wdc = menu.Append(wx.ID_ANY, _(u"WordCloud").decode('utf8'))
- subcorpus = wx.Menu()
- subcorpusfrommeta = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from metadata').decode('utf8'))
- subcorpusfromtheme = subcorpus.Append(wx.ID_ANY, _(u'Sub corpus from thematic').decode('utf8'))
- menu.AppendMenu(-1, _(u"Sub corpus").decode('utf8'), subcorpus)
+ buildmenu(menu, self.parent.text_menu)
menu.AppendSeparator()
- self.Bind(wx.EVT_MENU, self.OnReinert, reinert)
- #self.Bind(wx.EVT_MENU, self.OnPam, pam)
- self.Bind(wx.EVT_MENU, self.OnStat, stat)
- self.Bind(wx.EVT_MENU, self.OnSpec, spec)
- self.Bind(wx.EVT_MENU, self.OnSimiTxt, simi)
- self.Bind(wx.EVT_MENU, self.OnWordCloud, wdc)
- self.Bind(wx.EVT_MENU, self.OnSubTextFromMeta, subcorpusfrommeta)
- self.Bind(wx.EVT_MENU, self.OnSubTextFromTheme, subcorpusfromtheme)
elif 'matrix_name' in pydata :
- for i in range(self.parent.matrix_menu.GetMenuItemCount()) :
- item = self.parent.matrix_menu.FindItemByPosition(i)
- itemid = item.GetId()
- itemtext = item.GetText()
- if item.IsSubMenu() :
- nmenu = wx.Menu()
- for val in item.GetSubMenu().GetMenuItems() :
- nmenu.Append(val.GetId(), val.GetText())
- menu.AppendMenu(itemid, itemtext, nmenu)
- else :
- menu.Append(itemid, itemtext)
- split = wx.Menu()
- splitfromvar = split.Append(-1, _(u"Split from variable").decode('utf8'))
- menu.AppendMenu(-1, _(u"Split matrix").decode('utf8'), split)
- self.Bind(wx.EVT_MENU, self.OnSplitFromVar, splitfromvar)
- #print item, itemid, itemtext
- #menu = self.parent.matrix_menu
- #freq = menu.Append(wx.ID_ANY, _(u"Frequency").decode('utf8'))
- #chi2 = menu.Append(wx.ID_ANY, _(u"Chi square").decode('utf8'))
- #chdreinert = menu.Append(wx.ID_ANY, _(u"Reinert clustering").decode('utf8'))
- #simi = menu.Append(wx.ID_ANY, _(u"Similarity analysis").decode('utf8'))
+ buildmenu(menu, self.parent.matrix_menu)
menu.AppendSeparator()
- #self.Bind(wx.EVT_MENU, self.OnFreq, freq)
- #self.Bind(wx.EVT_MENU, self.OnChiSquare, chi2)
- #self.Bind(wx.EVT_MENU, self.OnSimiTab, simi)
- #self.Bind(wx.EVT_MENU, self.OnCHDReinert, chdreinert)
elif pydata.get('type', False) == 'alceste' and pydata['uuid'] in self.parent.history.opened :
openmenu = wx.Menu()
antipro = openmenu.Append(wx.ID_ANY, _(u"Antiprofiles").decode('utf8'))
def OnWordCloud(self, evt) :
self.parent.OnWordCloud(evt, self.getcorpus())
- def OnFreq(self, evt):
- self.parent.OnFreq(evt, self.getmatrix())
+# def OnFreq(self, evt):
+# self.parent.OnFreq(evt, self.getmatrix())
- def OnChiSquare(self, evt):
- self.parent.OnChi2(evt, self.getmatrix())
+# def OnChiSquare(self, evt):
+# self.parent.OnChi2(evt, self.getmatrix())
- def OnSimiTab(self, evt):
- self.parent.OnSimiTab(evt, self.getmatrix())
+# def OnSimiTab(self, evt):
+# self.parent.OnSimiTab(evt, self.getmatrix())
- def OnProto(self, evt):
- self.parent.OnProto(evt, self.getmatrix())
+# def OnProto(self, evt):
+# self.parent.OnProto(evt, self.getmatrix())
- def OnSplitFromVar(self, evt):
- self.parent.OnSplitVar(evt, self.getmatrix())
+# def OnSplitFromVar(self, evt):
+# self.parent.OnSplitVar(evt, self.getmatrix())
- def OnCHDReinert(self, evt):
- self.parent.OnCHDReinert(evt, self.getmatrix())
+# def OnCHDReinert(self, evt):
+# self.parent.OnCHDReinert(evt, self.getmatrix())
- def OnSubTextFromMeta(self, evt):
- self.parent.OnSubText(self.getcorpus(), parametres = {'frommeta' : True})
+ #def OnSubTextFromMeta(self, evt):
+ # self.parent.OnSubText(self.getcorpus(), parametres = {'frommeta' : True})
- def OnSubTextFromTheme(self, evt):
- self.parent.OnSubText(self.getcorpus(), parametres = {'fromtheme' : True})
+ #def OnSubTextFromTheme(self, evt):
+ # self.parent.OnSubText(self.getcorpus(), parametres = {'fromtheme' : True})
def OnProfSR(self, evt) :
ProfileSegment(self.parent, self.page.dictpathout, self.page.parametres, self.page.corpus)
dial.Destroy()
def OnSubCorpusFromClusters(self, evt):
- self.parent.OnSubText(self.getcorpus(), parametres = {'fromclusters' : True, 'clnb': self.page.parametres['clnb'], 'lc' : self.page.corpus.lc})
+ self.parent.OnSubText(evt, corpus = self.getcorpus(), parametres = {'fromclusters' : True, 'clnb': self.page.parametres['clnb'], 'lc' : self.page.corpus.lc})
def OnRename(self, event):
pydata = self.itemdict['pydata']