-# coding: utf-8
-
-import wx, wx.adv
-from ..__version__ import __version__
-from .session_config import get_session_config
-
-
-class MainWindow(wx.Frame):
-
- def InitMenu(self):
- MenuBar = wx.MenuBar()
- self.SetMenuBar(MenuBar)
-
- 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"&Файл")
-
- about_menu = wx.Menu()
- about = about_menu.Append(wx.ID_ABOUT,
- u"&О m_Librarian", u"О m_Librarian")
- self.Bind(wx.EVT_MENU, self.OnAbout, about)
- MenuBar.Append(about_menu, u"&О программе")
-
- self.Bind(wx.EVT_SIZE, self.OnSize)
-
- def OnQuit(self, event):
- self.Close(True)
-
- def OnAbout(self, event):
- aboutInfo = wx.adv.AboutDialogInfo()
- aboutInfo.SetName(u'm_Librarian')
- aboutInfo.SetVersion(__version__)
- aboutInfo.SetDescription(
- u'Библиотекарь для библиотек LibRusEc/Flibusta')
- aboutInfo.AddDeveloper(u'Олег Бройтман')
- aboutInfo.SetWebSite(u'https://phdru.name/Software/Python/m_librarian/')
- aboutInfo.SetCopyright(u'(C) 2023 Олег Бройтман')
- aboutInfo.SetLicense(u'GPL')
- wx.adv.AboutBox(aboutInfo)
-
- def OnSize(self, event):
- """Save window size in the session config"""
- size = event.GetSize()
- session_config = get_session_config()
- session_config.set('main_window', 'width', str(size.width))
- session_config.set('main_window', 'height', str(size.height))
- session_config.save()
- event.Skip() # Call other handlers
+import wx
+from .AWindow import AWindow
+from .SearchPanels import SearchAuthorsPanel, SearchBooksPanel
+
+
+class MainWindow(AWindow):
+
+ session_config_section_name = 'main_window'
+ window_title = u"m_Librarian"
+
+ def OnInit(self):
+ AWindow.OnInit(self)
+ vsizer = wx.BoxSizer(wx.VERTICAL)
+ self.SetSizer(vsizer)
+
+ 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)
+