X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2ca829e7dc84e32a0949cbd852adf9b59cacd0b..0d1cb8cb298ae68754575cb65695ff9567a36899:/src/univ/combobox.cpp?ds=sidebyside diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 4f7263b30c..4c122a1904 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -125,7 +125,7 @@ public: virtual bool SetSelection(const wxString& value); virtual wxControl *GetControl() { return this; } virtual void OnShow(); - virtual wxCoord wxComboListBox::GetBestWidth() const; + virtual wxCoord GetBestWidth() const; protected: // we shouldn't return height too big from here @@ -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);