-# Copyright (C) 2010 Massimo Sandal <devicerandom@gmail.com>
-# Rolf Schmidt <rschmidt@alcor.concordia.ca>
-# 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/>.
"""Plot panel for Hooke.
self._c['canvas'] = FigureCanvas(
parent=self, id=wx.ID_ANY, figure=self._c['figure'])
- self._set_color(wx.NamedColor('WHITE'))
+ self._set_color(wx.NamedColour('WHITE'))
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self._c['canvas'], 1, wx.LEFT | wx.TOP | wx.GROW)
self._setup_toolbar(sizer=sizer) # comment out to remove plot toolbar.
elif wx.Platform == '__WXMSW__':
# On Windows platform, default window size is incorrect, so set
# toolbar width to figure width.
- tw, th = toolbar.GetSizeTuple()
+ tw, th = self._c['toolbar'].GetSizeTuple()
fw, fh = self._c['canvas'].GetSizeTuple()
# By adding toolbar in sizer, we are able to put it at the bottom
# of the frame - so appearance is closer to GTK version.
def _on_mouse_move(self, event):
if 'toolbar' in self._c:
- if event.guiEvent.m_shiftDown:
+ if event.guiEvent.shiftDown:
self._c['toolbar'].set_cursor(wx.CURSOR_RIGHT_ARROW)
else:
self._c['toolbar'].set_cursor(wx.CURSOR_ARROW)