HitTest patch from Alberto
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@23853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1646,11 +1646,16 @@ wxTreeListItem *wxTreeListItem::HitTest(const wxPoint& point,
|
|||||||
const wxTreeListMainWindow *theCtrl,
|
const wxTreeListMainWindow *theCtrl,
|
||||||
int &flags, int& column, int level)
|
int &flags, int& column, int level)
|
||||||
{
|
{
|
||||||
column = -1;
|
column = theCtrl->GetMainColumn(); //-1;
|
||||||
wxTreeListItem* res = HitTest(point, theCtrl, flags, level);
|
wxTreeListItem* res = HitTest(point, theCtrl, flags, level);
|
||||||
|
|
||||||
if(!res) return res;
|
if(!res) {
|
||||||
if(flags & wxTREE_HITTEST_ONITEMINDENT) {
|
column = -1;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
if (point.x >= theCtrl->m_owner->GetHeaderWindow()->GetWidth())
|
||||||
|
column = -1;
|
||||||
|
else if(flags & wxTREE_HITTEST_ONITEMINDENT) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
for(size_t i = 0; i < theCtrl->GetMainColumn(); ++i) {
|
for(size_t i = 0; i < theCtrl->GetMainColumn(); ++i) {
|
||||||
int w = theCtrl->m_owner->GetHeaderWindow()->GetColumnWidth(i);
|
int w = theCtrl->m_owner->GetHeaderWindow()->GetColumnWidth(i);
|
||||||
@@ -3754,6 +3759,7 @@ wxTreeItemId wxTreeListMainWindow::HitTest(const wxPoint& point, int& flags,
|
|||||||
int w, h;
|
int w, h;
|
||||||
GetSize(&w, &h);
|
GetSize(&w, &h);
|
||||||
flags=0;
|
flags=0;
|
||||||
|
column = -1;
|
||||||
if (point.x<0) flags |= wxTREE_HITTEST_TOLEFT;
|
if (point.x<0) flags |= wxTREE_HITTEST_TOLEFT;
|
||||||
if (point.x>w) flags |= wxTREE_HITTEST_TORIGHT;
|
if (point.x>w) flags |= wxTREE_HITTEST_TORIGHT;
|
||||||
if (point.y<0) flags |= wxTREE_HITTEST_ABOVE;
|
if (point.y<0) flags |= wxTREE_HITTEST_ABOVE;
|
||||||
|
Reference in New Issue
Block a user