X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1a8372ba0f655f8f9fec7d942f9665fcb458903c..04443bbfb00a2589ff26f1483718e2944397b7e3:/wxPython/contrib/gizmos/treelistctrl.cpp diff --git a/wxPython/contrib/gizmos/treelistctrl.cpp b/wxPython/contrib/gizmos/treelistctrl.cpp index b14bb3b961..8ea7363b01 100644 --- a/wxPython/contrib/gizmos/treelistctrl.cpp +++ b/wxPython/contrib/gizmos/treelistctrl.cpp @@ -1646,11 +1646,16 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point, const wxTreeListMainWindow *theCtrl, int &flags, int& column, int level) { - column = -1; + column = theCtrl->GetMainColumn(); //-1; wxTreeListItem* res = HitTest(point, theCtrl, flags, level); - if(!res) return res; - if(flags & wxTREE_HITTEST_ONITEMINDENT) { + if(!res) { + column = -1; + return res; + } + if (point.x >= theCtrl->m_owner->GetHeaderWindow()->GetWidth()) + column = -1; + else if(flags & wxTREE_HITTEST_ONITEMINDENT) { int x = 0; for(size_t i = 0; i < theCtrl->GetMainColumn(); ++i) { int w = theCtrl->m_owner->GetHeaderWindow()->GetColumnWidth(i); @@ -3754,6 +3759,7 @@ wxTreeItemId wxTreeListMainWindow::HitTest(const wxPoint& point, int& flags, int w, h; GetSize(&w, &h); flags=0; + column = -1; if (point.x<0) flags |= wxTREE_HITTEST_TOLEFT; if (point.x>w) flags |= wxTREE_HITTEST_TORIGHT; if (point.y<0) flags |= wxTREE_HITTEST_ABOVE;