Реорганизована структура проекта.
Лабораторные работы вынесены в отдельные папки
This commit is contained in:
@@ -43,8 +43,8 @@ class SecondPage(wx.Frame):
|
|||||||
|
|
||||||
# Virtual event handlers, overide them in your derived class
|
# Virtual event handlers, overide them in your derived class
|
||||||
def lab1(self, event):
|
def lab1(self, event):
|
||||||
from gui import third_page
|
from lab1 import lab1
|
||||||
nex_page = third_page.MainFrame()
|
nex_page = lab1.MainFrame()
|
||||||
nex_page.Show()
|
nex_page.Show()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,52 +0,0 @@
|
|||||||
import wx
|
|
||||||
|
|
||||||
|
|
||||||
# Some classes to use for the notebook pages. Obviously you would
|
|
||||||
# want to use something more meaningful for your application, these
|
|
||||||
# are just for illustration.
|
|
||||||
|
|
||||||
class PageOne(wx.Panel):
|
|
||||||
def __init__(self, parent):
|
|
||||||
wx.Panel.__init__(self, parent)
|
|
||||||
t = wx.StaticText(self, -1, "This is a PageOne object", (20,20))
|
|
||||||
|
|
||||||
class PageTwo(wx.Panel):
|
|
||||||
def __init__(self, parent):
|
|
||||||
wx.Panel.__init__(self, parent)
|
|
||||||
t = wx.StaticText(self, -1, "This is a PageTwo object", (40,40))
|
|
||||||
|
|
||||||
class PageThree(wx.Panel):
|
|
||||||
def __init__(self, parent):
|
|
||||||
wx.Panel.__init__(self, parent)
|
|
||||||
t = wx.StaticText(self, -1, "This is a PageThree object", (60,60))
|
|
||||||
|
|
||||||
|
|
||||||
class MainFrame(wx.Frame):
|
|
||||||
def __init__(self):
|
|
||||||
wx.Frame.__init__(self, None, title="Simple Notebook Example")
|
|
||||||
|
|
||||||
# Here we create a panel and a notebook on the panel
|
|
||||||
p = wx.Panel(self)
|
|
||||||
nb = wx.Notebook(p)
|
|
||||||
|
|
||||||
# create the page windows as children of the notebook
|
|
||||||
page1 = PageOne(nb)
|
|
||||||
page2 = PageTwo(nb)
|
|
||||||
page3 = PageThree(nb)
|
|
||||||
|
|
||||||
# add the pages to the notebook with the label to show on the tab
|
|
||||||
nb.AddPage(page1, "Page 1")
|
|
||||||
nb.AddPage(page2, "Page 2")
|
|
||||||
nb.AddPage(page3, "Page 3")
|
|
||||||
|
|
||||||
# finally, put the notebook in a sizer for the panel to manage
|
|
||||||
# the layout
|
|
||||||
sizer = wx.BoxSizer()
|
|
||||||
sizer.Add(nb, 1, wx.EXPAND)
|
|
||||||
p.SetSizer(sizer)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
app = wx.App()
|
|
||||||
MainFrame().Show()
|
|
||||||
app.MainLoop()
|
|
||||||
@@ -1,24 +1,18 @@
|
|||||||
import wx
|
import wx
|
||||||
|
|
||||||
|
class Ttheory(wx.Panel):
|
||||||
# Some classes to use for the notebook pages. Obviously you would
|
|
||||||
# want to use something more meaningful for your application, these
|
|
||||||
# are just for illustration.
|
|
||||||
|
|
||||||
class PageOne(wx.Panel):
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
wx.Panel.__init__(self, parent)
|
wx.Panel.__init__(self, parent)
|
||||||
t = wx.StaticText(self, -1, "This is a PageOne object", (20,20))
|
|
||||||
|
|
||||||
class PageTwo(wx.Panel):
|
|
||||||
|
class Labs(wx.Panel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
wx.Panel.__init__(self, parent)
|
wx.Panel.__init__(self, parent)
|
||||||
t = wx.StaticText(self, -1, "This is a PageTwo object", (40,40))
|
|
||||||
|
|
||||||
class PageThree(wx.Panel):
|
class Results(wx.Panel):
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
wx.Panel.__init__(self, parent)
|
wx.Panel.__init__(self, parent)
|
||||||
t = wx.StaticText(self, -1, "This is a PageThree object", (60,60))
|
|
||||||
|
|
||||||
|
|
||||||
class MainFrame(wx.Frame):
|
class MainFrame(wx.Frame):
|
||||||
@@ -30,14 +24,14 @@ class MainFrame(wx.Frame):
|
|||||||
nb = wx.Notebook(p)
|
nb = wx.Notebook(p)
|
||||||
|
|
||||||
# create the page windows as children of the notebook
|
# create the page windows as children of the notebook
|
||||||
page1 = PageOne(nb)
|
page1 = Ttheory(nb)
|
||||||
page2 = PageTwo(nb)
|
page2 = Labs(nb)
|
||||||
page3 = PageThree(nb)
|
page3 = Results(nb)
|
||||||
|
|
||||||
# add the pages to the notebook with the label to show on the tab
|
# add the pages to the notebook with the label to show on the tab
|
||||||
nb.AddPage(page1, "Page 1")
|
nb.AddPage(page1, "Теория")
|
||||||
nb.AddPage(page2, "Page 2")
|
nb.AddPage(page2, "Задание")
|
||||||
nb.AddPage(page3, "Page 3")
|
nb.AddPage(page3, "Отчёт")
|
||||||
|
|
||||||
# finally, put the notebook in a sizer for the panel to manage
|
# finally, put the notebook in a sizer for the panel to manage
|
||||||
# the layout
|
# the layout
|
||||||
Reference in New Issue
Block a user