Add the possibility to disable invisible wxDataViewCtrl items.
Add new wxDataViewModel::IsEnabled() and wxDataViewListStore::IsEnabledByRow() methods and implement support for actually disabling the items in wxOSX/Cocoa native implementation of wxDataViewCtrl and limited support for it in the generic version. We need to implement this in wxGTK using GtkCellRenderer "sensitive" propriety later. Closes #12686. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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)
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user