- size_t len = 0; // TODO: (size_t)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0);
- wxString str = "";
- // TODO:
- /*
- if (len) {
- if ( ::SendMessage(GetHwnd(), CB_GETLBTEXT, n,
- (LPARAM)str.GetWriteBuf(len)) == CB_ERR ) {
- wxLogLastError("SendMessage(CB_GETLBTEXT)");
- }
- str.UngetWriteBuf();
+ SHORT nIndexType = 0;
+
+ ::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, 0);
+
+ if (m_windowStyle & wxLB_SORT)
+ nIndexType = LIT_SORTASCENDING;
+ else
+ nIndexType = LIT_END;
+ ::WinSendMsg( GetHwnd()
+ ,LM_INSERTITEM
+ ,(MPARAM)nIndexType
+ ,(MPARAM)rsStr.c_str()
+ );
+} // end of wxChoice::SetString
+
+wxString wxChoice::GetString(
+ int n
+) const
+{
+ size_t nLen = 0;
+ wxString sStr = "";
+ char* zBuf;
+
+ nLen = (size_t)LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
+ if (nLen)
+ {
+ zBuf = new char[nLen + 1];
+ ::WinSendMsg( GetHwnd()
+ ,LM_QUERYITEMTEXT
+ ,MPFROM2SHORT((SHORT)n, (SHORT)nLen)
+ ,(MPARAM)zBuf
+ );
+ sStr = zBuf;
+ delete [] zBuf;