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:
@@ -305,6 +305,8 @@ public:
|
|||||||
// helper methods provided by list models only
|
// helper methods provided by list models only
|
||||||
virtual unsigned GetRow( const wxDataViewItem &item ) const = 0;
|
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
|
// implement some base class pure virtual directly
|
||||||
virtual wxDataViewItem
|
virtual wxDataViewItem
|
||||||
@@ -339,6 +341,7 @@ public:
|
|||||||
return GetAttrByRow( GetRow(item), col, attr );
|
return GetAttrByRow( GetRow(item), col, attr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual bool IsListModel() const { return true; }
|
virtual bool IsListModel() const { return true; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -327,28 +327,17 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@class wxDataViewIndexListModel
|
@class wxDataViewListModel
|
||||||
|
|
||||||
wxDataViewIndexListModel is a specialized data model which lets you address
|
Base class with abstract API for wxDataViewIndexListModel and
|
||||||
an item by its position (row) rather than its wxDataViewItem (which you can
|
wxDataViewVirtualListModel.
|
||||||
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.
|
|
||||||
|
|
||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{dvc}
|
@category{dvc}
|
||||||
*/
|
*/
|
||||||
class wxDataViewIndexListModel : public wxDataViewModel
|
class wxDataViewListModel : public wxDataViewModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
|
||||||
Constructor.
|
|
||||||
*/
|
|
||||||
wxDataViewIndexListModel(unsigned int initial_size = 0);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Destructor.
|
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
|
@class wxDataViewVirtualListModel
|
||||||
@@ -464,15 +481,15 @@ public:
|
|||||||
the exact same interface as wxDataViewIndexListModel.
|
the exact same interface as wxDataViewIndexListModel.
|
||||||
The important difference is that under platforms other than OS X, using this
|
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
|
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
|
as the control doesn't store any item (a feature not supported by OS X).
|
||||||
Carbon API under OS X).
|
|
||||||
|
|
||||||
@see wxDataViewIndexListModel for the API.
|
@see wxDataViewListModel for the API.
|
||||||
|
|
||||||
@library{wxadv}
|
@library{wxadv}
|
||||||
@category{dvc}
|
@category{dvc}
|
||||||
*/
|
*/
|
||||||
class wxDataViewVirtualListModel : public wxDataViewModel
|
|
||||||
|
class wxDataViewVirtualListModel : public wxDataViewListModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
@@ -480,10 +497,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
wxDataViewVirtualListModel(unsigned int initial_size = 0);
|
wxDataViewVirtualListModel(unsigned int initial_size = 0);
|
||||||
|
|
||||||
/**
|
|
||||||
Returns the number of virtual items (i.e. rows) in the list.
|
|
||||||
*/
|
|
||||||
unsigned int GetCount() const;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user