test/data/vclamp_jpk/README: Document sample versions
[hooke.git] / hooke / ui / gui / statusbar.py
index 59e58597c9fe5991b5e64c2c3e4c81e01ed955c2..8e9a381275e555fc01769881c5713c0745f3d004 100644 (file)
@@ -1,14 +1,32 @@
-# Copyright
+# Copyright (C) 2010-2012 W. Trevor King <wking@tremily.us>
+#
+# 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 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/>.
 
 """Status bar for Hooke.
 """
 
 import wx
 
+from ... import version
+
 
 class StatusBar (wx.StatusBar):
     def __init__(self, *args, **kwargs):
         super(StatusBar, self).__init__(*args, **kwargs)
+        self.SetFieldsCount(2)
         self.SetStatusWidths([-2, -3])
         self.SetStatusText('Ready', 0)
         self.SetStatusText(u'Welcome to Hooke (version %s)' % version(), 1)
@@ -19,12 +37,15 @@ class StatusBar (wx.StatusBar):
     def set_curve(self, curve):
         pass
 
+    def set_plot_text(self, text):
+        self.SetStatusText(text, 1)
+
     def _playlist_status(self, playlist):
         fields = [
             playlist.name,
-            '(%d/%d)' % (playlist._index, len(playlist)),
+            '(%d/%d)' % (playlist.index(), len(playlist)),
             ]
-        curve = playlist.current():
+        curve = playlist.current()
         if curve != None:
             fields.append(curve.name)
         return ' '.join(fields)