Fixed problem in InsertItems of always adding ownerdraw data even when
not an ownerdrawn listbox. If some items were already appended then the indexes would not match. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -516,12 +516,15 @@ wxListBox::DoInsertItems(const wxArrayString& items, int pos)
|
|||||||
int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);
|
int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]);
|
||||||
|
|
||||||
#if wxUSE_OWNER_DRAWN
|
#if wxUSE_OWNER_DRAWN
|
||||||
wxOwnerDrawn *pNewItem = CreateItem(idx);
|
if ( m_windowStyle & wxLB_OWNERDRAW )
|
||||||
pNewItem->SetName(items[i]);
|
{
|
||||||
pNewItem->SetFont(GetFont());
|
wxOwnerDrawn *pNewItem = CreateItem(idx);
|
||||||
m_aItems.Insert(pNewItem, idx);
|
pNewItem->SetName(items[i]);
|
||||||
|
pNewItem->SetFont(GetFont());
|
||||||
|
m_aItems.Insert(pNewItem, idx);
|
||||||
|
|
||||||
ListBox_SetItemData(GetHwnd(), idx, pNewItem);
|
ListBox_SetItemData(GetHwnd(), idx, pNewItem);
|
||||||
|
}
|
||||||
#endif // wxUSE_OWNER_DRAWN
|
#endif // wxUSE_OWNER_DRAWN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user