Hello,
here's the patch to wxTreeListCtrl::HitTest to fix the wrong column
number. As for the "off-by-one" bug, actually I'm not sure it's a bug at
all. Here's my point: the coordinates are correctly translated in
wxTreeListCtrl::HitTest to be relative to the main window... the fact
that they seem to be wrong is because they are probably passed as already
translated.... I'm not sure to have explained what I mean, so let me try
with an example:
normally HitTest is called from a mouse event handler. The problem is
that the wxMouseEvent is emitted by the main window, and not by the tree
list itself, so event.GetPosition() returns already the "right"
coordinates, that need not to be translated. That's why the values
returned are wrong.
Sure, this is the most common case, but does this suffice to "break" the
code? What should I do? (If you don't understand, it's probably my bad
English, but see treelistctrl.cpp around line 4667)
Hello,
here's the patch to wxTreeListCtrl::HitTest to fix the wrong column
number. As for the "off-by-one" bug, actually I'm not sure it's a bug at
all. Here's my point: the coordinates are correctly translated in
wxTreeListCtrl::HitTest to be relative to the main window... the fact
that they seem to be wrong is because they are probably passed as already
translated.... I'm not sure to have explained what I mean, so let me try
with an example:
normally HitTest is called from a mouse event handler. The problem is
that the wxMouseEvent is emitted by the main window, and not by the tree
list itself, so event.GetPosition() returns already the "right"
coordinates, that need not to be translated. That's why the values
returned are wrong.
Sure, this is the most common case, but does this suffice to "break" the
code? What should I do? (If you don't understand, it's probably my bad
English, but see treelistctrl.cpp around line 4667)
I'm unable to look right now as I'm in a meeting but there was a similar (or same?) problem in the generic wxListCtrl a few months ago. You may want to track down that fix and see if it applies to this case too.
ยทยทยท
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!