From: Stefan Csomor <csomor@advancedconcepts.ch>
Date: Mon, 2 Oct 2006 18:50:53 +0000 (+0000)
Subject: first stab at the selection iterator
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/819a3b6ff9b43ef31413d0a0541c961e09f81e98?ds=inline

first stab at the selection iterator


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp
index 46d53fe1bc..ad24e68b8c 100644
--- a/src/mac/carbon/listctrl_mac.cpp
+++ b/src/mac/carbon/listctrl_mac.cpp
@@ -852,6 +852,18 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
     if (m_genericImpl)
         return m_genericImpl->GetNextItem(item, geom, state);
 
+    if (m_dbImpl && geom == wxLIST_NEXT_ALL && state == wxLIST_STATE_SELECTED )
+    {
+        long count = m_dbImpl->MacGetCount() ;
+        for ( long line = item + 1 ; line < count; line++ )
+        {
+            wxMacDataItem* id = m_dbImpl->GetItemFromLine(line);
+            if ( m_dbImpl->IsItemSelected(id ) )
+                return line;
+        }
+        return -1;
+    }
+
     return 0;
 }