From 227c63bac98c6f40f17f1ee188f22e7ac11f563d Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 6 Feb 2000 20:35:32 +0000 Subject: [PATCH] Reenabled deleteallitems events, marked with RR. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5877 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/listctrl.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 09a988cd15..15d33a55c1 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -1295,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: { @@ -1578,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 // --------------- -- 2.45.2