]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Reenabled deleteallitems events, marked
[wxWidgets.git] / src / msw / listctrl.cpp
index 34649103cc5eaf2cffed7d461b0ece5efdc2d536..15d33a55c195ec713f1c62f4c0e091ec417eeb92 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".
@@ -1294,19 +1295,20 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
             }
 
         case LVN_DELETEALLITEMS:
-            // what's the sense of generating a wxWin event for this when
-            // it's absolutely not portable?
-#if 0
-            eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
+            // What's the sense of generating a wxWin event for this when
+           // it's absolutely not portable?
+            // This is perfectly portable, RR
+#if 1
+           eventType = wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS;
             event.m_itemIndex = -1;
-#endif // 0
+#endif // 1
 
             // return TRUE to suppress all additional LVN_DELETEITEM
             // notifications - this makes deleting all items from a list ctrl
             // much faster
             *result = TRUE;
 
-            return TRUE;
+           break;
 
         case LVN_DELETEITEM:
             {
@@ -1577,6 +1579,14 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
     if ( !GetEventHandler()->ProcessEvent(event) )
         return FALSE;
 
+    if (eventType == wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS)
+    {
+       // No postprocessing, because we want *return to
+       // be TRUE so that no further DeleteItem events
+       // are sent, RR.
+        return TRUE;
+    }
+
     // post processing
     // ---------------