]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix for coordinates in wxEVT_COMMAND_LIST_COL_RIGHT_CLICK [patch #1019696] with test...
authorWłodzimierz Skiba <abx@abx.art.pl>
Fri, 3 Sep 2004 14:35:45 +0000 (14:35 +0000)
committerWłodzimierz Skiba <abx@abx.art.pl>
Fri, 3 Sep 2004 14:35:45 +0000 (14:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/listctrl/listtest.cpp
src/msw/listctrl.cpp

index b440b9eaf75a61e6918f847c7a62728f1e810bc2..7198ec34cae62086c7546f089f0934c9b1bd9e15 100644 (file)
@@ -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() );
 }
 
index 9f16e8d09d5c28eaceb805601ad411241870ad5c..cf1841b1972e027a8003d66ef1cb7bfb103ab633 100644 (file)
@@ -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)"));
                     }