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.
22 #import wx.aui as aui # C++ implementation
23 import wx.lib.agw.aui as aui # Python implementation
25 from ...util.callback import callback, in_callback
28 class NavBar (aui.AuiToolBar):
29 def __init__(self, callbacks, *args, **kwargs):
30 super(NavBar, self).__init__(*args, **kwargs)
31 bitmap_size = wx.Size(16,16)
32 self.SetToolBitmapSize(bitmap_size)
34 'previous': self.AddTool(
35 tool_id=wx.ID_PREVIEW_PREVIOUS,
37 bitmap=wx.ArtProvider_GetBitmap(
38 wx.ART_GO_BACK, wx.ART_OTHER, bitmap_size),
39 disabled_bitmap=wx.NullBitmap,
41 short_help_string='Previous curve',
45 tool_id=wx.ID_PREVIEW_NEXT,
47 bitmap=wx.ArtProvider_GetBitmap(
48 wx.ART_GO_FORWARD, wx.ART_OTHER, bitmap_size),
49 disabled_bitmap=wx.NullBitmap,
51 short_help_string='Next curve',
54 'delete': self.AddTool(
57 bitmap=wx.ArtProvider_GetBitmap(
58 wx.ART_DELETE, wx.ART_OTHER, bitmap_size),
59 disabled_bitmap=wx.NullBitmap,
61 short_help_string='Remove curve from playlist',
66 self._callbacks = callbacks
67 self.Bind(wx.EVT_TOOL, self._on_next, self._c['next'])
68 self.Bind(wx.EVT_TOOL, self._on_previous, self._c['previous'])
69 self.Bind(wx.EVT_TOOL, self._on_delete, self._c['delete'])
71 def _on_next(self, event):
74 def _on_previous(self, event):
77 def _on_delete(self, event):