X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d301c440937fc3f9dda237d2b07da1a203fc61c8..68893d580363f62c7579cade2d9ee8f954eaf309:/src/msw/treectrl.cpp diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index b408ac740d..6b854a8c84 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -2215,6 +2215,15 @@ bool wxTreeCtrl::MSWCommand(WXUINT cmd, WXWORD id_) return true; } +bool wxTreeCtrl::MSWIsOnItem(unsigned flags) const +{ + unsigned mask = TVHT_ONITEM; + if ( HasFlag(wxTR_FULL_ROW_HIGHLIGHT) ) + mask |= TVHT_ONITEMINDENT | TVHT_ONITEMRIGHT; + + return (flags & mask) != 0; +} + bool wxTreeCtrl::MSWHandleSelectionKey(unsigned vkey) { const bool bCtrl = wxIsCtrlDown(); @@ -2716,7 +2725,7 @@ wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) m_htClickedItem.Unset(); - if ( !(tvht.flags & TVHT_ONITEM) ) + if ( !MSWIsOnItem(tvht.flags) ) { if ( tvht.flags & TVHT_ONITEMBUTTON ) { @@ -3067,10 +3076,7 @@ wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) } } - if ( !m_dragStarted && - (tvht.flags & TVHT_ONITEMSTATEICON || - tvht.flags & TVHT_ONITEMICON || - tvht.flags & TVHT_ONITEM) ) + if ( !m_dragStarted && MSWIsOnItem(tvht.flags) ) { processed = true; } @@ -3652,7 +3658,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) ::ScreenToClient(GetHwnd(), &tvhti.pt); if ( TreeView_HitTest(GetHwnd(), &tvhti) ) { - if ( tvhti.flags & TVHT_ONITEM ) + if ( MSWIsOnItem(tvhti.flags) ) { event.m_item = tvhti.hItem; eventType = (int)hdr->code == NM_DBLCLK