]> git.phdru.name Git - m_librarian.git/commitdiff
Feat(wx/search): Catch Enter and button clicks
authorOleg Broytman <phd@phdru.name>
Thu, 4 Jan 2024 16:16:04 +0000 (19:16 +0300)
committerOleg Broytman <phd@phdru.name>
Thu, 4 Jan 2024 16:16:04 +0000 (19:16 +0300)
[skip ci]

m_librarian/wx/SearchPanel.py

index 6a14994ba3da468bee0e06bc420aaa0cf1b98677..6a29ad76dbdc46a7e18bc5bca101a4d917dae9e4 100644 (file)
@@ -11,8 +11,10 @@ class SearchPanel(wx.Panel):
             wx.StaticBoxSizer(wx.VERTICAL, self, u'Поиск авторов')
         self.SetSizer(search_authors_vsizer)
 
-        self.search_authors = search_authors = wx.TextCtrl(self)
+        self.search_authors = search_authors = \
+            wx.TextCtrl(self, style=wx.TE_PROCESS_ENTER)
         search_authors_vsizer.Add(search_authors, 0, wx.EXPAND, 0)
+        search_authors.Bind(wx.EVT_TEXT_ENTER, self.SearchAuthors)
 
         self.search_substr = search_substr = wx.RadioBox(
             self,
@@ -32,3 +34,7 @@ class SearchPanel(wx.Panel):
         self.search_authors_button = search_authors_button = wx.Button(
             self, label=u'Искать авторов')
         search_authors_vsizer.Add(search_authors_button, 0, wx.ALIGN_CENTER, 0)
+        search_authors_button.Bind(wx.EVT_BUTTON, self.SearchAuthors)
+
+    def SearchAuthors(self, event):
+        pass