From 802497925f78ce64eb678573f62dbf8372afea5e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Thu, 4 Jan 2024 19:16:04 +0300 Subject: [PATCH] Feat(wx/search): Catch Enter and button clicks [skip ci] --- m_librarian/wx/SearchPanel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/m_librarian/wx/SearchPanel.py b/m_librarian/wx/SearchPanel.py index 6a14994..6a29ad7 100644 --- a/m_librarian/wx/SearchPanel.py +++ b/m_librarian/wx/SearchPanel.py @@ -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 -- 2.39.2