- Timestamp:
- Jun 12, 2008 9:47:15 AM (16 years ago)
- 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:
- 96f13a9
- Parents:
- 4101eea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guitools/PlotPanel.py
r4101eea rac9c465 92 92 lo=loprev 93 93 hi=hiprev 94 print "Not possible to scale"94 #print "Not possible to scale" 95 95 96 96 else: 97 97 lo,hi = math.pow(10.,lo),math.pow(10.,hi) 98 98 #assert lo >0,"lo = %g"%lo 99 print "possible to scale"99 #print "possible to scale" 100 100 101 print "these are low and high",lo,hi101 #print "these are low and high",lo,hi 102 102 103 103 return (lo,hi) … … 184 184 """ left button down and ready to drag""" 185 185 self.leftdown=True 186 #self.mousemotion=False187 186 ax = event.inaxes 188 187 if ax !=None: 188 self.xInit,self.yInit=event.xdata,event.ydata 189 189 190 #print "these are x %f and y %f"%(x,y) 191 self.xInit,self.yInit=event.xdata,event.ydata 192 print "this is xInit %f this is yInit %f"%(self.xInit, self.yInit) 190 193 191 def onLeftUp(self,event): 194 192 """ Dragging is done """ … … 196 194 self.mousemotion=False 197 195 self.leftup=True 198 """ 199 if self.mousemotion==True: 196 197 def onMouseMotion(self,event): 198 """ 199 check if the left button is press and the mouse in moving. 200 computer delta for x and y coordinates and then calls draghelper 201 to perform the drag 202 """ 203 self.mousemotion=True 204 if self.leftdown==True and self.mousemotion==True: 205 200 206 ax = event.inaxes 201 if ax !=None: 202 x,y = event.x,event.y 203 self.xFinal,self.yFinal=ax.transAxes.inverse_xy_tup((x,y)) 207 if ax !=None:#the dragging is perform inside the figure 208 self.xFinal,self.yFinal=event.xdata,event.ydata 204 209 205 210 xdelta = self.xFinal -self.xInit … … 211 216 ydelta = math.log10(self.yFinal) -math.log10(self.yInit) 212 217 self.dragHelper(xdelta,ydelta) 213 print "this is xInit %f this is xFinal %f \n"%(self.xInit, self.xFinal) 214 print "this is yInit %f this is yFinal %f \n"%(self.yInit, self.yFinal) 215 print "this is xdelta %f and ydelta %f \n"%(xdelta,ydelta) 216 else: 218 219 else:# no dragging is perform elsewhere 217 220 self.dragHelper(0,0) 218 221 219 """220 def onMouseMotion(self,event):221 self.mousemotion=True222 if self.leftdown==True and self.mousemotion==True:223 224 ax = event.inaxes225 if ax !=None:226 self.xFinal,self.yFinal=event.xdata,event.ydata227 228 xdelta = self.xFinal -self.xInit229 ydelta = self.yFinal -self.yInit230 231 if self.xscale=='log':232 xdelta = math.log10(self.xFinal) -math.log10(self.xInit)233 if self.yscale=='log':234 ydelta = math.log10(self.yFinal) -math.log10(self.yInit)235 self.dragHelper(xdelta,ydelta)236 print "this is xInit %f this is xFinal %f \n"%(self.xInit, self.xFinal)237 print "this is yInit %f this is yFinal %f \n"%(self.yInit, self.yFinal)238 print "this is xdelta %f and ydelta %f \n"%(xdelta,ydelta)239 else:240 self.dragHelper(0,0)241 222 def dragHelper(self,xdelta,ydelta): 242 223 """ dragging occurs here"""
Note: See TracChangeset
for help on using the changeset viewer.