X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a8680e3e0e5066d35a8f4fd43294ba4bfcaf4ba7..a67e6e5438039aee7f0dd37acaea483037c89a62:/src/motif/combobox.cpp diff --git a/src/motif/combobox.cpp b/src/motif/combobox.cpp index ef51038de6..61dce03a2b 100644 --- a/src/motif/combobox.cpp +++ b/src/motif/combobox.cpp @@ -145,6 +145,22 @@ int wxComboBox::DoAppend(const wxString& item) return GetCount() - 1; } +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); + + wxXmString str( item.c_str() ); + XmComboBoxAddItem((Widget) m_mainWidget, str(), pos+1); + m_stringList.Insert(pos, item); + m_noStrings ++; + + return pos; +} + void wxComboBox::Delete(int n) { XmComboBoxDeletePos((Widget) m_mainWidget, n+1);