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
6 # under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation, either version 3 of the
8 # License, or (at your option) any later version.
10 # Hooke is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 # Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with Hooke. If not, see
17 # <http://www.gnu.org/licenses/>.
19 """Status bar for Hooke.
24 from ... import version
27 class StatusBar (wx.StatusBar):
28 def __init__(self, *args, **kwargs):
29 super(StatusBar, self).__init__(*args, **kwargs)
30 self.SetFieldsCount(2)
31 self.SetStatusWidths([-2, -3])
32 self.SetStatusText('Ready', 0)
33 self.SetStatusText(u'Welcome to Hooke (version %s)' % version(), 1)
35 def set_playlist(self, playlist):
36 self.SetStatusText(self._playlist_status(playlist), 0)
38 def set_curve(self, curve):
41 def set_plot_text(self, text):
42 self.SetStatusText(text, 1)
44 def _playlist_status(self, playlist):
47 '(%d/%d)' % (playlist.index(), len(playlist)),
49 curve = playlist.current()
51 fields.append(curve.name)
52 return ' '.join(fields)