From 23c2d67c08d4d70a56b7a114acfe0c2e23b104ce Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Feb 2018 13:29:57 +0100 Subject: [PATCH] Improve wxDataViewListCtrl::AppendItem() and related methods docs Explain that the vector passed to {Append,Insert,Prepend}Item() must have the same number of elements as there are columns in the control and that no more columns can be added after adding any items. See https://github.com/wxWidgets/wxWidgets/pull/724 --- interface/wx/dataview.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index 9ef314b359e3..d4aba9842872 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -2960,17 +2960,29 @@ class wxDataViewListCtrl: public wxDataViewCtrl //@{ /** - Appends an item (=row) to the control and store. + Appends an item (i.e.\ a row) to the control. + + Note that the size of @a values vector must be exactly equal to the + number of columns in the control and that columns must not be modified + after adding any items to the control (or, conversely, items must not + be added before the columns are set up). */ void AppendItem( const wxVector &values, wxUIntPtr data = NULL ); /** - Prepends an item (=row) to the control and store. + Prepends an item (i.e.\ a row) to the control. + + See remarks for AppendItem() for preconditions of this method. */ void PrependItem( const wxVector &values, wxUIntPtr data = NULL ); /** - Inserts an item (=row) to the control and store. + Inserts an item (i.e.\ a row) to the control. + + See remarks for AppendItem() for preconditions of this method. + + Additionally, @a row must be less than or equal to the current number + of items in the control (see GetItemCount()). */ void InsertItem( unsigned int row, const wxVector &values, wxUIntPtr data = NULL );