X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a756f210019dd5b51331b7181c816d3882146a30..7b35aa40a06a160ae4a8650c5820880a020697e3:/src/msw/choice.cpp?ds=sidebyside diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 8ef52dbcff..f57a180cac 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -191,25 +191,31 @@ int wxChoice::FindString(const wxString& s) const #endif // Watcom/!Watcom } -void wxChoice::SetString(int WXUNUSED(n), const wxString& WXUNUSED(s)) +void wxChoice::SetString(int n, const wxString& s) { - wxFAIL_MSG(wxT("not implemented")); - -#if 0 // should do this, but no Insert() so far - Delete(n); - Insert(n + 1, s); -#endif + wxCHECK_RET( (n>=0)&&(n 0 ) + { + if ( ::SendMessage + ( + GetHwnd(), + CB_GETLBTEXT, + n, + (LPARAM)(wxChar *)wxStringBuffer(str, len) + ) == CB_ERR ) + { wxLogLastError(wxT("SendMessage(CB_GETLBTEXT)")); } + str.UngetWriteBuf(); } @@ -283,6 +289,7 @@ void wxChoice::DoSetSize(int x, int y, // wxWindows interpretation is different; also, getting the size returns // the _displayed_ size (NOT the drop down menu size) so // setting-getting-setting size would not work. + wxControl::DoSetSize(x, y, width, -1, sizeFlags); }