Use GetKeyCode() instead of KeyCode()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2006-09-08 20:09:27 +00:00
parent 2f72b58ae6
commit a3cee65ed4
15 changed files with 22 additions and 19 deletions

View File

@ -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)

View File

@ -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

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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,

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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

View File

@ -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')):

View File

@ -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."""

View File

@ -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()

View File

@ -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()