Вторая страница автоматически в поноэкранном размере
Добавлена возможность подстроения изобнражения, пока не реализовано
This commit is contained in:
32
validators.py
Normal file
32
validators.py
Normal file
@@ -0,0 +1,32 @@
|
||||
import wx
|
||||
import string
|
||||
|
||||
class DataValidator(wx.PyValidator):
|
||||
def __init__(self):
|
||||
wx.PyValidator.__init__(self)
|
||||
self.flag = flag
|
||||
self.Bind(wx.EVT_CHAR, self.OnChar)
|
||||
|
||||
def clone(self):
|
||||
return DataValidator()
|
||||
|
||||
def validate(self):
|
||||
return True
|
||||
|
||||
def TransferToWindow(self):
|
||||
return True
|
||||
|
||||
def TransferFromWindow(self):
|
||||
return True
|
||||
|
||||
def OnChar(self, event):
|
||||
keycode = int(event.GetKeyCode())
|
||||
if keycode < 256:
|
||||
#print keycode
|
||||
key = chr(keycode)
|
||||
#print key
|
||||
if self.flag == 'no-alpha' and key in string.ascii_letters:
|
||||
return
|
||||
if self.flag == 'no-digit' and key in string.digits:
|
||||
return
|
||||
event.Skip()
|
||||
Reference in New Issue
Block a user