From a097e95174add8179fd8572c5974f8da9375ba30 Mon Sep 17 00:00:00 2001 From: HomeWorld Date: Sun, 18 Mar 2012 12:42:45 +0200 Subject: [PATCH] Properly detect column at a given position in fittingview/display (we were doing it in a very wrong way) --- gui/builtinViews/fittingView.py | 4 ++-- gui/display.py | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/gui/builtinViews/fittingView.py b/gui/builtinViews/fittingView.py index b4a0d61fa..4c73d8d53 100644 --- a/gui/builtinViews/fittingView.py +++ b/gui/builtinViews/fittingView.py @@ -384,8 +384,8 @@ class FittingView(d.Display): self.PopupMenu(menu) def click(self, event): - row, _ = self.HitTest(event.Position) - col = self.getColumn(event.Position) + row, _, col = self.HitTestSubItem(event.Position) + if row != -1 and col == self.getColIndex(State): sel = [] curr = self.GetFirstSelected() diff --git a/gui/display.py b/gui/display.py index 46c5e05b7..832b84307 100644 --- a/gui/display.py +++ b/gui/display.py @@ -258,9 +258,5 @@ class Display(wx.ListCtrl): self.refresh(stuff) def getColumn(self, point): - x = point[0] - total = 0 - for col in xrange(self.GetColumnCount()): - total += self.GetColumnWidth(col) - if total >= x: - return col + row, _, col = self.HitTestSubItem(point) + return col