Added an example of overriding method HasValue in wxDataView to show how some items may not have values for some columns.

This commit is contained in:
Jorge Moraleda
2020-04-13 23:43:39 -07:00
parent a1f90ae0de
commit 8b9cf87653
3 changed files with 77 additions and 0 deletions

View File

@@ -626,3 +626,15 @@ bool MyListStoreDerivedModel::IsEnabledByRow(unsigned int row, unsigned int col)
// disabled the last two checkboxes
return !(col == 0 && 8 <= row && row <= 9);
}
// ----------------------------------------------------------------------------
// MyListStoreHasValueModel
// ----------------------------------------------------------------------------
bool MyListStoreHasValueModel::HasValue(const wxDataViewItem &item, unsigned int col) const
{
unsigned int row = GetRow( item );
// the diagonal entries don't have values. This is just a silly example to demonstrate the
// usage of overriding HasValue to specify that some columns don't have values for some items
return row != col;
}