Provide wxPGChoices ctor, Add(), Set() overloads taking wxStrings

Allow passing an array of wxStrings in addition to an array of wxChar*
strings.
This commit is contained in:
Vadim Zeitlin
2018-09-29 17:13:00 +02:00
parent b624064659
commit 96ecfd8c77
3 changed files with 76 additions and 1 deletions

View File

@@ -3013,6 +3013,20 @@ wxPGChoiceEntry& wxPGChoices::AddAsSorted( const wxString& label, int value )
// -----------------------------------------------------------------------
void wxPGChoices::Add(size_t count, const wxString* labels, const long* values)
{
AllocExclusive();
for ( size_t i = 0; i < count; ++i )
{
const int value = values ? values[i] : i;
wxPGChoiceEntry entry(labels[i], value);
m_data->Insert( i, entry );
}
}
// -----------------------------------------------------------------------
void wxPGChoices::Add( const wxChar* const* labels, const ValArrItem* values )
{
AllocExclusive();