From 21b020b5435339a9519963d7c79adc8b8cb17c9b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sun, 12 Nov 2000 00:07:56 +0000 Subject: [PATCH] some cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8726 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/tests/gridtest.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wxPython/tests/gridtest.py b/wxPython/tests/gridtest.py index b6549d3757..c4988db150 100644 --- a/wxPython/tests/gridtest.py +++ b/wxPython/tests/gridtest.py @@ -83,9 +83,8 @@ class MyCellEditor(wxPyGridCellEditor): """ key = evt.GetKeyCode() print "KeyCode:", key - # For linux the first range means number keys in main keyboard, and - # the second range means numeric keypad keys, with num-lock on. - if key in range(48,58) or key in range(326,336): + if (key in range(ord('0'),ord('9')+1) or + key in range(WXK_NUMPAD0, WXK_NUMPAD9+1)): return true else: return false @@ -99,8 +98,7 @@ class MyCellEditor(wxPyGridCellEditor): key = evt.GetKeyCode() print "StartingKey", key ch = None - if key in [WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4, - WXK_NUMPAD5, WXK_NUMPAD6, WXK_NUMPAD7, WXK_NUMPAD8, WXK_NUMPAD9]: + if key in range(WXK_NUMPAD0, WXK_NUMPAD9+1): ch = ch = chr(ord('0') + key - WXK_NUMPAD0) elif key < 256 and key >= 0 and chr(key) in string.printable: -- 2.45.2