]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wxDataViewListCtrl::GetItemCount().
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 25 May 2012 17:02:40 +0000 (17:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 25 May 2012 17:02:40 +0000 (17:02 +0000)
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

docs/changes.txt
include/wx/dataview.h
interface/wx/dataview.h
src/common/datavcmn.cpp

index d0ddc372b8703f304cd4f4ca0e5061f9a429886e..28bbac5ac63e716abdba830109003a35d8b2918d 100644 (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:
 
index 9e1ad7bac1f6200306f034bf7e27e04b87a1337c..7b86dea69fc6ea10b5a9fec6ceb2d4c7829012fc 100644 (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:
index a491490c40a5e6f4acd66abc3bb0b2bbdabcaede..e45d0fced14153d526ef07fcee6f27b8feee7a00 100644 (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.
 
index ab385d09d3ea9693d17517de74246610c62cb831..1ac5c1d16f897afc4604455e9a8579944f0622fb 100644 (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];