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.
This commit is contained in:
Vadim Zeitlin
2018-09-29 16:52:20 +02:00
parent f96c37eacc
commit 378f62bd08
2 changed files with 10 additions and 7 deletions

View File

@@ -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 );

View File

@@ -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 );