Add wxDataViewRendererBase::PrepareForItem() helper.
For calling SetValue() and SetAttr() consistently, instead of having the same code duplicated all over the place. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -779,6 +779,20 @@ bool wxDataViewRendererBase::FinishEditing()
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewRendererBase::PrepareForItem(const wxDataViewModel *model,
|
||||
const wxDataViewItem& item,
|
||||
unsigned column)
|
||||
{
|
||||
wxVariant value;
|
||||
model->GetValue(value, item, column);
|
||||
SetValue(value);
|
||||
|
||||
wxDataViewItemAttr attr;
|
||||
model->GetAttr(item, column, attr);
|
||||
SetAttr(attr);
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxDataViewCustomRendererBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user