from ..compat import string_type, unicode_type
from ..translations import translations
from .AWindow import AWindow
+from .ListBooks import ListBooksWindow
class ListAuthorsWindow(AWindow):
grid.SetCellValue(row, col, value)
grid.AutoSizeColumns()
grid.AutoSizeRows()
+
+ grid.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.OnDClick)
+ grid.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown)
+
+ def listBooks(self, row):
+ authors = self.search_authors_results['authors']
+ author = authors[row]
+ ListBooksWindow(self, author)
+
+ def OnDClick(self, event):
+ row = event.GetRow()
+ self.listBooks(row)
+
+ def OnKeyDown(self, event):
+ if event.GetKeyCode() in (wx.WXK_RETURN, wx.WXK_NUMPAD_ENTER):
+ row = self.grid.GetGridCursorRow()
+ self.listBooks(row)
+ else:
+ event.Skip()
--- /dev/null
+# coding: utf-8
+
+import wx
+from .AWindow import AWindow
+
+
+class ListBooksWindow(AWindow):
+
+ session_config_section_name = 'list_books'
+ window_title = u"m_Librarian: Список книг"
+
+ def __init__(self, parent, author):
+ self.author = author
+ AWindow.__init__(self, parent)