}
m_strings.Insert(item,pos);
+ m_clientDatas.Insert(NULL, pos);
+
m_widths.Insert(-1,pos);
m_widthsDirty = true;
// It should be sufficient to update this variable only here
m_clientDataItemsType = clientDataItemsType;
- m_clientDatas.SetCount(n+1,NULL);
m_clientDatas[n] = clientData;
ItemWidthChanged(n);
// wxOwnerDrawnComboBox item manipulation methods
// ----------------------------------------------------------------------------
-void wxOwnerDrawnComboBox::Clear()
+void wxOwnerDrawnComboBox::DoClear()
{
EnsurePopupControl();
SetValue(wxEmptyString);
}
-void wxOwnerDrawnComboBox::Delete(unsigned int n)
+void wxOwnerDrawnComboBox::DoDeleteOneItem(unsigned int n)
{
wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") );
return GetVListBoxComboPopup()->GetSelection();
}
-int wxOwnerDrawnComboBox::DoAppend(const wxString& item)
-{
- EnsurePopupControl();
- wxASSERT(m_popupInterface);
-
- return GetVListBoxComboPopup()->Append(item);
-}
-
-int wxOwnerDrawnComboBox::DoInsert(const wxString& item, unsigned int pos)
+int wxOwnerDrawnComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
+ unsigned int pos,
+ void **clientData,
+ wxClientDataType type)
{
EnsurePopupControl();
- wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list"));
- wxCHECK_MSG(IsValidInsert(pos), -1, wxT("invalid index"));
-
- GetVListBoxComboPopup()->Insert(item,pos);
+ const unsigned int count = items.GetCount();
+ for( unsigned int i = 0; i < count; ++i, ++pos )
+ {
+ GetVListBoxComboPopup()->Insert(items[i], pos);
+ AssignNewItemClientData(pos, clientData, i, type);
+ }
- return pos;
+ return pos - 1;
}
void wxOwnerDrawnComboBox::DoSetItemClientData(unsigned int n, void* clientData)
return GetVListBoxComboPopup()->GetItemClientData(n);
}
-void wxOwnerDrawnComboBox::DoSetItemClientObject(unsigned int n, wxClientData* clientData)
-{
- DoSetItemClientData(n, (void*) clientData);
-}
-
-wxClientData* wxOwnerDrawnComboBox::DoGetItemClientObject(unsigned int n) const
-{
- return (wxClientData*) DoGetItemClientData(n);
-}
-
// ----------------------------------------------------------------------------
// wxOwnerDrawnComboBox item drawing and measuring default implementations
// ----------------------------------------------------------------------------