Use Python AUI implementation (instead of C++) in hooke.ui.gui.
[hooke.git] / hooke / ui / gui / navbar.py
index 64e5895c597acf7434f935a3df493ec078602f23..3d18e644bd3012d975b6e682cae66a1d10f3f1f7 100644 (file)
@@ -1,46 +1,56 @@
-# Copyright (C) 2010 W. Trevor King <wking@drexel.edu>
+# Copyright (C) 2010-2012 W. Trevor King <wking@drexel.edu>
 #
 # This file is part of Hooke.
 #
-# Hooke is free software: you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
+# Hooke is free software: you can redistribute it and/or modify it under the
+# terms of the GNU Lesser General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option) any
+# later version.
 #
-# Hooke is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General
-# Public License for more details.
+# Hooke is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
+# details.
 #
-# You should have received a copy of the GNU Lesser General Public
-# License along with Hooke.  If not, see
-# <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public License
+# along with Hooke.  If not, see <http://www.gnu.org/licenses/>.
 
 """Navigation bar for Hooke.
 """
 
 import wx
+#import wx.aui as aui         # C++ implementation
+import wx.lib.agw.aui as aui  # Python implementation
 
 from ...util.callback import callback, in_callback
 
 
-class NavBar (wx.ToolBar):
+class NavBar (aui.AuiToolBar):
     def __init__(self, callbacks, *args, **kwargs):
         super(NavBar, self).__init__(*args, **kwargs)
-        self.SetToolBitmapSize(wx.Size(16,16))
+        bitmap_size = wx.Size(16,16)
+        self.SetToolBitmapSize(bitmap_size)
         self._c = {
-            'previous': self.AddLabelTool(
-                id=wx.ID_PREVIEW_PREVIOUS,
+            'previous': self.AddTool(
+                tool_id=wx.ID_PREVIEW_PREVIOUS,
                 label='Previous',
                 bitmap=wx.ArtProvider_GetBitmap(
-                    wx.ART_GO_BACK, wx.ART_OTHER, wx.Size(16, 16)),
-                shortHelp='Previous curve'),
-            'next': self.AddLabelTool(
-                id=wx.ID_PREVIEW_NEXT,
+                    wx.ART_GO_BACK, wx.ART_OTHER, bitmap_size),
+                disabled_bitmap=wx.NullBitmap,
+                kind=wx.ITEM_NORMAL,
+                short_help_string='Previous curve',
+                long_help_string='',
+                client_data=None),
+            'next': self.AddTool(
+                tool_id=wx.ID_PREVIEW_NEXT,
                 label='Next',
                 bitmap=wx.ArtProvider_GetBitmap(
-                    wx.ART_GO_FORWARD, wx.ART_OTHER, wx.Size(16, 16)),
-                shortHelp='Next curve'),
+                    wx.ART_GO_FORWARD, wx.ART_OTHER, bitmap_size),
+                disabled_bitmap=wx.NullBitmap,
+                kind=wx.ITEM_NORMAL,
+                short_help_string='Next curve',
+                long_help_string='',
+                client_data=None),
             }
         self.Realize()
         self._callbacks = callbacks