]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Line drawing correction.
[wxWidgets.git] / src / msw / listctrl.cpp
index b74816ce5baf8d36293df3c8053027fc93d862f2..09a988cd15e8ef598952a6a3610043a9d7ab719d 100644 (file)
@@ -19,6 +19,7 @@
 
 #ifdef __GNUG__
     #pragma implementation "listctrl.h"
+    #pragma implementation "listctrlbase.h"
 #endif
 
 // For compilers that support precompilation, includes "wx.h".
@@ -1420,9 +1421,16 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             }
 
             // else translate it into wxEVT_COMMAND_LIST_ITEM_ACTIVATED event
+            // if it happened on an item (and not on empty place)
             {
-                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 NM_LISTVIEW* hdr = (NM_LISTVIEW*)lParam;
+                if ( hdr->iItem == -1 )
+                {
+                    // not on item
+                    return FALSE;
+                }
+
+                eventType = wxEVT_COMMAND_LIST_ITEM_ACTIVATED;
                 event.m_itemIndex = hdr->iItem;
             }
             break;