From 2b5b6723290292241e7d21ff9851c85c33277f9e Mon Sep 17 00:00:00 2001 From: danamir Date: Wed, 2 May 2018 17:06:10 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A0=D0=B5=D0=BE=D1=80=D0=B3=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D1=82=D1=80=D1=83?= =?UTF-8?q?=D0=BA=D1=82=D1=80=D1=8B=20=D0=BE=D0=BA=D0=BD=D0=B0=20=D0=94?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0=20=D0=BD=D0=B0=20=D0=BE?= =?UTF-8?q?=D1=82=D1=83=D1=81=D1=82=D1=83=D1=82=D0=B2=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=83=D1=81=D1=82=D1=8B=D1=85=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=BF=D1=80=D0=BE=D0=B4=D0=BE=D0=BB?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=9F=D1=80=D0=B5=D0=B4=D1=8B?= =?UTF-8?q?=D0=B4=D1=83=D1=89=D0=B5=D0=B5=20=20=D0=BE=D0=BA=D0=BD=D0=BE=20?= =?UTF-8?q?=D1=82=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20=D0=BD=D0=B5=20=D0=B2?= =?UTF-8?q?=D0=B8=D0=B4=D0=BD=D0=BE=20=D0=BF=D1=80=D0=B8=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D0=BA=D0=B5=20=D1=81=D0=BB=D0=B5=D0=B4=D1=83?= =?UTF-8?q?=D1=8E=D1=89=D0=B5=D0=B3=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .python-version | 1 + main.py | 24 +++++++++--------------- validators.py | 32 -------------------------------- 3 files changed, 10 insertions(+), 47 deletions(-) create mode 100644 .python-version delete mode 100644 validators.py diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..7921bd0 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.4.8 diff --git a/main.py b/main.py index 06406e9..5d651d8 100644 --- a/main.py +++ b/main.py @@ -1,21 +1,6 @@ # -*- coding: utf-8 -*- import wx import wx.xrc -import sqlite3 - - - -class MainFrame(wx.Frame): - def __init__(self, parent): - wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, - size=wx.Size(500, 500), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) - - self.SetSizeHints(wx.DefaultSize, wx.DefaultSize) - - self.Centre(wx.BOTH) - - - class MainFramePanel(wx.Panel): def __init__(self, parent): @@ -109,6 +94,15 @@ class MainFramePanel(wx.Panel): page2.MyPanel5.run_page(self) +class MainFrame(wx.Frame): + def __init__(self, parent): + wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=wx.EmptyString, pos=wx.DefaultPosition, + size=wx.Size(500, 500), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) + + self.SetSizeHints(wx.DefaultSize, wx.DefaultSize) + + self.Centre(wx.BOTH) + app = wx.App() frame = MainFrame(None) diff --git a/validators.py b/validators.py deleted file mode 100644 index 299f465..0000000 --- a/validators.py +++ /dev/null @@ -1,32 +0,0 @@ -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() \ No newline at end of file