X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=m_librarian%2Fwx%2FApplication.py;h=d99edb667cb30d9c242f3286861e8b6dfff1061f;hb=4e322708bf5efdc6dce6cfa5afee26c47d914c5c;hp=35575c3880928b7d729b383fe1c3cc51c6fe1ec0;hpb=f3b5f514fff84ab8bcf3b2927ce926206294ec4f;p=m_librarian.git diff --git a/m_librarian/wx/Application.py b/m_librarian/wx/Application.py index 35575c3..d99edb6 100644 --- a/m_librarian/wx/Application.py +++ b/m_librarian/wx/Application.py @@ -1,28 +1,27 @@ -# coding: utf-8 - import wx +from .AWindow import AWindow +from .SearchPanels import SearchAuthorsPanel, SearchBooksPanel -class MainWindow(wx.Frame): +class MainWindow(AWindow): - def InitMenu(self): - MenuBar = wx.MenuBar() - self.SetMenuBar(MenuBar) + session_config_section_name = 'main_window' + window_title = u"m_Librarian" - file_menu = wx.Menu() - exit = file_menu.Append(wx.ID_EXIT, u"&Выход", u"Выйти из программы") - self.Bind(wx.EVT_MENU, self.OnQuit, exit) - MenuBar.Append(file_menu, u"&Файл") + def OnInit(self): + AWindow.OnInit(self) + vsizer = wx.BoxSizer(wx.VERTICAL) + self.SetSizer(vsizer) - def OnQuit(self, event): - self.Close(True) + search_authors_panel = SearchAuthorsPanel(self) + search_books_panel = SearchBooksPanel(self) + vsizer.Add(search_authors_panel, 0, wx.EXPAND, 0) + vsizer.Add(search_books_panel, 0, wx.EXPAND, 0) class Application(wx.App): def OnInit(self): - frame = MainWindow(None, -1, u"m_Librarian") - frame.InitMenu() - frame.Show(True) + frame = MainWindow() self.SetTopWindow(frame) return True