]> git.saurik.com Git - wxWidgets.git/commitdiff
some tests
authorRobin Dunn <robin@alldunn.com>
Sat, 11 Mar 2000 07:32:25 +0000 (07:32 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 11 Mar 2000 07:32:25 +0000 (07:32 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

utils/wxPython/tests/.cvsignore
utils/wxPython/tests/hook.py [new file with mode: 0644]

index 257bb953d0e8d967a0a65bfccb511ae95ced5ba3..95e09fc86a2461f9db5ea1422ebe5f7bb22abc97 100644 (file)
@@ -1,4 +1,5 @@
 hh_test.py
+hook.pyc
 listGetItem.pyc
 setup.bat
 ste.pyc
diff --git a/utils/wxPython/tests/hook.py b/utils/wxPython/tests/hook.py
new file mode 100644 (file)
index 0000000..990e9ba
--- /dev/null
@@ -0,0 +1,45 @@
+from wxPython.wx import *
+
+class MyFrame(wxFrame):
+    def __init__(self, parent, id, title):
+        wxFrame.__init__(self, parent, id, title,
+                         wxDefaultPosition, wxSize(400, 400))
+        self.panel = wxPanel(self, -1)
+        wxStaticText(self.panel, -1, "wxTextCtrl", wxPoint(5, 25),
+                     wxSize(75, 20))
+        self.tc = wxTextCtrl(self.panel, 10, "", wxPoint(80, 25),
+                             wxSize(200, 30))
+        EVT_CHAR_HOOK(self, self.OnCharHook)
+        #EVT_CHAR_HOOK(self.tc, self.OnCharHook)
+        EVT_CHAR(self, self.OnChar)
+        self.panel.Layout()
+        return
+
+    def OnCloseWindow(self, event):
+        self.Destroy()
+        return
+
+    def OnChar(self, event):
+        print "OnChar: %d '%c'" % (event.KeyCode(), chr(event.KeyCode()))
+        event.Skip()
+        return
+
+    def OnCharHook(self, event):
+        print "OnCharHook: %d" % event.KeyCode()
+        event.Skip()
+        return
+
+
+class MyApp(wxApp):
+    def OnInit(self):
+        frame = MyFrame(None, -1, 'CharHook Test')
+        frame.Show(1)
+        self.SetTopWindow(frame)
+        return 1
+
+
+app = MyApp(0)
+app.MainLoop()
+
+
+