]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/combobox.cpp
compilation fix for Mac and reformatted the code
[wxWidgets.git] / src / univ / combobox.cpp
index 554986b03330f7c5783c48b9ca4aff5071e5d34c..4c122a19045fbb603486845e89a211a0afc1ad63 100644 (file)
@@ -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);