Changeset c30822c in sasview


Ignore:
Timestamp:
Nov 21, 2018 3:33:07 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
7f41584
Parents:
57a91fc
Message:

Show the adjusted click location on Plotter1D and Plotter2D.
SASVIEW-1179

Location:
src/sas/qtgui/Plotting
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/Plotter.py

    r3b95b3b rc30822c  
    600600        except: 
    601601            self.position = None 
     602 
     603        x_str = GuiUtils.formatNumber(self.x_click) 
     604        y_str = GuiUtils.formatNumber(self.y_click) 
     605        coord_str = "x: {}, y: {}".format(x_str, y_str) 
     606        self.manager.communicator.statusBarUpdateSignal.emit(coord_str) 
    602607 
    603608    def onMplMouseUp(self, event): 
  • src/sas/qtgui/Plotting/Plotter2D.py

    r8c85ac1 rc30822c  
    574574        self.plot(data=new_plot) 
    575575 
     576    def onMplMouseDown(self, event): 
     577        """ 
     578        Display x/y/intensity on click 
     579        """ 
     580        # Check that the LEFT button was pressed 
     581        if event.button != 1: 
     582            return 
     583 
     584        if event.inaxes is None: 
     585            return 
     586        x_click = 0.0 
     587        y_click = 0.0 
     588        try: 
     589            x_click = float(event.xdata)  # / size_x 
     590            y_click = float(event.ydata)  # / size_y 
     591        except: 
     592            self.position = None 
     593        x_str = GuiUtils.formatNumber(x_click) 
     594        y_str = GuiUtils.formatNumber(y_click) 
     595        coord_str = "x: {}, y: {}".format(x_str, y_str) 
     596        self.manager.communicator.statusBarUpdateSignal.emit(coord_str) 
    576597 
    577598class Plotter2D(QtWidgets.QDialog, Plotter2DWidget): 
Note: See TracChangeset for help on using the changeset viewer.