Document wxDataViewListModel as common abstract base class for

wxDataViewIndexListModel and wxDataViewVirtualListModel.

Add wxDataViewListModel::GetCount() as both have it.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2010-09-13 20:12:57 +00:00
parent d8090b5e2c
commit b955766e88
2 changed files with 39 additions and 23 deletions

View File

@@ -305,6 +305,8 @@ public:
// helper methods provided by list models only
virtual unsigned GetRow( const wxDataViewItem &item ) const = 0;
// returns the number of rows
virtual unsigned int GetCount() const = 0;
// implement some base class pure virtual directly
virtual wxDataViewItem
@@ -339,6 +341,7 @@ public:
return GetAttrByRow( GetRow(item), col, attr );
}
virtual bool IsListModel() const { return true; }
};

View File

@@ -327,28 +327,17 @@ protected:
/**
@class wxDataViewIndexListModel
@class wxDataViewListModel
wxDataViewIndexListModel is a specialized data model which lets you address
an item by its position (row) rather than its wxDataViewItem (which you can
obtain from this class).
This model also provides its own wxDataViewIndexListModel::Compare
method which sorts the model's data by the index.
This model is not a virtual model since the control stores each wxDataViewItem.
Use wxDataViewVirtualListModel if you need to display millions of items or
have other reason to use a virtual control.
Base class with abstract API for wxDataViewIndexListModel and
wxDataViewVirtualListModel.
@library{wxadv}
@category{dvc}
*/
class wxDataViewIndexListModel : public wxDataViewModel
class wxDataViewListModel : public wxDataViewModel
{
public:
/**
Constructor.
*/
wxDataViewIndexListModel(unsigned int initial_size = 0);
/**
Destructor.
@@ -455,6 +444,34 @@ public:
};
/**
@class wxDataViewIndexListModel
wxDataViewIndexListModel is a specialized data model which lets you address
an item by its position (row) rather than its wxDataViewItem (which you can
obtain from this class).
This model also provides its own wxDataViewIndexListModel::Compare
method which sorts the model's data by the index.
This model is not a virtual model since the control stores each wxDataViewItem.
Use wxDataViewVirtualListModel if you need to display millions of items or
have other reason to use a virtual control.
@see wxDataViewListModel for the API.
@library{wxadv}
@category{dvc}
*/
class wxDataViewIndexListModel : public wxDataViewListModel
{
public:
/**
Constructor.
*/
wxDataViewIndexListModel(unsigned int initial_size = 0);
};
/**
@class wxDataViewVirtualListModel
@@ -464,15 +481,15 @@ public:
the exact same interface as wxDataViewIndexListModel.
The important difference is that under platforms other than OS X, using this
model will result in a truly virtual control able to handle millions of items
as the control doesn't store any item (a feature not supported by the
Carbon API under OS X).
as the control doesn't store any item (a feature not supported by OS X).
@see wxDataViewIndexListModel for the API.
@see wxDataViewListModel for the API.
@library{wxadv}
@category{dvc}
*/
class wxDataViewVirtualListModel : public wxDataViewModel
class wxDataViewVirtualListModel : public wxDataViewListModel
{
public:
/**
@@ -480,10 +497,6 @@ public:
*/
wxDataViewVirtualListModel(unsigned int initial_size = 0);
/**
Returns the number of virtual items (i.e. rows) in the list.
*/
unsigned int GetCount() const;
};