From: Oleg Broytman Date: Thu, 4 Jan 2024 16:16:04 +0000 (+0300) Subject: Feat(wx/search): Catch Enter and button clicks X-Git-Tag: 0.3.0~9^2~22 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=802497925f78ce64eb678573f62dbf8372afea5e;p=m_librarian.git Feat(wx/search): Catch Enter and button clicks [skip ci] --- 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