-void wxListBox::DoInsertItems(const wxArrayString& asItems, unsigned int nPos)
-{
- wxCHECK_RET( IsValidInsert(nPos),
- wxT("invalid index in wxListBox::InsertItems") );
-
- unsigned int nItems = asItems.GetCount();
-
- for (unsigned int i = 0; i < nItems; i++)
- {
- int nIndex = (int)::WinSendMsg( GetHwnd(),
- LM_INSERTITEM,
- MPFROMLONG((LONG)(i + nPos)),
- (MPARAM)asItems[i].char_str() );
-
- wxOwnerDrawn* pNewItem = CreateItem(nIndex);
-
- pNewItem->SetName(asItems[i]);
- pNewItem->SetFont(GetFont());
- m_aItems.Insert(pNewItem, nIndex);
- ::WinSendMsg( GetHwnd()
- ,LM_SETITEMHANDLE
- ,(MPARAM)((LONG)nIndex)
- ,MPFROMP(pNewItem)
- );
- m_nNumItems += nItems;
- }
-} // end of wxListBox::DoInsertItems
-