Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TextValidator(wx.TextCtrl):
- def __init__(self, parent, *args, **kwargs):
- wx.TextCtrl.__init__(self, parent, *args, **kwargs)
- self.mCurValue = ''
- self.Bind(wx.EVT_CHAR, self.onChar)
- self.Bind(wx.EVT_TEXT, self.onChange)
- def dontAllow(self):
- self.SetValue(self.mCurValue)
- def onChar(self, event):
- self.mCurValue = self.GetValue()
- event.Skip()
- def onChange(self, event):
- '''
- override with validator
- '''
- pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement