/////////////////////////////////////////////////////////////////////////////
-// Name: choice.cpp
+// Name: src/os2/choice.cpp
// Purpose: wxChoice
// Author: David Webster
// Modified by:
return((int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0)));
} // end of wxChoice::GetCount
-int wxChoice::FindString(
- const wxString& rsStr
-) const
+void wxChoice::SetString( int n, const wxString& rsStr )
{
- int nPos;
- int nTextLength;
- PSZ zStr;
- int nItemCount;
-
- nItemCount = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMCOUNT, (MPARAM)0, (MPARAM)0));
- for (nPos = 0; nPos < nItemCount; nPos++)
- {
- nTextLength = (int)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
- zStr = new char[nTextLength + 1];
- ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)nPos, (SHORT)nTextLength), (MPARAM)zStr);
- if (rsStr == (wxChar*)zStr)
- {
- delete [] zStr;
- break;
- }
- delete [] zStr;
- }
- return nPos;
-} // end of wxChoice::FindString
-
-void wxChoice::SetString(
- int n
-, const wxString& rsStr
-)
-{
- LONG nIndexType = 0;
- void* pData;
+ LONG nIndexType = 0;
+ void* pData;
if ( m_clientDataItemsType != wxClientData_None )
{
}
} // end of wxChoice::SetString
-wxString wxChoice::GetString(
- int n
-) const
+wxString wxChoice::GetString(int n) const
{
- int nLen = 0;
- wxString sStr = wxEmptyString;
- wxChar* zBuf;
+ int nLen = 0;
+ wxString sStr = wxEmptyString;
+ wxChar* zBuf;
nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
if (nLen != LIT_ERROR && nLen > 0)