]> git.phdru.name Git - m_librarian.git/commitdiff
Feat(wx): Do not select when clicking on column/row labels
authorOleg Broytman <phd@phdru.name>
Mon, 8 Jul 2024 13:31:07 +0000 (16:31 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 8 Jul 2024 13:32:03 +0000 (16:32 +0300)
In list of authors and list of books.

[skip ci]

TODO
m_librarian/wx/Grids.py

diff --git a/TODO b/TODO
index 52fa997a325a00e5c835df2cd80bbe0b57e1b14d..5be94da5b5e6030c5570b9c8ed0c1e530fc7b98b 100644 (file)
--- 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.
 
 
index fe2f8d0174c68ef3dc4bbd734bd456879167eb6d..12a9e4374f87ee8165edb6d598f1978e1b531d53 100644 (file)
@@ -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):