From 1f38a5ee0f658c4272a66673a7e58dbd251a02cf Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 8 Jul 2024 16:31:07 +0300 Subject: [PATCH] Feat(wx): Do not select when clicking on column/row labels In list of authors and list of books. [skip ci] --- TODO | 4 ---- m_librarian/wx/Grids.py | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) 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): -- 2.39.5