]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/listctrl_mac.cpp
Reapplied some previous patches that got lost while merging the Cocoa implementation
[wxWidgets.git] / src / osx / carbon / listctrl_mac.cpp
index d2e4faf977cc7f504e3f2d4fc77d7d95cf5fdad4..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();
 }
 
@@ -1128,6 +1129,8 @@ bool wxListCtrl::GetItem(wxListItem& info) const
             if (info.m_itemId >= 0 && info.m_itemId < GetItemCount())
             {
                 m_dbImpl->MacGetColumnInfo(info.m_itemId, info.m_col, info);
+                // MacGetColumnInfo returns erroneous information in the state field, so zero it.
+                info.SetState(0);
                 if (info.GetMask() & wxLIST_MASK_STATE)
                 {
                     DataBrowserItemID id = (DataBrowserItemID)m_dbImpl->GetItemFromLine(info.m_itemId);
@@ -1654,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;
 
@@ -1674,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;
 
@@ -1785,6 +1794,7 @@ bool wxListCtrl::DeleteItem(long item)
 // Deletes all items
 bool wxListCtrl::DeleteAllItems()
 {
+    m_current = -1;
     if (m_genericImpl)
         return m_genericImpl->DeleteAllItems();
 
@@ -2682,7 +2692,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem(
     int imgIndex = -1;
     
     DataBrowserTableViewColumnIndex listColumn = 0;
-    OSStatus err = GetColumnPosition( property, &listColumn );
+    GetColumnPosition( property, &listColumn );
     
     wxListCtrl* list = wxDynamicCast( GetWXPeer() , wxListCtrl );
     wxMacListCtrlItem* lcItem;