def CreateMenuBar(self):
"""Create our menu-bar for triggering operations"""
menubar = wx.MenuBar()
menu = wx.Menu()
menu.Append(ID_OPEN, _('&Open'), _('Open a new profile file'))
menu.AppendSeparator()
menu.Append(ID_EXIT, _('&Close'), _('Close this RunSnakeRun window'))
menubar.Append(menu, _('&File'))
menu = wx.Menu()
self.packageMenuItem = menu.AppendCheckItem(
ID_PACKAGE_VIEW, _('&File View'),
_('View time spent by package/module')
)
self.percentageMenuItem = menu.AppendCheckItem(
ID_PERCENTAGE_VIEW, _('&Percentage View'),
_('View time spent as percent of overall time')
)
self.rootViewItem = menu.Append(
ID_ROOT_VIEW, _('&Root View (Home)'),
_('View the root of the tree')
)
self.backViewItem = menu.Append(
ID_BACK_VIEW, _('&Back'), _('Go back in your viewing history')
)
self.upViewItem = menu.Append(
ID_UP_VIEW, _('&Up'),
_('Go "up" to the parent of this node with the largest cummulative total')
)
# This stuff isn't really all that useful for profiling,
# it's more about how to generate graphics to describe profiling...
# self.deeperViewItem = menu.Append(
# ID_DEEPER_VIEW, _('&Deeper'), _('View deeper squaremap views')
# )
# self.shallowerViewItem = menu.Append(
# ID_SHALLOWER_VIEW, _('&Shallower'), _('View shallower squaremap views')
# )
# wx.ToolTip.Enable(True)
menubar.Append(menu, _('&View'))
self.SetMenuBar(menubar)
wx.EVT_MENU(self, ID_EXIT, lambda evt: self.Close(True))
wx.EVT_MENU(self, ID_OPEN, self.OnOpenFile)
wx.EVT_MENU(self, ID_PACKAGE_VIEW, self.OnPackageView)
wx.EVT_MENU(self, ID_PERCENTAGE_VIEW, self.OnPercentageView)
wx.EVT_MENU(self, ID_UP_VIEW, self.OnUpView)
wx.EVT_MENU(self, ID_DEEPER_VIEW, self.OnDeeperView)
wx.EVT_MENU(self, ID_SHALLOWER_VIEW, self.OnShallowerView)
wx.EVT_MENU(self, ID_ROOT_VIEW, self.OnRootView)
wx.EVT_MENU(self, ID_BACK_VIEW, self.OnBackView)
评论列表
文章目录