Improve hit detection in wxMSW wxTreeCtrl with wxTR_FULL_ROW_HIGHLIGHT style.
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 7 Jan 2010 13:16:01 +0000 (13:16 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 7 Jan 2010 13:16:01 +0000 (13:16 +0000)
commit3c8cbc12caeab51f2b483cf7d419417801679670
treeb5b0ec2d78cff7ef3de88b7f462648d4fb4d7ae2
parentdae28982ed8eb044424a418e211c25131b376bfb
Improve hit detection in wxMSW wxTreeCtrl with wxTR_FULL_ROW_HIGHLIGHT style.

When wxTR_FULL_ROW_HIGHLIGHT is used, the item visually takes up the entire
breadth of the window so clicking both to the left or to the right of the item
should have the same effect as clicking on it.

So add a MSWIsOnItem() helper which tests for whether a point is above the
item correctly and use it in order to:

1. In multi selection mode, allow clicking anywhere to select the item(s)
   when Ctrl or Shift is pressed (Closes #11598).
2. Generate activation event when clicking to the right of the item too
   (Closes #11602).
3. Detect item bounds correctly in WM_LBUTTONUP handler (although it's
   not really clear what does this code do and hence what problem does this
   fix...).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/msw/treectrl.h
src/msw/treectrl.cpp