From: Oleg Broytman Date: Mon, 8 Jul 2024 13:31:07 +0000 (+0300) Subject: Feat(wx): Do not select when clicking on column/row labels X-Git-Tag: 0.4.0~5 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=1f38a5ee0f658c4272a66673a7e58dbd251a02cf;p=m_librarian.git Feat(wx): Do not select when clicking on column/row labels In list of authors and list of books. [skip ci] --- diff --git a/TODO b/TODO index 52fa997..5be94da 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,6 @@ Next release ------------ -(wx) List of authors, list of books - -do not select when clicking on column/row titles. - - (wx) List of authors - sort by clicking on column titles. diff --git a/m_librarian/wx/Grids.py b/m_librarian/wx/Grids.py index fe2f8d0..12a9e43 100644 --- a/m_librarian/wx/Grids.py +++ b/m_librarian/wx/Grids.py @@ -16,6 +16,8 @@ class GridPanel(wx.Panel): grid.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.OnDClick) grid.Bind(wx.EVT_KEY_DOWN, self.OnKeyDown) + grid.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.OnLabelClick) + grid.Bind(wx.grid.EVT_GRID_LABEL_RIGHT_CLICK, self.OnLabelClick) self.InitGrid() grid.SetFocus() @@ -41,6 +43,9 @@ class GridPanel(wx.Panel): def OnSetFocus(self, event): self.grid.SetFocus() + def OnLabelClick(self, event): + event.Veto() + class GridWindow(AWindow):