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/guiframe/local_perspectives/plotting/Plotter2D.py

    r098f3d2 r2d88fc4  
    287287 
    288288        """ 
     289        self._menu_ids.reset() 
    289290        slicerpop = PanelMenu() 
    290291        slicerpop.set_plots(self.plots) 
    291292        slicerpop.set_graph(self.graph) 
    292293 
    293         wx_id = wx.NewId() 
     294        wx_id = self._menu_ids.next() 
    294295        slicerpop.Append(wx_id, '&Save Image') 
    295296        wx.EVT_MENU(self, wx_id, self.onSaveImage) 
    296297 
    297         wx_id = wx.NewId() 
     298        wx_id = self._menu_ids.next() 
    298299        slicerpop.Append(wx_id, '&Print Image', 'Print image') 
    299300        wx.EVT_MENU(self, wx_id, self.onPrint) 
    300301 
    301         wx_id = wx.NewId() 
     302        wx_id = self._menu_ids.next() 
    302303        slicerpop.Append(wx_id, '&Copy to Clipboard', 'Copy to the clipboard') 
    303304        wx.EVT_MENU(self, wx_id, self.OnCopyFigureMenu) 
     
    305306        # saving data 
    306307        plot = self.data2D 
    307         wx_id = wx.NewId() 
     308        wx_id = self._menu_ids.next() 
    308309        slicerpop.Append(wx_id, "&Data Info") 
    309310        wx.EVT_MENU(self, wx_id, self._onDataShow) 
    310311 
    311         wx_id = wx.NewId() 
     312        wx_id = self._menu_ids.next() 
    312313        slicerpop.Append(wx_id, "&Save as a File (DAT)") 
    313314        self.action_ids[str(wx_id)] = plot 
     
    322323                for item in item_list: 
    323324                    try: 
    324                         wx_id = wx.NewId() 
     325                        wx_id = self._menu_ids.next() 
    325326                        slicerpop.Append(wx_id, item[0], item[1]) 
    326327                        wx.EVT_MENU(self, wx_id, item[2]) 
     
    331332                slicerpop.AppendSeparator() 
    332333 
    333             wx_id = wx.NewId() 
     334            wx_id = self._menu_ids.next() 
    334335            slicerpop.Append(wx_id, '&Perform Circular Average') 
    335336            wx.EVT_MENU(self, wx_id, self.onCircular) \ 
    336337            # For Masked Data 
    337338            if not plot.mask.all(): 
    338                 wx_id = wx.NewId() 
     339                wx_id = self._menu_ids.next() 
    339340                slicerpop.Append(wx_id, '&Masked Circular Average') 
    340341                wx.EVT_MENU(self, wx_id, self.onMaskedCircular) 
    341             wx_id = wx.NewId() 
     342            wx_id = self._menu_ids.next() 
    342343            slicerpop.Append(wx_id, '&Sector [Q View]') 
    343344            wx.EVT_MENU(self, wx_id, self.onSectorQ) 
    344             wx_id = wx.NewId() 
     345            wx_id = self._menu_ids.next() 
    345346            slicerpop.Append(wx_id, '&Annulus [Phi View ]') 
    346347            wx.EVT_MENU(self, wx_id, self.onSectorPhi) 
    347             wx_id = wx.NewId() 
     348            wx_id = self._menu_ids.next() 
    348349            slicerpop.Append(wx_id, '&Box Sum') 
    349350            wx.EVT_MENU(self, wx_id, self.onBoxSum) 
    350             wx_id = wx.NewId() 
     351            wx_id = self._menu_ids.next() 
    351352            slicerpop.Append(wx_id, '&Box Averaging in Qx') 
    352353            wx.EVT_MENU(self, wx_id, self.onBoxavgX) 
    353             wx_id = wx.NewId() 
     354            wx_id = self._menu_ids.next() 
    354355            slicerpop.Append(wx_id, '&Box Averaging in Qy') 
    355356            wx.EVT_MENU(self, wx_id, self.onBoxavgY) 
    356357            if self.slicer != None: 
    357                 wx_id = wx.NewId() 
     358                wx_id = self._menu_ids.next() 
    358359                slicerpop.Append(wx_id, '&Clear Slicer') 
    359360                wx.EVT_MENU(self, wx_id, self.onClearSlicer) 
    360361                if self.slicer.__class__.__name__ != "BoxSum": 
    361                     wx_id = wx.NewId() 
     362                    wx_id = self._menu_ids.next() 
    362363                    slicerpop.Append(wx_id, '&Edit Slicer Parameters') 
    363364                    wx.EVT_MENU(self, wx_id, self._onEditSlicer) 
    364365            slicerpop.AppendSeparator() 
    365366 
    366         wx_id = wx.NewId() 
     367        wx_id = self._menu_ids.next() 
    367368        slicerpop.Append(wx_id, '&Edit Graph Label', 'Edit Graph Label') 
    368369        wx.EVT_MENU(self, wx_id, self.onEditLabels) 
     
    371372        # ILL mod here 
    372373 
    373         wx_id = wx.NewId() 
     374        wx_id = self._menu_ids.next() 
    374375        slicerpop.Append(wx_id, '&Modify graph appearance', 'Modify graph appearance') 
    375376        wx.EVT_MENU(self, wx_id, self.modifyGraphAppearance) 
    376377        slicerpop.AppendSeparator() 
    377378 
    378         wx_id = wx.NewId() 
     379        wx_id = self._menu_ids.next() 
    379380        slicerpop.Append(wx_id, '&2D Color Map') 
    380381        wx.EVT_MENU(self, wx_id, self._onEditDetector) 
    381382        slicerpop.AppendSeparator() 
    382383 
    383         wx_id = wx.NewId() 
     384        wx_id = self._menu_ids.next() 
    384385        slicerpop.Append(wx_id, '&Toggle Linear/Log Scale') 
    385386        wx.EVT_MENU(self, wx_id, self._onToggleScale) 
    386387 
    387388        slicerpop.AppendSeparator() 
    388         wx_id = wx.NewId() 
     389        wx_id = self._menu_ids.next() 
    389390        slicerpop.Append(wx_id, '&Window Title') 
    390391        wx.EVT_MENU(self, wx_id, self.onChangeCaption) 
Note: See TracChangeset for help on using the changeset viewer.