Add wxDataViewListCtrl::GetItemCount().

This method is convenient and (almost, except for the return value) compatible
with wxListCtrl.

See #11088.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2012-05-25 17:02:40 +00:00
parent 518cef0470
commit 5fb4b6cd65
4 changed files with 25 additions and 0 deletions

View File

@@ -557,6 +557,7 @@ All (GUI):
- Added pixel font size capability to wxTextAttr and wxRichTextCtrl.
- Fully implement wxStyledTextCtrl::PositionToXY() (troelsk).
- Added wxDataViewListCtrl::{Set,Get}ItemData().
- Added wxDataViewListCtrl::GetItemCount() (Kry).
GTK:

View File

@@ -972,6 +972,8 @@ public:
void DeleteItem( unsigned int pos );
void DeleteAllItems();
unsigned int GetItemCount() const;
void SetItemData( const wxDataViewItem& item, wxUIntPtr data );
wxUIntPtr GetItemData( const wxDataViewItem& item ) const;
@@ -1085,6 +1087,9 @@ public:
wxUIntPtr GetItemData( const wxDataViewItem& item ) const
{ return GetStore()->GetItemData( item ); }
int GetItemCount() const
{ return GetStore()->GetItemCount(); }
void OnSize( wxSizeEvent &event );
private:

View File

@@ -2337,6 +2337,13 @@ public:
*/
void DeleteAllItems();
/**
Returns the number of items (=rows) in the control
@since 2.9.4
*/
unsigned int GetItemCount() const;
/**
Returns the client data associated with the item.
@@ -2710,6 +2717,13 @@ public:
*/
void DeleteAllItems();
/**
Returns the number of items (=rows) in the control
@since 2.9.4
*/
unsigned int GetItemCount() const;
/**
Returns the client data associated with the item.

View File

@@ -1705,6 +1705,11 @@ unsigned int wxDataViewListStore::GetColumnCount() const
return m_cols.GetCount();
}
unsigned int wxDataViewListStore::GetItemCount() const
{
return m_data.size();
}
wxString wxDataViewListStore::GetColumnType( unsigned int pos ) const
{
return m_cols[pos];