-void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
-{
- wxCHECK_RET( pos >= 0 && pos <= m_noItems,
- wxT("invalid index in wxListBox::InsertItems") );
-
- int i;
-// for (i = 0; i < nItems; i++)
-// ListBox_InsertString(GetHwnd(), i + pos, items[i]);
- m_noItems += nItems;
-
- SetHorizontalExtent(wxT(""));
-}
-
-void wxListBox::SetString(int N, const wxString& s)
-{
- wxCHECK_RET( N >= 0 && N < m_noItems,
- wxT("invalid index in wxListBox::SetString") );
-
- int sel = -1;
- if (!(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED))
- sel = GetSelection();
-
- void *oldData = wxListBox::GetClientData(N);
-
-// SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);
-
- int newN = N;
- if (N == (m_noItems - 1))
- newN = -1;
-
-// SendMessage(GetHwnd(), LB_INSERTSTRING, newN, (LPARAM) (const wxChar *)s);
- if (oldData)
- wxListBox::SetClientData(N, oldData);
-
- // Selection may have changed
- if (sel >= 0)
- SetSelection(sel);
-
-#if wxUSE_OWNER_DRAWN
- if ( m_windowStyle & wxLB_OWNERDRAW )
- // update item's text
- m_aItems[N]->SetName(s);
-#endif //USE_OWNER_DRAWN
-}
-
-int wxListBox::Number () const
-{
- return m_noItems;
-}
-
-// For single selection items only
-wxString wxListBox::GetStringSelection () const
-{
- int sel = GetSelection ();
- if (sel > -1)
- return this->GetString (sel);
- else
- return wxString("");
-}
-
-bool wxListBox::SetStringSelection (const wxString& s, bool flag)
-{
- int sel = FindString (s);
- if (sel > -1)
- {
- SetSelection (sel, flag);
- return TRUE;
- }
- else
- return FALSE;
-}