]> git.saurik.com Git - wxWidgets.git/commitdiff
(Forward port from 2.8) Allow m_current to be used for the focused item, and reset...
authorKevin Ollivier <kevino@theolliviers.com>
Sat, 2 May 2009 18:59:28 +0000 (18:59 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sat, 2 May 2009 18:59:28 +0000 (18:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/carbon/listctrl_mac.cpp
src/osx/carbon/utils.cpp

index 1f0b594c94b34be8f78c2af3e6cad6a9c8564281..40b6d3619821be7d86d46ff5749a8b8195333255 100644 (file)
@@ -616,7 +616,8 @@ void wxListCtrl::OnLeftDown(wxMouseEvent& event)
 
 void wxListCtrl::OnDblClick(wxMouseEvent& event)
 {
-    m_current = -1;
+    if ( m_renameTimer->IsRunning() )
+        m_renameTimer->Stop();
     event.Skip();
 }
 
@@ -1656,6 +1657,9 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
                 if ( !IsVirtual() )
                     id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
 
+                if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line)) 
+                    return line;
+
                 if ( (state == wxLIST_STATE_DONTCARE ) )
                     return line;
 
@@ -1676,6 +1680,9 @@ long wxListCtrl::GetNextItem(long item, int geom, int state) const
                 if ( !IsVirtual() )
                     id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(line);
 
+                if ( (state & wxLIST_STATE_FOCUSED) && (m_current == line)) 
+                    return line;
+
                 if ( (state == wxLIST_STATE_DONTCARE ) )
                     return line;
 
@@ -1787,6 +1794,7 @@ bool wxListCtrl::DeleteItem(long item)
 // Deletes all items
 bool wxListCtrl::DeleteAllItems()
 {
+    m_current = -1;
     if (m_genericImpl)
         return m_genericImpl->DeleteAllItems();
 
index 36b792f4f74118ca0d076ac3813980a1a32db749..dd44627d41a92973035fa32a96bc47f1a28141bd 100644 (file)
@@ -971,6 +971,7 @@ void wxMacDataItemBrowserControl::RemoveItems(wxMacDataItem *container, wxArrayM
 
 void wxMacDataItemBrowserControl::RemoveAllItems(wxMacDataItem *container)
 {
+    SetScrollPosition(0, 0);
     OSStatus err = wxMacDataBrowserControl::RemoveItems( (DataBrowserItemID)container, 0 , NULL , kDataBrowserItemNoProperty );
     verify_noerr( err );
 }