void wxComboBox::SetString(unsigned int n, const wxString& s) { // Notice that we shouldn't delete and insert the item in this control // itself as this would also affect the client data which we need to // preserve here. GetComboPeer()->RemoveItem(n); GetComboPeer()->InsertItem(n, s); SetValue(s); // changing the item in the list won't update the display item }
int wxComboBox::FindString(const wxString& s, bool bCase) const { if (!bCase) { for (unsigned i = 0; i < GetCount(); i++) { if (s.IsSameAs(GetString(i), false)) return i; } return wxNOT_FOUND; } return GetComboPeer()->FindString(s); }
int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items, unsigned int pos, void **clientData, wxClientDataType type) { const unsigned int numItems = items.GetCount(); for( unsigned int i = 0; i < numItems; ++i, ++pos ) { unsigned int idx; idx = pos; GetComboPeer()->InsertItem( idx, items[i] ); if (idx > m_datas.GetCount()) m_datas.SetCount(idx); m_datas.Insert( NULL, idx ); AssignNewItemClientData(idx, clientData, i, type); } GetPeer()->SetMaximum( GetCount() ); return pos - 1; }
wxString wxComboBox::GetString(unsigned int n) const { wxCHECK_MSG( n < GetCount(), wxString(), "Invalid combobox index" ); return GetComboPeer()->GetStringAtIndex(n); }
void wxComboBox::SetSelection(int n) { GetComboPeer()->SetSelectedItem(n); }
int wxComboBox::GetSelection() const { return GetComboPeer()->GetSelectedItem(); }
void wxComboBox::DoClear() { GetComboPeer()->Clear(); }
void wxComboBox::DoDeleteOneItem(unsigned int n) { GetComboPeer()->RemoveItem(n); }
unsigned int wxComboBox::GetCount() const { return GetComboPeer()->GetNumberOfItems(); }
wxString wxComboBox::GetString(unsigned int n) const { return GetComboPeer()->GetStringAtIndex(n); }
void wxComboBox::Dismiss() { GetComboPeer()->Dismiss(); }
void wxComboBox::Popup() { GetComboPeer()->Popup(); }
void wxComboBox::DoClear() { m_datas.Clear(); GetComboPeer()->Clear(); }
void wxComboBox::DoDeleteOneItem(unsigned int n) { m_datas.RemoveAt(n); GetComboPeer()->RemoveItem(n); }