Fix wxDataViewCtrl to omit expander space for all kinds of lists.

List-only models don't have expanders and so the control shouldn't
reserve any space for them; the notion of expander column doesn't make
sense here.

Previously, this was done correctly only for wxDataViewVirtualListModel;
"ordinary" list models, such as the one used by wxDataViewListCtrl, were
treated as generic tree models and 0th column had ugly empty space
reserved for (never used) expander.

This patch fixes it by adding IsListModel() helper function in
addition to existing IsVirtualListModel(). Some of the
IsVirtualListModel() tests were changed into IsListModel() checks as
appropriate.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2010-07-29 20:54:00 +00:00
parent e78778c8e2
commit ce5abbf9f5
3 changed files with 22 additions and 13 deletions

View File

@@ -257,6 +257,7 @@ public:
virtual bool HasDefaultCompare() const { return false; }
// internal
virtual bool IsListModel() const { return false; }
virtual bool IsVirtualListModel() const { return false; }
protected:
@@ -328,6 +329,8 @@ public:
{
return GetAttrByRow( GetRow(item), col, attr );
}
virtual bool IsListModel() const { return true; }
};
// ---------------------------------------------------------