[Nvda-dev] commit r1955 - in trunk: . source

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r1955 - in trunk: . source

NVDA Subversion
Author: jteh
Date: Thu Apr 24 00:13:30 2008
New Revision: 1955

Log:
pythonConsole: Set focus to the input control whenever the console window becomes the foreground window.

Modified:
   trunk/   (props changed)
   trunk/source/pythonConsole.py

Modified: trunk/source/pythonConsole.py
==============================================================================
--- trunk/source/pythonConsole.py (original)
+++ trunk/source/pythonConsole.py Thu Apr 24 00:13:30 2008
@@ -59,6 +59,7 @@
 
  def __init__(self):
  super(ConsoleUI, self).__init__(None, wx.ID_ANY, _("NVDA Python Console"))
+ self.Bind(wx.EVT_ACTIVATE, self.onActivate)
  self.Bind(wx.EVT_CLOSE, self.onClose)
  mainSizer = wx.BoxSizer(wx.VERTICAL)
  self.outputCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(500, 500), style=wx.TE_MULTILINE | wx.TE_READONLY)
@@ -81,7 +82,10 @@
  self.inputHistory = []
  self.inputHistoryPos = 0
 
- self.inputCtrl.SetFocus()
+ def onActivate(self, evt):
+ if evt.GetActive():
+ self.inputCtrl.SetFocus()
+ evt.Skip()
 
  def onClose(self, evt):
  self.Hide()