+ def OnNotebookMiddleClick(self, event):
+ index, type = ServiceView.bottomTab.HitTest(event.GetPosition())
+ # 0 tab is always message. This code assumes the rest are run/debug windows
+ if index > 0:
+ page = ServiceView.bottomTab.GetPage(index)
+ if hasattr(page, 'StopAndRemoveUI'):
+ page.StopAndRemoveUI(event)
+
+
+ def OnNotebookRightClick(self, event):
+ index, type = ServiceView.bottomTab.HitTest(event.GetPosition())
+ menu = wx.Menu()
+ x, y = event.GetX(), event.GetY()
+ # 0 tab is always message. This code assumes the rest are run/debug windows
+ if index > 0:
+ page = ServiceView.bottomTab.GetPage(index)
+ id = wx.NewId()
+ menu.Append(id, _("Close"))
+ def OnRightMenuSelect(event):
+ if hasattr(page, 'StopAndRemoveUI'):
+ page.StopAndRemoveUI(event)
+ wx.EVT_MENU(ServiceView.bottomTab, id, OnRightMenuSelect)
+ if ServiceView.bottomTab.GetPageCount() > 1:
+ id = wx.NewId()
+ menu.Append(id, _("Close All but \"Message\""))
+ def OnRightMenuSelect(event):
+ for i in range(ServiceView.bottomTab.GetPageCount()-1, 0, -1): # Go from len-1 to 1
+ page = ServiceView.bottomTab.GetPage(i)
+ if hasattr(page, 'StopAndRemoveUI'):
+ page.StopAndRemoveUI(event)
+ wx.EVT_MENU(ServiceView.bottomTab, id, OnRightMenuSelect)
+
+ ServiceView.bottomTab.PopupMenu(menu, wx.Point(x, y))
+ menu.Destroy()
+
+