Changeset 2d88fc4 in sasview for src/sas/plottools


Ignore:
Timestamp:
Oct 20, 2015 8:55:16 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
6f16e25
Parents:
6f3fea2
Message:

reduce number of NewIds? used for each plot. Refs #448.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/plottools/toolbar.py

    rd3d67f0 r2d88fc4  
    1919 
    2020class NavigationToolBar(NavigationToolbar2WxAgg): 
     21    _NTB2_HOME = wx.NewId() 
     22    _NTB2_BACK = wx.NewId() 
     23    _NTB2_FORWARD = wx.NewId() 
     24    _NTB2_PAN = wx.NewId() 
     25    _NTB2_ZOOM = wx.NewId() 
     26    _NTB2_SAVE = wx.NewId() 
     27    _NTB2_PRINT = wx.NewId() 
     28    _NTB2_RESET = wx.NewId() 
     29    _NTB2_COPY = wx.NewId() 
    2130    """ 
    2231    Overwrite matplotlib toolbar 
     
    3140    def _init_toolbar(self): 
    3241        self._parent = self.canvas.GetParent() 
    33         self._NTB2_HOME = wx.NewId() 
    34         self._NTB2_BACK = wx.NewId() 
    35         self._NTB2_FORWARD = wx.NewId() 
    36         self._NTB2_PAN = wx.NewId() 
    37         self._NTB2_ZOOM = wx.NewId() 
    38         self._NTB2_SAVE = wx.NewId() 
    39         self._NTB2_PRINT = wx.NewId() 
    40         self._NTB2_RESET = wx.NewId() 
    4142 
    4243        # for mpl 1.2+ compatibility 
     
    101102        """ 
    102103        # Slicer plot popup menu 
    103         wx_id = wx.NewId() 
    104104        popup = wx.Menu() 
    105         popup.Append(wx_id, '&Save image', 'Save image as PNG') 
    106         wx.EVT_MENU(self, wx_id, self.save_figure) 
     105        popup.Append(self._NTB2_SAVE, '&Save image', 'Save image as PNG') 
     106        wx.EVT_MENU(self, self._NTB2_SAVE, self.save_figure) 
    107107 
    108         wx_id = wx.NewId() 
    109         popup.Append(wx_id, '&Print image', 'Print image ') 
    110         wx.EVT_MENU(self, wx_id, self.print_figure) 
     108        popup.Append(self._NTB2_PRINT, '&Print image', 'Print image ') 
     109        wx.EVT_MENU(self, self._NTB2_PRINT, self.print_figure) 
    111110 
    112         wx_id = wx.NewId() 
    113         popup.Append(wx_id, '&Copy to Clipboard', 'Copy image to the clipboard') 
    114         wx.EVT_MENU(self, wx_id, self.copy_figure) 
     111        popup.Append(self._NTB2_COPY, '&Copy to Clipboard', 'Copy image to the clipboard') 
     112        wx.EVT_MENU(self, self._NTB2_COPY, self.copy_figure) 
    115113 
    116114        # Show the popup menu relative to the location of the toolbar 
Note: See TracChangeset for help on using the changeset viewer.