Changeset 3817 for trunk/GSASIIplot.py
- Timestamp:
- Feb 12, 2019 9:27:27 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r3816 r3817 842 842 dlg.Destroy() 843 843 844 844 845 # these routines are not currently in use, but there are probably good 845 846 # places in the graphics to disable the zoom/pan to release the mouse bind … … 888 889 else: 889 890 print('Unable to reset Pan button, please report this with matplotlib version') 891 892 def SetCursor(page): 893 mode = page.toolbar._active 894 if mode == 'PAN': 895 page.canvas.Cursor = wx.Cursor(wx.CURSOR_SIZING) 896 elif mode == 'ZOOM': 897 page.canvas.Cursor = wx.Cursor(wx.CURSOR_MAGNIFIER) 898 else: 899 page.canvas.Cursor = wx.Cursor(wx.CURSOR_CROSS) 890 900 891 901 ################################################################################ … … 1162 1172 s += fmt.format(*hkl[:n]) 1163 1173 ypos = event.ydata 1164 Page.canvas.SetCursor(wx.CROSS_CURSOR)1174 SetCursor(Page) 1165 1175 try: 1166 1176 G2frame.G2plotNB.status.SetStatusText('d =%9.3f F^2 =%9.3f'%(Xpos,ypos),1) … … 1991 2001 1992 2002 def OnMotion(event): 1993 mode = Page.toolbar._active 1994 if mode == 'PAN': 1995 Page.Cursor = wx.Cursor(wx.CURSOR_SIZING) 1996 elif mode == 'ZOOM': 1997 Page.Cursor = wx.Cursor(wx.CURSOR_MAGNIFIER) 1998 else: 1999 Page.Cursor = wx.Cursor(wx.CURSOR_CROSS) 2000 2003 2004 SetCursor(Page) 2001 2005 if event.button and G2frame.Contour and G2frame.TforYaxis: 2002 2006 ytics = imgAx.get_yticks() … … 2007 2011 if xpos is None: return #avoid out of frame mouse position 2008 2012 ypos = event.ydata 2009 Page.canvas.SetCursor(wx.CROSS_CURSOR)2010 2013 try: 2011 2014 Id = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters') … … 4212 4215 if xpos: #avoid out of frame mouse position 4213 4216 ypos = event.ydata 4214 Page.canvas.SetCursor(wx.CROSS_CURSOR)4217 SetCursor(Page) 4215 4218 try: 4216 4219 if G2frame.Contour: … … 4502 4505 if xpos: #avoid out of frame mouse position 4503 4506 ypos = event.ydata 4504 Page.canvas.SetCursor(wx.CROSS_CURSOR)4507 SetCursor(Page) 4505 4508 try: 4506 4509 G2frame.G2plotNB.status.SetStatusText('X =%9.3f %s =%9.3g'%(xpos,Title,ypos),1) … … 4626 4629 if xpos: #avoid out of frame mouse position 4627 4630 ypos = event.ydata 4628 Page.canvas.SetCursor(wx.CROSS_CURSOR)4631 SetCursor(Page) 4629 4632 try: 4630 4633 G2frame.G2plotNB.status.SetStatusText('X =%9.3f %s =%9.3f'%(xpos,Title,ypos),1) … … 4762 4765 Xwd = Xmax-Xmin 4763 4766 Ywd = Ymax-Ymin 4764 Page.canvas.SetCursor(wx.CROSS_CURSOR)4767 SetCursor(Page) 4765 4768 ix = int(Nxy[0]*(xpos-Xmin)/Xwd) 4766 4769 iy = int(Nxy[1]*(ypos-Ymin)/Ywd) … … 4842 4845 else: 4843 4846 resName = '' 4844 Page.canvas.SetCursor(wx.CROSS_CURSOR)4847 SetCursor(Page) 4845 4848 try: 4846 4849 if 0 <= xpos < len(resNames): … … 4900 4903 if xpos: #avoid out of frame mouse position 4901 4904 ypos = event.ydata 4902 Page.canvas.SetCursor(wx.CROSS_CURSOR)4905 SetCursor(Page) 4903 4906 try: 4904 4907 G2frame.G2plotNB.status.SetStatusText('d-spacing =%9.5f Azimuth =%9.3f'%(ypos,xpos),1) … … 4954 4957 if xpos: #avoid out of frame mouse position 4955 4958 ypos = event.ydata 4956 Page.canvas.SetCursor(wx.CROSS_CURSOR)4959 SetCursor(Page) 4957 4960 try: 4958 4961 G2frame.G2plotNB.status.SetStatusText('diameter =%9.3f f(D) =%9.3g'%(xpos,ypos),1) … … 4994 4997 xpos = event.xdata 4995 4998 if xpos: #avoid out of frame mouse position 4996 Page.canvas.SetCursor(wx.CROSS_CURSOR)4999 SetCursor(Page) 4997 5000 G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f '%(xpos,),1) 4998 5001 if G2frame.PickId and G2frame.GPXtree.GetItemText(G2frame.PickId) in ['Index Peak List','Unit Cells List']: … … 5697 5700 ix = int(round(xpos*10)) 5698 5701 iy = int(round((Slab.shape[0]-1)*(ypos+0.5-Off*0.005))) 5699 Page.canvas.SetCursor(wx.CROSS_CURSOR)5702 SetCursor(Page) 5700 5703 try: 5701 5704 G2frame.G2plotNB.status.SetStatusText('t =%9.3f %s =%9.3f %s=%9.3f'%(xpos,GkDelta+Ax,ypos,Gkrho,Slab[iy,ix]/8.),1) … … 6359 6362 if event.xdata and event.ydata and len(G2frame.ImageZ): #avoid out of frame errors 6360 6363 Page.SetToolTipString('%8.2f %8.2fmm'%(event.xdata,event.ydata)) 6361 Page.canvas.SetCursor(wx.CROSS_CURSOR)6364 SetCursor(Page) 6362 6365 item = G2frame.itemPicked 6363 6366 pixelSize = Data['pixelSize'] … … 7313 7316 def OnMotion(event): 7314 7317 Page.SetToolTipString('') 7315 Page.canvas.SetCursor(wx.CROSS_CURSOR)7318 SetCursor(Page) 7316 7319 azm = event.ydata 7317 7320 tth = event.xdata … … 7368 7371 def OnMotion(event): 7369 7372 Page.SetToolTipString('') 7370 Page.canvas.SetCursor(wx.CROSS_CURSOR)7373 SetCursor(Page) 7371 7374 azm = event.xdata 7372 7375 tth = event.ydata
Note: See TracChangeset
for help on using the changeset viewer.