Changeset da6c9847 in sasview for src/sans/plottools
- Timestamp:
- Apr 5, 2014 4:12:17 AM (11 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- a40a875
- Parents:
- 4d7e5d5
- Location:
- src/sans/plottools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sans/plottools/PlotPanel.py
rcafa75f rda6c9847 1113 1113 @property 1114 1114 def is_zoomed(self): 1115 if hasattr(self.toolbar, "wx_ids"): 1116 back = self.toolbar.wx_ids['Back'] 1117 else: # CRUFT 1118 back = self.toolbar._NTB2_BACK 1119 toolbar_zoomed = self.toolbar.GetToolEnabled(back) 1115 toolbar_zoomed = self.toolbar.GetToolEnabled(self.toolbar.wx_ids['Back']) 1120 1116 return self._is_zoomed or toolbar_zoomed 1121 1117 -
src/sans/plottools/toolbar.py
reea3ffa rda6c9847 24 24 def __init__(self, canvas, parent=None): 25 25 NavigationToolbar2WxAgg.__init__(self, canvas) 26 26 27 # CRUFT: mpl 1.1 uses save rather than save_figure 28 try: save_figure = NavigationToolbar2WxAgg.save 29 except AttributeError: pass 27 30 def _init_toolbar(self): 28 31 self._parent = self.canvas.GetParent() … … 35 38 _NTB2_PRINT = wx.NewId() 36 39 _NTB2_RESET = wx.NewId() 40 41 # for mpl 1.2+ compatibility 42 self.wx_ids = {} 43 self.wx_ids['Back'] = self._NTB2_BACK 44 self.wx_ids['Forward'] = self._NTB2_FORWARD 45 self.wx_ids['Pan'] = self._NTB2_PAN 46 self.wx_ids['Zoom'] = self._NTB2_ZOOM 37 47 38 48 self.SetToolBitmapSize(wx.Size(24,24)) … … 72 82 bind(self, wx.EVT_TOOL, self.zoom, id=self._NTB2_ZOOM) 73 83 bind(self, wx.EVT_TOOL, self.pan, id=self._NTB2_PAN) 74 bind(self, wx.EVT_TOOL, self.save , id=_NTB2_SAVE)84 bind(self, wx.EVT_TOOL, self.save_figure, id=_NTB2_SAVE) 75 85 bind(self, wx.EVT_TOOL, self.on_print, id=_NTB2_PRINT) 76 86 bind(self, wx.EVT_TOOL, self.on_reset, id=_NTB2_RESET) 77 87 78 88 self.Realize() 79 89 80 90 def on_menu(self, event): 81 91 """ … … 86 96 except: 87 97 logging.error("Plot toolbar could not show menu") 88 98 89 99 def on_reset(self, event): 90 100 """ … … 95 105 except: 96 106 logging.error("Plot toolbar could not reset plot") 97 107 98 108 def on_print(self, event): 99 109 """
Note: See TracChangeset
for help on using the changeset viewer.