From f047d93c6a1d9c6b7bacf885555cbe4724f2c602 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 27 Jan 2015 11:49:44 +0000 Subject: [PATCH] Fix wxEVT_TREE_STATE_IMAGE_CLICK generation in wxMSW wxTreeCtrl. Use GET_{X,Y}_LPARAM() to extract them from the event position, which handle negative coordinates (and coordinates can perfectly well be negative when using multiple displays) correctly, unlike {LO,HI}WORD(). Closes #16812. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 1 + src/msw/treectrl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index aa9cfbb8c5..fad051e735 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -600,6 +600,7 @@ wxMSW: - Fix autosize after expanding/collapsing items in wxDataViewCtrl (ciglesias). - Fix inserting tools removed from wxToolBar back into it (sbrowne). - Fix disabling submenu items in the menus (Artur Wieczorek). +- Fix wxEVT_TREE_STATE_IMAGE_CLICK generation (Antal). wxOSX: diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index 754ea316c3..e150cfc6d7 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -3639,8 +3639,8 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { DWORD pos = GetMessagePos(); POINT point; - point.x = LOWORD(pos); - point.y = HIWORD(pos); + point.x = GET_X_LPARAM(pos); + point.y = GET_Y_LPARAM(pos); ::MapWindowPoints(HWND_DESKTOP, GetHwnd(), &point, 1); int htFlags = 0; wxTreeItemId item = HitTest(wxPoint(point.x, point.y), htFlags);