- m_noItems = choices.GetCount();
- int i;
- for (i = 0; i < m_noItems; i++)
- {
- ListBox_AddString(GetHwnd(), choices[i]);
- if ( clientData )
- {
- SetClientData(i, clientData[i]);
- }
- }
-
-#if wxUSE_OWNER_DRAWN
- if ( m_windowStyle & wxLB_OWNERDRAW ) {
- // first delete old items
- WX_CLEAR_ARRAY(m_aItems);
-
- // then create new ones
- for ( size_t ui = 0; ui < (size_t)m_noItems; ui++ ) {
- wxOwnerDrawn *pNewItem = CreateLboxItem(ui);
- pNewItem->SetName(choices[ui]);
- m_aItems.Add(pNewItem);
- ListBox_SetItemData(GetHwnd(), ui, pNewItem);
- }
- }
-#endif // wxUSE_OWNER_DRAWN
-
- SetHorizontalExtent();
-
- if ( hideAndShow )
- {
- // show the listbox back if we hid it
- ShowWindow(GetHwnd(), SW_SHOW);
- }
-}
-
-int wxListBox::FindString(const wxString& s) const
-{
- int pos = ListBox_FindStringExact(GetHwnd(), (WPARAM)-1, s);