1 # Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
3 # This file is part of Hooke.
5 # Hooke is free software: you can redistribute it and/or modify it under the
6 # terms of the GNU Lesser General Public License as published by the Free
7 # Software Foundation, either version 3 of the License, or (at your option) any
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15 # You should have received a copy of the GNU Lesser General Public License
16 # along with Hooke. If not, see <http://www.gnu.org/licenses/>.
18 """Navigation bar for Hooke.
23 from ...util.callback import callback, in_callback
26 class NavBar (wx.ToolBar):
27 def __init__(self, callbacks, *args, **kwargs):
28 super(NavBar, self).__init__(*args, **kwargs)
29 self.SetToolBitmapSize(wx.Size(16,16))
31 'previous': self.AddLabelTool(
32 id=wx.ID_PREVIEW_PREVIOUS,
34 bitmap=wx.ArtProvider_GetBitmap(
35 wx.ART_GO_BACK, wx.ART_OTHER, wx.Size(16, 16)),
36 shortHelp='Previous curve'),
37 'next': self.AddLabelTool(
38 id=wx.ID_PREVIEW_NEXT,
40 bitmap=wx.ArtProvider_GetBitmap(
41 wx.ART_GO_FORWARD, wx.ART_OTHER, wx.Size(16, 16)),
42 shortHelp='Next curve'),
45 self._callbacks = callbacks
46 self.Bind(wx.EVT_TOOL, self._on_next, self._c['next'])
47 self.Bind(wx.EVT_TOOL, self._on_previous, self._c['previous'])
49 def _on_next(self, event):
52 def _on_previous(self, event):