Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/guiframe/local_perspectives/plotting/Plotter1D.py

    refb482a r895c9cb  
    527527            self.subplot.set_xlim((xlo, xhi)) 
    528528            self.subplot.set_ylim((ylo, yhi)) 
     529        self.graph.selected_plottable = None 
    529530 
    530531 
     
    604605 
    605606            if self.parent.ClassName.count('wxDialog') == 0: 
    606                 wx_id = ids.next() 
    607                 plot_menu.Append(wx_id, '&Linear Fit', name) 
    608                 wx.EVT_MENU(self, wx_id, self.onFitting) 
    609                 plot_menu.AppendSeparator() 
     607                if plot.id != 'fit': 
     608                    wx_id = ids.next() 
     609                    plot_menu.Append(wx_id, '&Linear Fit', name) 
     610                    wx.EVT_MENU(self, wx_id, self.onFitting) 
     611                    plot_menu.AppendSeparator() 
    610612 
    611613                wx_id = ids.next() 
     
    669671        self._slicerpop.AppendSeparator() 
    670672        wx_id = ids.next() 
     673        self._slicerpop.Append(wx_id, '&Set Graph Range') 
     674        wx.EVT_MENU(self, wx_id, self.onSetRange) 
     675        wx_id = ids.next() 
    671676        self._slicerpop.Append(wx_id, '&Reset Graph Range') 
    672677        wx.EVT_MENU(self, wx_id, self.onResetGraph) 
     
    685690        self.PopupMenu(self._slicerpop, pos) 
    686691 
     692    def onSetRange(self, event): 
     693        # Display dialog 
     694        # self.subplot.set_xlim((low, high)) 
     695        # self.subplot.set_ylim((low, high)) 
     696        from sas.sasgui.plottools.RangeDialog import RangeDialog 
     697        d = RangeDialog(self, -1) 
     698        xlim = self.subplot.get_xlim() 
     699        ylim = self.subplot.get_ylim() 
     700        d.SetXRange(xlim) 
     701        d.SetYRange(ylim) 
     702        if d.ShowModal() == wx.ID_OK: 
     703            x_range = d.GetXRange() 
     704            y_range = d.GetYRange() 
     705            if x_range is not None and y_range is not None: 
     706                self.subplot.set_xlim(x_range) 
     707                self.subplot.set_ylim(y_range) 
     708                self.subplot.figure.canvas.draw_idle() 
     709        d.Destroy() 
     710 
    687711    def onFreeze(self, event): 
    688712        """ 
     
    771795                                                             int(curr_symbol))), curr_label) 
    772796        self.appD.Bind(wx.EVT_CLOSE, self.on_AppDialog_close) 
     797        self.graph.selected_plottable = None 
    773798 
    774799    def on_AppDialog_close(self, event): 
Note: See TracChangeset for help on using the changeset viewer.