virtual void GetValue( wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) const = 0;
+ // return true if the given item has a value to display in the given
+ // column: this is always true except for container items which by default
+ // only show their label in the first column (but see HasContainerColumns())
+ bool HasValue(const wxDataViewItem& item, unsigned col) const
+ {
+ return col == 0 || !IsContainer(item) || HasContainerColumns(item);
+ }
+
// usually ValueChanged() should be called after changing the value in the
// model to update the control, ChangeValue() does it on its own while
// SetValue() does not -- so while you will override SetValue(), you should
*/
virtual bool HasDefaultCompare() const;
+ /**
+ Return true if there is a value in the given column of this item.
+
+ All normal items have values in all columns but the container items
+ only show their label in the first column (@a col == 0) by default (but
+ see HasContainerColumns()). So this function always returns true for
+ the first column while for the other ones it returns true only if the
+ item is not a container or HasContainerColumns() was overridden to
+ return true for it.
+
+ @since 2.9.1
+ */
+ bool HasValue(const wxDataViewItem& item, unsigned col) const;
+
/**
Override this to indicate of @a item is a container, i.e. if
it can have child items.