+private:
+ // AppendItems() and InsertItems() helpers just call DoAppend/InsertItems()
+ // after doing some checks
+ //
+ // NB: they're defined here so that they're inlined when used in public part
+ int AppendItems(const wxArrayStringsAdapter& items,
+ void **clientData,
+ wxClientDataType type)
+ {
+ if ( items.IsEmpty() )
+ return wxNOT_FOUND;
+
+ return DoAppendItems(items, clientData, type);
+ }
+
+ int AppendItems(const wxArrayStringsAdapter& items)
+ {
+ return AppendItems(items, NULL, wxClientData_None);
+ }
+
+ int AppendItems(const wxArrayStringsAdapter& items, void **clientData)
+ {
+ wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
+ wxT("can't mix different types of client data") );
+
+ return AppendItems(items, clientData, wxClientData_Void);
+ }
+
+ int AppendItems(const wxArrayStringsAdapter& items,
+ wxClientData **clientData)
+ {
+ wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
+ wxT("can't mix different types of client data") );
+
+ return AppendItems(items, reinterpret_cast<void **>(clientData),
+ wxClientData_Object);
+ }
+
+ int InsertItems(const wxArrayStringsAdapter& items,
+ unsigned int pos,
+ void **clientData,
+ wxClientDataType type)
+ {
+ wxASSERT_MSG( !IsSorted(), wxT("can't insert items in sorted control") );
+
+ wxCHECK_MSG( pos <= GetCount(), wxNOT_FOUND,
+ wxT("position out of range") );
+
+ // not all derived classes handle empty arrays correctly in
+ // DoInsertItems() and besides it really doesn't make much sense to do
+ // this (for append it could correspond to creating an initially empty
+ // control but why would anybody need to insert 0 items?)
+ wxCHECK_MSG( !items.IsEmpty(), wxNOT_FOUND,
+ wxT("need something to insert") );
+
+ return DoInsertItems(items, pos, clientData, type);
+ }
+
+ int InsertItems(const wxArrayStringsAdapter& items, unsigned int pos)
+ {
+ return InsertItems(items, pos, NULL, wxClientData_None);
+ }
+
+ int InsertItems(const wxArrayStringsAdapter& items,
+ unsigned int pos,
+ void **clientData)
+ {
+ wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
+ wxT("can't mix different types of client data") );
+
+ return InsertItems(items, pos, clientData, wxClientData_Void);
+ }
+
+ int InsertItems(const wxArrayStringsAdapter& items,
+ unsigned int pos,
+ wxClientData **clientData)
+ {
+ wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
+ wxT("can't mix different types of client data") );
+
+ return InsertItems(items, pos,
+ reinterpret_cast<void **>(clientData),
+ wxClientData_Object);
+ }
+