projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't really enable the window when its parent is disabled, just remember to do it...
[wxWidgets.git]
/
wxPython
/
demo
/
Validator.py
diff --git
a/wxPython/demo/Validator.py
b/wxPython/demo/Validator.py
index b31b56b8f3d97b7f91d01cf21f6b48dc3aeebae6..0b83c95595ca323423c8afdd519bc567b8b0712c 100644
(file)
--- a/
wxPython/demo/Validator.py
+++ b/
wxPython/demo/Validator.py
@@
-1,12
+1,7
@@
-# 11/22/2003 - Jeff Grimmett (grimmtooth@softhome.net)
-#
-# o Updated for wx namespace
-#
import string
import wx
import string
import wx
-
#----------------------------------------------------------------------
ALPHA_ONLY = 1
#----------------------------------------------------------------------
ALPHA_ONLY = 1
@@
-39,7
+34,7
@@
class MyValidator(wx.PyValidator):
def OnChar(self, event):
def OnChar(self, event):
- key = event.KeyCode()
+ key = event.
Get
KeyCode()
if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255:
event.Skip()
if key < wx.WXK_SPACE or key == wx.WXK_DELETE or key > 255:
event.Skip()
@@
-193,11
+188,12
@@
class TestValidateDialog(wx.Dialog):
fgs.Add(wx.TextCtrl(self, -1, "", validator = TextObjectValidator()))
fgs.Add(wx.TextCtrl(self, -1, "", validator = TextObjectValidator()))
- buttons = wx.BoxSizer(wx.HORIZONTAL)
- b = wx.Button(self, wx.ID_OK, "O
kay
")
+ buttons = wx.
StdDialogButtonSizer() #wx.
BoxSizer(wx.HORIZONTAL)
+ b = wx.Button(self, wx.ID_OK, "O
K
")
b.SetDefault()
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)
border = wx.BoxSizer(wx.VERTICAL)
border.Add(fgs, 1, wx.GROW|wx.ALL, 25)
@@
-220,7
+216,7
@@
def runTest(frame, nb, log):
overview = """\
<html>
<body>
overview = """\
<html>
<body>
-wxValidator is the base class for a family of validator classes that mediate
+wx
.
Validator is the base class for a family of validator classes that mediate
between a class of control, and application data.
<p>A validator has three major roles:
between a class of control, and application data.
<p>A validator has three major roles:
@@
-240,5
+236,5
@@
between a class of control, and application data.
if __name__ == '__main__':
import sys,os
import run
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:]
)