]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/dataview.mm
merging back XTI branch part 2
[wxWidgets.git] / src / osx / cocoa / dataview.mm
index 87d16daae706abb4bf8661ae537deb2d6a64cf03..80505a0f3c704ea7376c2ffda9aea2199a606634 100644 (file)
@@ -1695,6 +1695,9 @@ outlineView:(NSOutlineView*)outlineView
     model->GetAttr(dvItem, colIdx, attr);
     renderer->OSXApplyAttr(attr);
 
+    // set the state (enabled/disabled) of the item
+    renderer->OSXApplyEnabled(model->IsEnabled(dvItem, colIdx));
+
     // and finally do draw it
     renderer->MacRender();
 }
@@ -2487,6 +2490,11 @@ void wxDataViewRenderer::OSXApplyAttr(const wxDataViewItemAttr& attr)
         [(id)cell setTextColor:colText];
 }
 
+void wxDataViewRenderer::OSXApplyEnabled(bool enabled)
+{
+    [GetNativeData()->GetItemCell() setEnabled:enabled];
+}
+
 IMPLEMENT_ABSTRACT_CLASS(wxDataViewRenderer,wxDataViewRendererBase)
 
 // ---------------------------------------------------------
@@ -2976,7 +2984,12 @@ void wxDataViewColumn::SetResizeable(bool resizeable)
 
 void wxDataViewColumn::SetSortable(bool sortable)
 {
-    wxDataViewColumnBase::SetSortable(sortable);
+    // wxDataViewColumnBase::SetSortable(sortable);
+    // Avoid endless recursion and just set the flag here
+    if (sortable)
+        m_flags |= wxDATAVIEW_COL_SORTABLE;
+    else
+        m_flags &= ~wxDATAVIEW_COL_SORTABLE;
 }
 
 void wxDataViewColumn::SetSortOrder(bool ascending)