Properly detect column at a given position in fittingview/display (we were doing it in a very wrong way)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user