Changeset 1004 for trunk/GSASIIplot.py
- Timestamp:
- Jul 21, 2013 8:38:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r998 r1004 122 122 self.status.SetStatusWidths([150,-1]) 123 123 self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, self.OnPageChanged) 124 self.nb.Bind(wx.EVT_KEY_UP,self.OnNotebookKey) 124 125 125 126 self.plotList = [] 126 127 128 def OnNotebookKey(self,event): 129 '''Called when a keystroke event gets picked up by the notebook window 130 rather the child. This is not expected, but somehow it does sometimes 131 on the Mac and perhaps Linux. 132 133 Assume that the page associated with the currently displayed tab 134 has a child, .canvas; give that child the focus and pass it the event. 135 ''' 136 Page = self.nb.GetPage(self.nb.GetSelection()) 137 try: 138 Page.canvas.SetFocus() 139 wx.PostEvent(Page.canvas,event) 140 except AttributeError: 141 pass 142 127 143 def addMpl(self,name=""): 128 144 'Add a tabbed page with a matplotlib plot' … … 1010 1026 cb.SetValue(' key press') 1011 1027 wx.CallAfter(OnPlotKeyPress,event) 1028 try: 1029 Page.canvas.SetFocus() # redirect the Focus from the button back to the plot 1030 except: 1031 pass 1032 1012 1033 1013 1034 def OnMotion(event): … … 2127 2148 if event.key in 'l': 2128 2149 wx.CallAfter(OnImPlotKeyPress,event) 2150 try: 2151 Page.canvas.SetFocus() # redirect the Focus from the button back to the plot 2152 except: 2153 pass 2129 2154 2130 2155 def OnImPick(event): … … 2725 2750 cb.SetValue(' save as/key:') 2726 2751 wx.CallAfter(OnKey,event) 2752 try: 2753 Page.canvas.SetFocus() # redirect the Focus from the button back to the plot 2754 except: 2755 pass 2727 2756 2728 2757 def OnKey(event): #on key UP!!
Note: See TracChangeset
for help on using the changeset viewer.