X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d6959d6f9edf9ac65d2944549ad75302c8f19b9b..0c8b041f147ff9bb6ce38f0e2da1fd82f6484523:/src/msw/choice.cpp diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index b7feab4c5b..a243f36fb0 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -141,7 +141,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent, return false; // now create the real HWND - if ( !MSWCreateControl(wxT("COMBOBOX"), _T(""), pos, size) ) + if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) ) return false; @@ -335,12 +335,12 @@ int wxChoice::FindString(const wxString& s) const #else // !Watcom //TODO: Evidently some MSW versions (all?) don't like empty strings //passed to SendMessage, so we have to do it ourselves in that case - if ( s.size() == 0 ) + if ( s.empty() ) { int count = GetCount(); for ( int i = 0; i < count; i++ ) { - if ( GetString(i).size() == 0 ) + if ( GetString(i).empty() ) return i; } @@ -350,7 +350,7 @@ int wxChoice::FindString(const wxString& s) const { int pos = (int)SendMessage(GetHwnd(), CB_FINDSTRINGEXACT, (WPARAM)-1, (LPARAM)s.c_str()); - + return pos == LB_ERR ? wxNOT_FOUND : pos; } #endif // Watcom/!Watcom @@ -507,10 +507,10 @@ void wxChoice::DoSetSize(int x, int y, else { // We cannot pass wxDefaultCoord as height to wxControl. wxControl uses - // wxGetWindowRect() to determine the current height of the combobox, - // and then again sets the combobox's height to that value. Unfortunately, - // wxGetWindowRect doesn't include the dropdown list's height (at least - // on Win2K), so this would result in a combobox with dropdown height of + // wxGetWindowRect() to determine the current height of the combobox, + // and then again sets the combobox's height to that value. Unfortunately, + // wxGetWindowRect doesn't include the dropdown list's height (at least + // on Win2K), so this would result in a combobox with dropdown height of // 1 pixel. We have to determine the default height ourselves and call // wxControl with that value instead. int w, h; @@ -518,7 +518,7 @@ void wxChoice::DoSetSize(int x, int y, DoGetSize(&w, &h); if (::SendMessage(GetHwnd(), CB_GETDROPPEDCONTROLRECT, 0, (LPARAM) &r) != 0) { - height = h + r.bottom - r.top; + height = h + r.bottom - r.top; } }