X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c18670e45c5eb721f82c9c3f238500084810793b..245f35816d761212279e8cf223475efb7a367553:/src/univ/combobox.cpp diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 554986b033..4c122a1904 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -825,6 +825,18 @@ int wxComboBox::DoAppend(const wxString& item) return GetLBox()->Append(item); } +int wxComboBox::DoInsert(const wxString& item, int pos) +{ + wxCHECK_MSG(!(GetWindowStyle() & wxCB_SORT), -1, wxT("can't insert into sorted list")); + wxCHECK_MSG((pos>=0) && (pos<=GetCount()), -1, wxT("invalid index")); + + if (pos == GetCount()) + return DoAppend(item); + + GetLBox()->Insert(item, pos); + return pos; +} + void wxComboBox::DoSetItemClientData(int n, void* clientData) { GetLBox()->SetClientData(n, clientData);