From a3cee65ed41394fdcb13cd485fbe0acafb8a490b Mon Sep 17 00:00:00 2001
From: Robin Dunn <robin@alldunn.com>
Date: Fri, 8 Sep 2006 20:09:27 +0000
Subject: [PATCH] Use GetKeyCode() instead of KeyCode()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 wxPython/demo/ActiveX_IEHtmlWindow.py | 2 +-
 wxPython/demo/GridEnterHandler.py     | 2 +-
 wxPython/demo/StyledTextCtrl_2.py     | 2 +-
 wxPython/demo/Validator.py            | 2 +-
 wxPython/wx/lib/buttons.py            | 6 +++---
 wxPython/wx/lib/calendar.py           | 2 +-
 wxPython/wx/lib/editor/editor.py      | 2 +-
 wxPython/wx/lib/intctrl.py            | 2 +-
 wxPython/wx/lib/mvctree.py            | 4 ++--
 wxPython/wx/lib/pyshell.py            | 2 +-
 wxPython/wx/lib/shell.py              | 2 +-
 wxPython/wx/lib/vtk.py                | 2 +-
 wxPython/wx/py/PyShell.py             | 3 +++
 wxPython/wx/py/editor.py              | 4 ++--
 wxPython/wx/py/shell.py               | 4 ++--
 15 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/wxPython/demo/ActiveX_IEHtmlWindow.py b/wxPython/demo/ActiveX_IEHtmlWindow.py
index c1356e4deb..bd4749db92 100644
--- a/wxPython/demo/ActiveX_IEHtmlWindow.py
+++ b/wxPython/demo/ActiveX_IEHtmlWindow.py
@@ -105,7 +105,7 @@ class TestPanel(wx.Panel):
         self.ie.Navigate(url)
 
     def OnLocationKey(self, evt):
-        if evt.KeyCode() == wx.WXK_RETURN:
+        if evt.GetKeyCode() == wx.WXK_RETURN:
             URL = self.location.GetValue()
             self.location.Append(URL)
             self.ie.Navigate(URL)
diff --git a/wxPython/demo/GridEnterHandler.py b/wxPython/demo/GridEnterHandler.py
index bdcd8ccb7d..638eac61b5 100644
--- a/wxPython/demo/GridEnterHandler.py
+++ b/wxPython/demo/GridEnterHandler.py
@@ -20,7 +20,7 @@ class NewEnterHandlingGrid(gridlib.Grid):
 
 
     def OnKeyDown(self, evt):
-        if evt.KeyCode() != wx.WXK_RETURN:
+        if evt.GetKeyCode() != wx.WXK_RETURN:
             evt.Skip()
             return
 
diff --git a/wxPython/demo/StyledTextCtrl_2.py b/wxPython/demo/StyledTextCtrl_2.py
index e84bee509b..2c043c9155 100644
--- a/wxPython/demo/StyledTextCtrl_2.py
+++ b/wxPython/demo/StyledTextCtrl_2.py
@@ -185,7 +185,7 @@ class PythonSTC(stc.StyledTextCtrl):
     def OnKeyPressed(self, event):
         if self.CallTipActive():
             self.CallTipCancel()
-        key = event.KeyCode()
+        key = event.GetKeyCode()
 
         if key == 32 and event.ControlDown():
             pos = self.GetCurrentPos()
diff --git a/wxPython/demo/Validator.py b/wxPython/demo/Validator.py
index 31dd044967..0b83c95595 100644
--- a/wxPython/demo/Validator.py
+++ b/wxPython/demo/Validator.py
@@ -34,7 +34,7 @@ class MyValidator(wx.PyValidator):
 
 
     def OnChar(self, event):
-        key = event.KeyCode()
+        key = event.GetKeyCode()
 
         if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255:
             event.Skip()
diff --git a/wxPython/wx/lib/buttons.py b/wxPython/wx/lib/buttons.py
index ea8fea98b5..11c3e77860 100644
--- a/wxPython/wx/lib/buttons.py
+++ b/wxPython/wx/lib/buttons.py
@@ -347,14 +347,14 @@ class GenButton(wx.PyControl):
 
 
     def OnKeyDown(self, event):
-        if self.hasFocus and event.KeyCode() == ord(" "):
+        if self.hasFocus and event.GetKeyCode() == ord(" "):
             self.up = False
             self.Refresh()
         event.Skip()
 
 
     def OnKeyUp(self, event):
-        if self.hasFocus and event.KeyCode() == ord(" "):
+        if self.hasFocus and event.GetKeyCode() == ord(" "):
             self.up = True
             self.Notify()
             self.Refresh()
@@ -551,7 +551,7 @@ class __ToggleMixin:
         event.Skip()
 
     def OnKeyUp(self, event):
-        if self.hasFocus and event.KeyCode() == ord(" "):
+        if self.hasFocus and event.GetKeyCode() == ord(" "):
             self.up = not self.up
             self.Notify()
             self.Refresh()
diff --git a/wxPython/wx/lib/calendar.py b/wxPython/wx/lib/calendar.py
index 78071e666b..d65973c411 100644
--- a/wxPython/wx/lib/calendar.py
+++ b/wxPython/wx/lib/calendar.py
@@ -771,7 +771,7 @@ class Calendar( wx.PyControl ):
             event.Skip()
             return
         
-        key_code = event.KeyCode()
+        key_code = event.GetKeyCode()
         
         if key_code == wx.WXK_TAB:
             forward = not event.ShiftDown()
