X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tree.py;h=87188454c899e84def7960ae8e110290eaf5e541;hp=25106faa9fd5c7ce01a5d191f2bc6366f2a262f2;hb=9a12a3e7eee7e594312047115cc130f769a3adc3;hpb=357e5403d3c539083a1052248628f0aab1af1eaa diff --git a/tree.py b/tree.py index 25106fa..8718845 100644 --- a/tree.py +++ b/tree.py @@ -125,6 +125,7 @@ class LeftTree(CT.CustomTreeCtrl): 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['proto'] = self.il.Add(wx.Image(os.path.join(self.parent.images_path,'proto.png'), wx.BITMAP_TYPE_PNG).Scale(16,16).ConvertToBitmap()) self.SetImageList(self.il) self.count = 0 @@ -412,7 +413,13 @@ class LeftTree(CT.CustomTreeCtrl): item = self.parent.matrix_menu.FindItemByPosition(i) itemid = item.GetId() itemtext = item.GetText() - menu.Append(itemid, itemtext) + 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) @@ -468,8 +475,10 @@ class LeftTree(CT.CustomTreeCtrl): 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 = menu.Append(wx.ID_ANY, _(u"Delete from history").decode('utf8'))