Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement