class MaxIntText(wt.CTextValidator):
def __init__(self, parent, aMaxInt, *args, **kwargs):
self.mMaxInt = aMaxInt
wt.CTextValidator.__init__(self, parent, *args, **kwargs)
def onChange(self, event):
tValue = self.GetValue()
if tValue.isdigit():
if int(tValue) > self.mMaxInt:
self.dontAllow()
elif tValue != \'\':
self.dontAllow()