def onLeftDown(self, event): """ left button down and ready to drag """ # Check that the LEFT button was pressed PlotPanel.onLeftDown(self, event) ax = event.inaxes if ax is not None: # data coordinate position pos_x = "%8.3g" % event.xdata pos_y = "%8.3g" % event.ydata position = "x: %s y: %s" % (pos_x, pos_y) wx.PostEvent(self.parent, StatusEvent(status=position)) self.plottable_selected(self.data2D.id) self._manager.set_panel_on_focus(self) wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self))
def onLeftDown(self, event): """ left button down and ready to drag Display the position of the mouse on the statusbar """ # self.parent.set_plot_unfocus() self._get_cusor_lines(event) ax = event.inaxes PlotPanel.onLeftDown(self, event) if ax is not None: try: pos_x = float(event.xdata) # / size_x pos_y = float(event.ydata) # / size_y pos_x = "%8.3g" % pos_x pos_y = "%8.3g" % pos_y self.position = str(pos_x), str(pos_y) wx.PostEvent(self.parent, StatusEvent(status=self.position)) except: self.position = None # unfocus all self.parent.set_plot_unfocus() # post nd event to notify guiframe that this panel is on focus wx.PostEvent(self.parent, PanelOnFocusEvent(panel=self))