9 class FileMenu (wx.Menu):
10 def __init__(self, *args, **kwargs):
11 super(FileMenu, self).__init__(*args, **kwargs)
12 self._c = {'exit': self.Append(wx.ID_EXIT)}
15 class ViewMenu (wx.Menu):
16 def __init__(self, *args, **kwargs):
17 super(ViewMenu, self).__init__(*args, **kwargs)
19 'folders': self.AppendCheckItem(id=wx.ID_ANY, text='Folders\tF5'),
20 'playlist': self.AppendCheckItem(
21 id=wx.ID_ANY, text='Playlists\tF6'),
22 'commands': self.AppendCheckItem(
23 id=wx.ID_ANY, text='Commands\tF7'),
24 'assistant': self.AppendCheckItem(
25 id=wx.ID_ANY, text='Assistant\tF9'),
26 'properties': self.AppendCheckItem(
27 id=wx.ID_ANY, text='Properties\tF8'),
28 'results': self.AppendCheckItem(id=wx.ID_ANY, text='Results\tF10'),
29 'output': self.AppendCheckItem(id=wx.ID_ANY, text='Output\tF11'),
30 'note': self.AppendCheckItem(id=wx.ID_ANY, text='Note\tF12'),
32 for item in self._c.values():
36 class PerspectiveMenu (wx.Menu):
37 def __init__(self, *args, **kwargs):
38 super(PerspectiveMenu, self).__init__(*args, **kwargs)
41 def update(self, perspectives, selected, callback):
42 """Rebuild the perspectives menu.
44 for item in self.GetMenuItems():
48 'save': self.Append(id=wx.ID_ANY, text='Save Perspective'),
49 'delete': self.Append(id=wx.ID_ANY, text='Delete Perspective'),
51 self.AppendSeparator()
52 for label in perspectives:
53 self._c[label] = self.AppendRadioItem(id=wx.ID_ANY, text=label)
54 self.Bind(wx.EVT_MENU, callback, self._c[label])
56 self._c[label].Check(True)
59 class HelpMenu (wx.Menu):
60 def __init__(self, *args, **kwargs):
61 super(HelpMenu, self).__init__(*args, **kwargs)
62 self._c = {'about':self.Append(id=wx.ID_ABOUT)}
65 class MenuBar (wx.MenuBar):
66 def __init__(self, *args, **kwargs):
67 super(MenuBar, self).__init__(*args, **kwargs)
71 'perspective': PerspectiveMenu(),
74 self.Append(self._c['file'], 'File')
75 self.Append(self._c['view'], 'View')
76 self.Append(self._c['perspective'], 'Perspective')
77 self.Append(self._c['help'], 'Help')