]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
don't call ::GetSystemMetrics() unnecessarily in wxGetHiconSize()
[wxWidgets.git] / src / msw / listctrl.cpp
index 811e089e88cccda14c8441d4de1308ae833bb0f5..c70de886463e5bfe0d8fe66f32c94f2a4b6b280c 100644 (file)
@@ -27,6 +27,7 @@
 #if wxUSE_LISTCTRL
 
 #ifndef WX_PRECOMP
+    #include "wx/msw/wrapcctl.h" // include <commctrl.h> "properly"
     #include "wx/app.h"
     #include "wx/intl.h"
     #include "wx/log.h"
@@ -48,9 +49,6 @@
   #endif
 #endif
 
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
-
 // Currently gcc and watcom don't define NMLVFINDITEM, and DMC only defines
 // it by its old name NM_FINDTIEM.
 //
@@ -1511,7 +1509,8 @@ long wxListCtrl::FindItem(long start, const wxPoint& pt, int direction)
 
 // Determines which item (if any) is at the specified point,
 // giving details in 'flags' (see wxLIST_HITTEST_... flags above)
-long wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem)
+long
+wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const
 {
     LV_HITTESTINFO hitTestInfo;
     hitTestInfo.pt.x = (int) point.x;
@@ -1762,6 +1761,20 @@ bool wxListCtrl::SortItems(wxListCtrlCompare fn, long data)
 // message processing
 // ----------------------------------------------------------------------------
 
+bool wxListCtrl::MSWShouldPreProcessMessage(WXMSG* msg)
+{
+    if ( msg->message == WM_KEYDOWN )
+    {
+        if ( msg->wParam == VK_RETURN )
+        {
+            // we need VK_RETURN to generate wxEVT_COMMAND_LIST_ITEM_ACTIVATED
+            return false;
+        }
+    }
+
+    return wxControl::MSWShouldPreProcessMessage(msg);
+}
+
 bool wxListCtrl::MSWCommand(WXUINT cmd, WXWORD id)
 {
     if (cmd == EN_UPDATE)