Properly detect column at a given position in fittingview/display (we were doing it in a very wrong way)

This commit is contained in:
HomeWorld
2012-03-18 12:42:45 +02:00
parent 940b270224
commit a097e95174
2 changed files with 4 additions and 8 deletions

View File

@@ -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()

View File

@@ -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