From 77ace0c533912e9cf2eeb459ff8e61758768cbcb Mon Sep 17 00:00:00 2001 From: =?utf8?q?W=C5=82odzimierz=20Skiba?= Date: Fri, 3 Sep 2004 14:35:45 +0000 Subject: [PATCH] Fix for coordinates in wxEVT_COMMAND_LIST_COL_RIGHT_CLICK [patch #1019696] with test code in the sample. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/listctrl/listtest.cpp | 5 +++++ src/msw/listctrl.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index b440b9eaf7..7198ec34ca 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -686,6 +686,11 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) SetColumnImage(col, -1); } + // Show popupmenu at position + wxMenu menu(wxT("Test")); + menu.Append(LIST_ABOUT, _T("&About")); + PopupMenu(&menu, event.GetPoint()); + wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); } diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 9f16e8d09d..cf1841b197 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1743,7 +1743,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) wxLogLastError(_T("GetCursorPos")); } - if ( !::ScreenToClient(hwndHdr, &ptClick) ) + if ( !::ScreenToClient(GetHwnd(), &ptClick) ) { wxLogLastError(_T("ScreenToClient(listctrl header)")); } -- 2.45.2