From 378f62bd08a2dd496ff8c1a273eba4132443210b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 29 Sep 2018 16:52:20 +0200 Subject: [PATCH] Improve documentation of wxPGChoices ctor and Add() methods Mention that the "labels" array must be NULL-terminated and that "values" must have at least as many items, if they're provided at all. --- include/wx/propgrid/property.h | 4 ++-- interface/wx/propgrid/property.h | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/wx/propgrid/property.h b/include/wx/propgrid/property.h index 46591191d6..a37a953fc5 100644 --- a/include/wx/propgrid/property.h +++ b/include/wx/propgrid/property.h @@ -719,7 +719,7 @@ public: } // Constructor. - // labels - Labels for choices. + // labels - Labels for choices, NULL-terminated. // values - Values for choices. If NULL, indexes are used. wxPGChoices( const wxChar* const* labels, const long* values = NULL ) { @@ -754,7 +754,7 @@ public: // Adds to current. // If did not have own copies, creates them now. If was empty, identical // to set except that creates copies. - // labels - Labels for added choices. + // labels - Labels for added choices, NULL-terminated. // values - Values for added choices. If empty, relevant entry indexes are used. void Add( const wxChar* const* labels, const ValArrItem* values = NULL ); diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index e12ad51e3f..483f220c20 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -2488,10 +2488,11 @@ public: Constructor. @param labels - Labels for choices. + Labels for choices, @NULL-terminated. @param values - Values for choices. If @NULL, indexes are used. + Values for choices. If @NULL, indexes are used. Otherwise must have + at least the same size as @a labels. */ wxPGChoices( const wxChar** labels, const long* values = NULL ); @@ -2502,7 +2503,8 @@ public: Labels for choices. @param values - Values for choices. If empty, indexes are used. + Values for choices. If empty, indexes are used. Otherwise must have + at least the same size as @a labels. */ wxPGChoices( const wxArrayString& labels, const wxArrayInt& values = wxArrayInt() ); @@ -2521,10 +2523,11 @@ public: identical to set except that creates copies. @param labels - Labels for added choices. + Labels for added choices, @NULL-terminated. @param values - Values for added choices. If empty, relevant entry indexes are used. + Values for added choices. If empty, relevant entry indexes are + used. Otherwise must have at least the same size as @a labels. */ void Add( const wxChar** labels, const ValArrItem* values = NULL );