Changeset 3477478 in sasview for src/sas/plottools/toolbar.py
- Timestamp:
- Mar 5, 2015 12:38:29 PM (9 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:
- b9dbd6b
- Parents:
- 2df0b74
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/plottools/toolbar.py
r79492222 r3477478 9 9 # Event binding code changed after version 2.5 10 10 if wx.VERSION_STRING >= '2.5': 11 def bind(actor, event,action,**kw):12 actor.Bind(event, action,**kw)11 def bind(actor, event, action, **kw): 12 actor.Bind(event, action, **kw) 13 13 else: 14 def bind(actor, event,action,id=None):14 def bind(actor, event, action, id=None): 15 15 if id is not None: 16 16 event(actor, id, action) 17 17 else: 18 event(actor, action)18 event(actor, action) 19 19 20 20 class NavigationToolBar(NavigationToolbar2WxAgg): … … 28 28 try: save_figure = NavigationToolbar2WxAgg.save 29 29 except AttributeError: pass 30 30 31 def _init_toolbar(self): 31 32 self._parent = self.canvas.GetParent() 32 _NTB2_HOME 33 self._NTB2_BACK 33 _NTB2_HOME = wx.NewId() 34 self._NTB2_BACK = wx.NewId() 34 35 self._NTB2_FORWARD = wx.NewId() 35 self._NTB2_PAN 36 self._NTB2_ZOOM 37 _NTB2_SAVE 38 _NTB2_PRINT 39 _NTB2_RESET 36 self._NTB2_PAN = wx.NewId() 37 self._NTB2_ZOOM = wx.NewId() 38 _NTB2_SAVE = wx.NewId() 39 _NTB2_PRINT = wx.NewId() 40 _NTB2_RESET = wx.NewId() 40 41 41 42 # for mpl 1.2+ compatibility … … 46 47 self.wx_ids['Zoom'] = self._NTB2_ZOOM 47 48 48 self.SetToolBitmapSize(wx.Size(24, 24))49 self.SetToolBitmapSize(wx.Size(24, 24)) 49 50 50 51 context_tip = 'Graph Menu: \n' … … 55 56 56 57 self.InsertSeparator(1) 57 58 58 59 self.AddSimpleTool(self._NTB2_BACK, _load_bitmap('back.png'), 59 60 'Back', 'Back navigation view') … … 62 63 # todo: get new bitmap 63 64 self.AddCheckTool(self._NTB2_PAN, _load_bitmap('move.png'), 64 65 65 shortHelp='Pan', 66 longHelp='Pan with left, zoom with right') 66 67 self.AddCheckTool(self._NTB2_ZOOM, _load_bitmap('zoom_to_rect.png'), 67 68 shortHelp='Zoom', longHelp='Zoom to rectangle') 68 69 69 70 self.AddSeparator() 70 71 self.AddSimpleTool(_NTB2_SAVE, _load_bitmap('filesave.png'), 71 72 'Save', 'Save plot contents to file') 72 73 73 74 print_bmp = wx.ArtProvider.GetBitmap(wx.ART_PRINT, wx.ART_TOOLBAR) 74 75 self.AddSimpleTool(_NTB2_PRINT, print_bmp, 'Print', 'Print plot') 75 76 76 77 reset_bmp = wx.ArtProvider.GetBitmap(wx.ART_GO_HOME, wx.ART_TOOLBAR) 77 78 self.AddSimpleTool(_NTB2_RESET, reset_bmp, 'Reset', 'Reset graph range') … … 114 115 except: 115 116 logging.error("Plot toolbar could not print") 116
Note: See TracChangeset
for help on using the changeset viewer.