Weekly updates.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2002-11-27 05:50:21 +00:00
parent ba75150d36
commit 88ecce35e8
6 changed files with 90 additions and 97 deletions

View File

@@ -173,37 +173,8 @@ void wxComboBox::SetValue(
const wxString& rsValue
)
{
//
// If newlines are denoted by just 10, must stick 13 in front.
//
int nSingletons = 0;
int nLen = rsValue.Length();
int i;
for (i = 0; i < nLen; i ++)
{
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
nSingletons ++;
}
if (nSingletons > 0)
{
wxChar* zTmp = new wxChar[nLen + nSingletons + 1];
int j = 0;
for (i = 0; i < nLen; i ++)
{
if ((i > 0) && (rsValue[i] == 10) && (rsValue[i - 1] != 13))
{
zTmp[j] = 13;
j++;
}
zTmp[j] = rsValue[i];
j++;
}
zTmp[j] = 0;
::WinSetWindowText(GetHwnd(), zTmp);
delete[] zTmp;
}
if ( HasFlag(wxCB_READONLY) )
SetStringSelection(rsValue);
else
::WinSetWindowText(GetHwnd(), rsValue.c_str());
} // end of wxComboBox::SetValue