+
+ if 'corpus_name' in pydata :
+ buildmenu(menu, self.parent.text_menu)
+ menu.AppendSeparator()
+ elif 'matrix_name' in pydata :
+ buildmenu(menu, self.parent.matrix_menu)
+ menu.AppendSeparator()
+ 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'))
+ menu.AppendMenu(wx.ID_ANY, _(u"Open ...").decode('utf8'), openmenu)
+
+ profsr = menu.Append(wx.ID_ANY, _(u"Repeated segments profiles").decode('utf8'))
+ profgram = menu.Append(wx.ID_ANY, _(u"POS profiles").decode('utf8'))
+ tgen = menu.Append(wx.ID_ANY, _(u"Tgen Editor").decode('utf8'))
+ computetgen = menu.Append(wx.ID_ANY, _(u"Compute Tgen").decode('utf8'))
+ export_corpus = menu.Append(wx.ID_ANY, _(u"Export corpus").decode('utf8'))
+ colored = menu.Append(wx.ID_ANY, _(u"Colored corpus").decode('utf8'))
+ navig = menu.Append(wx.ID_ANY, _(u"Navigator").decode('utf8'))
+ statclasse = menu.Append(wx.ID_ANY, _(u"Clusters statistics").decode('utf8'))
+ rapport = menu.Append(wx.ID_ANY, _(u"Report").decode('utf8'))
+ export_classes = menu.Append(wx.ID_ANY, _(u"Export clusters").decode('utf8'))
+ subcorpusfromcl = menu.Append(wx.ID_ANY, _(u"Sub corpus from clusters").decode('utf8'))
+ menu.AppendSeparator()
+ self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro)
+ self.Bind(wx.EVT_MENU, self.OnProfSR, profsr)
+ self.Bind(wx.EVT_MENU, self.OnProfGram, profgram)
+ self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen)
+ self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen)
+ self.Bind(wx.EVT_MENU, self.OnExportCorpus, export_corpus)
+ self.Bind(wx.EVT_MENU, self.OnColored, colored)
+ self.Bind(wx.EVT_MENU, self.OnNavig, navig)
+ self.Bind(wx.EVT_MENU, self.StatClasse, statclasse)
+ self.Bind(wx.EVT_MENU, self.OnRapport, rapport)
+ self.Bind(wx.EVT_MENU, self.OnExportClasses, export_classes)
+ self.Bind(wx.EVT_MENU, self.OnSubCorpusFromClusters, subcorpusfromcl)
+ elif pydata.get('type', False) == 'stat' and pydata['uuid'] in self.parent.history.opened :
+ export_dictionary = menu.Append(wx.ID_ANY, _(u"Export dictionary").decode('utf8'))
+ export_lems = menu.Append(wx.ID_ANY, _(u"Export lemma dictionary").decode('utf8'))
+ self.Bind(wx.EVT_MENU, self.OnExportDictionary, export_dictionary)
+ self.Bind(wx.EVT_MENU, self.OnExportLems, export_lems)
+ menu.AppendSeparator()
+ elif pydata.get('type', False) == 'spec' and pydata['uuid'] in self.parent.history.opened :
+ tgen = menu.Append(wx.ID_ANY, _(u"Tgen Editor").decode('utf8'))
+ computetgen = menu.Append(wx.ID_ANY, _(u"Compute Tgen").decode('utf8'))
+ self.Bind(wx.EVT_MENU, self.OnTgenEditor, tgen)
+ self.Bind(wx.EVT_MENU, self.OnTgenCompute, computetgen)
+ menu.AppendSeparator()
+ elif pydata.get('type', False) == 'reinertmatrix' and pydata['uuid'] in self.parent.history.opened :
+ openmenu = wx.Menu()
+ antipro = openmenu.Append(wx.ID_ANY, _(u"antiprofiles").decode('utf8'))
+ rapport = menu.Append(wx.ID_ANY, _(u"Report").decode('utf8'))
+ menu.AppendMenu(wx.ID_ANY, _(u"Open ...").decode('utf8'), openmenu)
+ self.Bind(wx.EVT_MENU, self.OpenAntipro, antipro)
+ self.Bind(wx.EVT_MENU, self.OnRapport, rapport)
+
+ itemdelete = wx.MenuItem(menu, wx.ID_ANY, _(u"Delete from history").decode('utf8'))
+ itemdelete.SetBitmap(wx.ArtProvider_GetBitmap(wx.ART_DELETE, size = (16,16)))
+ menu.AppendItem(itemdelete)
+ #item11 = menu.Append(wx.ID_ANY, "Prepend An Item")
+ #item12 = menu.Append(wx.ID_ANY, "Append An Item")
+
+ #self.Bind(wx.EVT_MENU, self.OnItemBackground, item1)
+ #self.Bind(wx.EVT_MENU, self.OnItemForeground, item2)
+ #self.Bind(wx.EVT_MENU, self.OnItemBold, item3)
+ #self.Bind(wx.EVT_MENU, self.OnItemFont, item4)
+ #self.Bind(wx.EVT_MENU, self.OnItemHyperText, item5)
+ #self.Bind(wx.EVT_MENU, self.OnEnableWindow, item6)
+ #self.Bind(wx.EVT_MENU, self.OnDisableItem, item7)
+ #self.Bind(wx.EVT_MENU, self.OnItemIcons, item8)
+ self.Bind(wx.EVT_MENU, self.OnItemInfo, info)
+ self.Bind(wx.EVT_MENU, self.OnRename, rename)
+ self.Bind(wx.EVT_MENU, self.OnItemDelete, itemdelete)
+ #self.Bind(wx.EVT_MENU, self.OnItemPrepend, item11)
+ #self.Bind(wx.EVT_MENU, self.OnItemAppend, item12)