X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe3d9123c6968b452a95133c635069d6f7ae8ea5..70dc287a3997b65d954bfbd5861f72696bd3dd27:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index f8620938f2..f92b66426a 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -115,6 +115,20 @@ int wxChoice::DoAppend(const wxString& item) return n; } +int wxChoice::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")); + + int n = (int)SendMessage(GetHwnd(), CB_INSERTSTRING, pos, (LONG)item.c_str()); + if ( n == CB_ERR ) + { + wxLogLastError(wxT("SendMessage(CB_INSERTSTRING)")); + } + + return n; +} + void wxChoice::Delete(int n) { wxCHECK_RET( n < GetCount(), wxT("invalid item index in wxChoice::Delete") );