]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxTextCtrl.py
Replaced comparisons with zero, with IsOk()
[wxWidgets.git] / wxPython / demo / wxTextCtrl.py
index 98f0a25a664fcc64477a132571ad9ab9ea5e186d..8936d34de491f1e46baade6e388927941abc8182 100644 (file)
@@ -12,13 +12,16 @@ class TestPanel(wxPanel):
         t = wxTextCtrl(self, 10, "Test it out and see", wxPoint(80, 25), wxSize(150, 20))
         t.SetInsertionPoint(0)
         EVT_TEXT(self, 10, self.EvtText)
+        EVT_CHAR(t, self.EvtChar)
+
 
         wxStaticText(self, -1, "Passsword", wxPoint(5, 50), wxSize(75, 20))
         wxTextCtrl(self, 20, "", wxPoint(80, 50), wxSize(150, 20), wxTE_PASSWORD)
         EVT_TEXT(self, 20, self.EvtText)
 
         wxStaticText(self, -1, "Multi-line", wxPoint(5, 75), wxSize(75, 20))
-        t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
+        t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control",
+                       wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
         t.SetInsertionPoint(0)
         EVT_TEXT(self, 30, self.EvtText)
 
@@ -26,6 +29,10 @@ class TestPanel(wxPanel):
         self.log.WriteText('EvtText: %s\n' % event.GetString())
 
 
+    def EvtChar(self, event):
+        self.log.WriteText('EvtChar: %d\n' % event.GetKeyCode())
+        event.Skip()
+
 
 #---------------------------------------------------------------------------