From 1259bc99c45fe8e0fc621bab7581576641f59a3a Mon Sep 17 00:00:00 2001 From: danamir Date: Sun, 25 Feb 2018 03:30:52 +0300 Subject: [PATCH 1/4] create .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82195aa --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv +.idea \ No newline at end of file From 5f11ca0b4f78f67c68a23188358d1798cf1e9315 Mon Sep 17 00:00:00 2001 From: danamir Date: Sun, 25 Feb 2018 03:45:40 +0300 Subject: [PATCH 2/4] create .gitignore --- gui/mainpage.py | 35 +++++++++++++++++++++++++++++++++++ main.py | 6 ++++++ 2 files changed, 41 insertions(+) create mode 100644 gui/mainpage.py create mode 100644 main.py diff --git a/gui/mainpage.py b/gui/mainpage.py new file mode 100644 index 0000000..fb68060 --- /dev/null +++ b/gui/mainpage.py @@ -0,0 +1,35 @@ +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.doLayout() + + def doLayout(self): + sizer_hor = wx.BoxSizer(wx.HORIZONTAL) + sizer_vert_1 = wx.BoxSizer(wx.VERTICAL) + sizer_vert_2 = wx.BoxSizer(wx.VERTICAL) + sizer_hor.Add(sizer_vert_1) + sizer_hor.Add(sizer_vert_2) + 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()) + 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) + self.SetSizer(sizer_hor) + self.Layout() + + +if __name__ == "__main__": + app = wx.PySimpleApp(0) + wx.InitAllImageHandlers() + mainWnd = MainWindow(None, -1, "") + app.SetTopWindow(mainWnd) + mainWnd.Show() + app.MainLoop() diff --git a/main.py b/main.py new file mode 100644 index 0000000..5a6347c --- /dev/null +++ b/main.py @@ -0,0 +1,6 @@ +from gui import mainpage +import wx + + + + From b5c79e8c10ca72dfa2f42e9d48ffeda0cdb45de8 Mon Sep 17 00:00:00 2001 From: danamir Date: Sun, 25 Feb 2018 15:23:18 +0300 Subject: [PATCH 3/4] create .gitignore --- gui/mainpage.py | 7 ++++++- gui/mainpage_gridbag.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 gui/mainpage_gridbag.py diff --git a/gui/mainpage.py b/gui/mainpage.py index fb68060..122b446 100644 --- a/gui/mainpage.py +++ b/gui/mainpage.py @@ -11,23 +11,28 @@ class MainWindow(wx.Frame): sizer_hor = wx.BoxSizer(wx.HORIZONTAL) sizer_vert_1 = wx.BoxSizer(wx.VERTICAL) sizer_vert_2 = wx.BoxSizer(wx.VERTICAL) + sizer_hor.Add(sizer_vert_1) sizer_hor.Add(sizer_vert_2) + 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()) + 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) + self.SetSizer(sizer_hor) self.Layout() if __name__ == "__main__": - app = wx.PySimpleApp(0) + app = wx.App(0) wx.InitAllImageHandlers() mainWnd = MainWindow(None, -1, "") app.SetTopWindow(mainWnd) diff --git a/gui/mainpage_gridbag.py b/gui/mainpage_gridbag.py new file mode 100644 index 0000000..6c23bc3 --- /dev/null +++ b/gui/mainpage_gridbag.py @@ -0,0 +1,35 @@ +import wx + +class MainPage(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 = wx.GridBagSizer() + count = 4 + + 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()) + + sizer.Add(lgn_label, pos=(0, 0)) + sizer.Add(pswd_label, pos=(0, 1)) + sizer.Add(lgn_text, pos=(1, 0)) + sizer.Add(pswd_text, pos=(1, 1)) + + self.SetSizer(sizer) + self.layout() + + + +if __name__ == "__main__": + app = wx.App(0) + wx.InitAllImageHandlers() + mainWnd = MainPage(None, -1, "") + app.SetTopWindow(mainWnd) + mainWnd.Show() + app.MainLoop() From dab108946a5ff4118647283e527979ba3e795272 Mon Sep 17 00:00:00 2001 From: danamir Date: Sun, 25 Feb 2018 20:09:12 +0300 Subject: [PATCH 4/4] create .gitignore --- gui/mainpage.py | 11 ++++++++--- gui/mainpage_gridbag.py | 35 ----------------------------------- 2 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 gui/mainpage_gridbag.py diff --git a/gui/mainpage.py b/gui/mainpage.py index 122b446..c605d6d 100644 --- a/gui/mainpage.py +++ b/gui/mainpage.py @@ -1,34 +1,39 @@ 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.doLayout() + self.layout() - def doLayout(self): + 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() + self.layout() if __name__ == "__main__": diff --git a/gui/mainpage_gridbag.py b/gui/mainpage_gridbag.py deleted file mode 100644 index 6c23bc3..0000000 --- a/gui/mainpage_gridbag.py +++ /dev/null @@ -1,35 +0,0 @@ -import wx - -class MainPage(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 = wx.GridBagSizer() - count = 4 - - 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()) - - sizer.Add(lgn_label, pos=(0, 0)) - sizer.Add(pswd_label, pos=(0, 1)) - sizer.Add(lgn_text, pos=(1, 0)) - sizer.Add(pswd_text, pos=(1, 1)) - - self.SetSizer(sizer) - self.layout() - - - -if __name__ == "__main__": - app = wx.App(0) - wx.InitAllImageHandlers() - mainWnd = MainPage(None, -1, "") - app.SetTopWindow(mainWnd) - mainWnd.Show() - app.MainLoop()