aded mainpage

This commit is contained in:
danamir
2018-03-08 18:59:38 +03:00
parent dab108946a
commit 325e8451f9
3 changed files with 15 additions and 47 deletions

2
.gitignore vendored
View File

@@ -1,2 +1,2 @@
venv venv1
.idea .idea

View File

@@ -1,45 +0,0 @@
import wx
class MainWindow(wx.Frame):
def __init__(self, *args, **kwds):
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.SetSize((300, 200))
self.layout()
def layout(self):
sizer_hor = wx.BoxSizer(wx.HORIZONTAL)
sizer_vert_1 = wx.BoxSizer(wx.VERTICAL)
sizer_vert_2 = wx.BoxSizer(wx.VERTICAL)
sizer_vert_3 = wx.BoxSizer(wx.VERTICAL)
sizer_hor.Add(sizer_vert_1)
sizer_hor.Add(sizer_vert_2)
sizer_hor.Add(sizer_vert_3)
lgn_label = wx.StaticText(self, wx.NewId(), "Login")
pswd_label = wx.StaticText(self, wx.NewId(), "Password")
lgn_text = wx.TextCtrl(self, wx.NewId())
pswd_text = wx.TextCtrl(self, wx.NewId())
next_btn = wx.Button(self, wx.NewId(), "Далее")
sizer_vert_1.Add(lgn_label, flag=wx.ALL)
sizer_vert_1.AddSpacer(10)
sizer_vert_1.Add(pswd_label, flag=wx.ALL)
sizer_vert_2.Add(lgn_text)
sizer_vert_2.Add(pswd_text)
sizer_vert_3.Add(next_btn, flag=wx.ALIGN_RIGHT)
self.SetSizer(sizer_hor)
self.layout()
if __name__ == "__main__":
app = wx.App(0)
wx.InitAllImageHandlers()
mainWnd = MainWindow(None, -1, "")
app.SetTopWindow(mainWnd)
mainWnd.Show()
app.MainLoop()

15
main.py
View File

@@ -1,6 +1,19 @@
from gui import mainpage
import wx import wx
class Page1(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)
sizer_all = wx.BoxSizer(wx.HORIZONTAL)
app = wx.App(False)
frame = wx.Frame(None)
panel =Page1(frame)
frame.Show()
app.MainLoop()