diff --git a/wxPython/wx/lib/editor/editor.py b/wxPython/wx/lib/editor/editor.py
index 943e42dd27..d94a8cd8c5 100644
--- a/wxPython/wx/lib/editor/editor.py
+++ b/wxPython/wx/lib/editor/editor.py
@@ -942,7 +942,7 @@ class Editor(wx.ScrolledWindow):
         self.AdjustScrollbars()
 
     def OnChar(self, event):
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         filters = [self.AltKey,
                    self.MoveSpecialControlKey,
                    self.ControlKey,
diff --git a/wxPython/wx/lib/intctrl.py b/wxPython/wx/lib/intctrl.py
index 65ff2e58fa..897045a506 100644
--- a/wxPython/wx/lib/intctrl.py
+++ b/wxPython/wx/lib/intctrl.py
@@ -109,7 +109,7 @@ class IntValidator( wx.PyValidator ):
         selected.  Leading zeros are removed if introduced by selection,
         and are prevented from being inserted.
         """
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         ctrl = event.GetEventObject()
 
 
diff --git a/wxPython/wx/lib/mvctree.py b/wxPython/wx/lib/mvctree.py
index dd84720c36..eb49ea03de 100644
--- a/wxPython/wx/lib/mvctree.py
+++ b/wxPython/wx/lib/mvctree.py
@@ -404,9 +404,9 @@ class FileEditor(Editor):
 
 
     def _key(self, evt):
-        if evt.KeyCode() == wx.WXK_RETURN:
+        if evt.GetKeyCode() == wx.WXK_RETURN:
             self.EndEdit(True)
-        elif evt.KeyCode() == wx.WXK_ESCAPE:
+        elif evt.GetKeyCode() == wx.WXK_ESCAPE:
             self.EndEdit(False)
         else:
             evt.Skip()
diff --git a/wxPython/wx/lib/pyshell.py b/wxPython/wx/lib/pyshell.py
index 86d127a77f..1dca90da9e 100644
--- a/wxPython/wx/lib/pyshell.py
+++ b/wxPython/wx/lib/pyshell.py
@@ -216,7 +216,7 @@ class PyShellWindow(stc.StyledTextCtrl, InteractiveInterpreter):
 
 
     def OnKey(self, evt):
-        key = evt.KeyCode()
+        key = evt.GetKeyCode()
         if key == wx.WXK_RETURN:
             pos = self.GetCurrentPos()
             lastPos = self.GetTextLength()
diff --git a/wxPython/wx/lib/shell.py b/wxPython/wx/lib/shell.py
index 428a2cbbef..0f78ac3ed5 100644
--- a/wxPython/wx/lib/shell.py
+++ b/wxPython/wx/lib/shell.py
@@ -109,7 +109,7 @@ class PyShellInput(wx.Panel):
     def OnChar(self, event):
         """called on CHARevent.  executes input on newline"""
         # print "On Char:", event.__dict__.keys()
-        if event.KeyCode() !=wx.WXK_RETURN:
+        if event.GetKeyCode() !=wx.WXK_RETURN:
             # not of our business
             event.Skip()
             return
diff --git a/wxPython/wx/lib/vtk.py b/wxPython/wx/lib/vtk.py
index 676932d215..c726fade6c 100644
--- a/wxPython/wx/lib/vtk.py
+++ b/wxPython/wx/lib/vtk.py
@@ -318,7 +318,7 @@ class wxVTKRenderWindow(wxVTKRenderWindowBase):
 
 
     def OnChar(self, event):
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         if (key == ord('r')) or (key == ord('R')):
             self.Reset()
         elif (key == ord('w')) or (key == ord('W')):
diff --git a/wxPython/wx/py/PyShell.py b/wxPython/wx/py/PyShell.py
index 2af5143ecd..299cc4f538 100644
--- a/wxPython/wx/py/PyShell.py
+++ b/wxPython/wx/py/PyShell.py
@@ -12,6 +12,9 @@ __cvsid__ = "$Id$"
 __revision__ = "$Revision$"[11:-2]
 
 import wx
+import os
+print "PID:", os.getpid()
+raw_input("...")
 
 class App(wx.App):
     """PyShell standalone application."""
diff --git a/wxPython/wx/py/editor.py b/wxPython/wx/py/editor.py
index 1271d8760d..b21c691193 100644
--- a/wxPython/wx/py/editor.py
+++ b/wxPython/wx/py/editor.py
@@ -643,7 +643,7 @@ class Editor:
         Only receives an event if OnKeyDown calls event.Skip() for the
         corresponding event."""
 
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         if key in self.autoCompleteKeys:
             # Usually the dot (period) key activates auto completion.
             if self.window.AutoCompActive(): 
@@ -671,7 +671,7 @@ class Editor:
     def OnKeyDown(self, event):
         """Key down event handler."""
 
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         # If the auto-complete window is up let it do its thing.
         if self.window.AutoCompActive():
             event.Skip()
diff --git a/wxPython/wx/py/shell.py b/wxPython/wx/py/shell.py
index c86ced152d..fe60b38221 100644
--- a/wxPython/wx/py/shell.py
+++ b/wxPython/wx/py/shell.py
@@ -417,7 +417,7 @@ Platform: %s""" % \
         # commands/responses.
         if not self.CanEdit():
             return
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         currpos = self.GetCurrentPos()
         stoppos = self.promptPosEnd
         # Return (Enter) needs to be ignored in this handler.
@@ -452,7 +452,7 @@ Platform: %s""" % \
     def OnKeyDown(self, event):
         """Key down event handler."""
 
-        key = event.KeyCode()
+        key = event.GetKeyCode()
         # If the auto-complete window is up let it do its thing.
         if self.AutoCompActive():
             event.Skip()
-- 
2.47.2