document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. class TextValidator(wx.TextCtrl):
  2.     def __init__(self, parent, *args, **kwargs):
  3.         wx.TextCtrl.__init__(self, parent, *args, **kwargs)
  4.        
  5.         self.mCurValue = \'\'
  6.    
  7.         self.Bind(wx.EVT_CHAR, self.onChar)
  8.         self.Bind(wx.EVT_TEXT, self.onChange)
  9.    
  10.     def dontAllow(self):
  11.         self.SetValue(self.mCurValue)
  12.    
  13.     def onChar(self, event):
  14.         self.mCurValue = self.GetValue()
  15.         event.Skip()
  16.    
  17.     def onChange(self, event):
  18.         \'\'\'
  19.        override with validator
  20.        \'\'\'
  21.         pass
');