c10f6a1629cfb7d321320aead8b411c7f2ffd040
[hooke.git] / hooke / ui / gui / navbar.py
1 # Copyright
2
3 """Navigation bar for Hooke.
4 """
5
6 import wx
7
8
9 class NavBar (wx.ToolBar):
10     def __init__(self, callbacks, *args, **kwargs):
11         super(NavBar, self).__init__(*args, **kwargs)
12         self.SetToolBitmapSize(wx.Size(16,16))
13         self._c = {
14             'previous': self.AddLabelTool(
15                 id=wx.ID_PREVIEW_PREVIOUS,
16                 label='Previous',
17                 bitmap=wx.ArtProvider_GetBitmap(
18                     wx.ART_GO_BACK, wx.ART_OTHER, wx.Size(16, 16)),
19                 shortHelp='Previous curve'),
20             'next': self.AddLabelTool(
21                 id=wx.ID_PREVIEW_NEXT,
22                 label='Next',
23                 bitmap=wx.ArtProvider_GetBitmap(
24                     wx.ART_GO_FORWARD, wx.ART_OTHER, wx.Size(16, 16)),
25                 shortHelp='Next curve'),
26             }
27         self.Realize()
28         self._callbacks = callbacks
29         self.Bind(wx.EVT_TOOL, self._on_next, self._c['next'])
30         self.Bind(wx.EVT_TOOL, self._on_previous, self._c['previous'])
31
32     def _on_next(self, event):
33         self.next()
34
35     def _on_previous(self, event):
36         self.previous()
37
38     @callback
39     def next(self):
40         pass
41
42     @callback
43     def previous(self):
44         pass
45
46
47