]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/Validator.py
non-PCH build fix (according to Tinderbox).
[wxWidgets.git] / wxPython / demo / Validator.py
index 7215e07f189c525f227d4d49943e359e612d94d2..0b83c95595ca323423c8afdd519bc567b8b0712c 100644 (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()
@@ -188,11 +188,12 @@ class TestValidateDialog(wx.Dialog):
         fgs.Add(wx.TextCtrl(self, -1, "", validator = TextObjectValidator()))
 
 
-        buttons = wx.BoxSizer(wx.HORIZONTAL)
-        b = wx.Button(self, wx.ID_OK, "Okay")
+        buttons = wx.StdDialogButtonSizer() #wx.BoxSizer(wx.HORIZONTAL)
+        b = wx.Button(self, wx.ID_OK, "OK")
         b.SetDefault()
-        buttons.Add(b, 0, wx.ALL, 10)
-        buttons.Add(wx.Button(self, wx.ID_CANCEL, "Cancel"), 0, wx.ALL, 10)
+        buttons.AddButton(b)
+        buttons.AddButton(wx.Button(self, wx.ID_CANCEL, "Cancel"))
+        buttons.Realize()
 
         border = wx.BoxSizer(wx.VERTICAL)
         border.Add(fgs, 1, wx.GROW|wx.ALL, 25)
@@ -235,5 +236,5 @@ between a class of control, and application data.
 if __name__ == '__main__':
     import sys,os
     import run
-    run.main(['', os.path.basename(sys.argv[0])])
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])