Correct wxCheckListBox insertion.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba 2006-02-26 02:00:46 +00:00
parent 553f7d8f56
commit c5491b21d9

View File

@ -286,9 +286,18 @@ wxClientData* wxCheckListBox::DoGetItemClientObject(int n) const
void wxCheckListBox::DoInsertItems(const wxArrayString& items, int pos)
{
wxCHECK_RET( pos >= 0 && pos <= GetCount(),
wxT("invalid index in wxListBox::InsertItems") );
for( size_t i = 0; i < items.GetCount(); i++ )
{
Insert(items[i],pos+i);
LVITEM newItem;
wxZeroMemory(newItem);
newItem.iItem = i+pos;
int ret = ListView_InsertItem( (HWND)GetHWND(), & newItem );
wxASSERT_MSG( int(i+pos) == ret , _T("Item not added") );
SetString( ret , items[i] );
m_itemsClientData.Insert(NULL, ret);
}
}