예제 #1
0
파일: Frames.py 프로젝트: SupermeReturns/AP
class MainFrame(wx.Frame):
    """MainFrame 是所有的控件的父亲,负责初始化各种窗口"""
    def __init__(self):
        wx.Frame.__init__(self, None, -1, "Account Protector", size = (400, 600))
        self.manager = Manager()
        self.load_UI()

    def load_UI(self):
        """加载窗口组件"""
        #创建底部状态栏,显示当前操作信息
        self.bkg = wx.Panel(self, size=(400, 600))
        self.CreateStatusBar()
        menuBar = wx.MenuBar()
        menu = wx.Menu()

        #创建顶部菜单栏
        item = menu.Append(-1, "&Widget Inspector\tF6", "Show the wxPython Widget Inspection Tool")
        item = menu.Append(-1, "E&xit\tCtrl-Q", "Exit demo")
        menuBar.Append(menu, "&File")
        self.SetMenuBar(menuBar)

        self.button_quit = wx.Button(self.bkg, label="quit")
        self.notebook = Mod_Notebook(self.bkg, self.manager)

        #create layout
        hsizer = wx.BoxSizer(wx.HORIZONTAL)
        hsizer.Add(self.button_quit)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.notebook,1,wx.EXPAND)
        sizer.Add(hsizer, 0)
        self.bkg.SetSizer(sizer)
        #绑定事件
        self.button_quit.Bind(wx.EVT_BUTTON, self.OnQuit)
        self.Bind(wx.EVT_CLOSE, self.OnQuit)

    def OnQuit(self, event):
        self.manager.save_file()
        self.Close()
예제 #2
0
파일: Frames.py 프로젝트: SupermeReturns/AP
 def __init__(self):
     wx.Frame.__init__(self, None, -1, "Account Protector", size = (400, 600))
     self.manager = Manager()
     self.load_UI()