X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/38400bb46b1477680ec08ed04f2bcafa8de5e3bf..0534259ab803b0edd8692e966947b202cd9e10c0:/src/os2/listbox.cpp diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index e45ad8414b..2c636032e0 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -294,7 +294,7 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items, n = (int)::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)lIndexType, (MPARAM)items[i].wx_str()); if (n < 0) { - wxLogLastError(_T("WinSendMsg(LM_INSERTITEM)")); + wxLogLastError(wxT("WinSendMsg(LM_INSERTITEM)")); n = wxNOT_FOUND; break; } @@ -305,10 +305,9 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items, { wxOwnerDrawn* pNewItem = CreateItem(n); // dummy argument wxScreenDC vDc; // FIXME: is it really needed here? - + pNewItem->SetName(items[i]); m_aItems.Insert(pNewItem, n); - ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, (MPARAM)n, MPFROMP(pNewItem)); pNewItem->SetFont(GetFont()); } #endif @@ -385,17 +384,6 @@ void wxListBox::DoSetItemClientData(unsigned int n, void* pClientData) wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetClientData") ); -#if wxUSE_OWNER_DRAWN - if ( m_windowStyle & wxLB_OWNERDRAW ) - { - // - // Client data must be pointer to wxOwnerDrawn, otherwise we would crash - // in OnMeasure/OnDraw. - // - wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes")); - } -#endif // wxUSE_OWNER_DRAWN - ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, MPFROMLONG(n), MPFROMP(pClientData)); } // end of wxListBox::DoSetItemClientData @@ -714,7 +702,6 @@ bool wxListBox::OS2OnDraw ( ) { POWNERITEM pDrawStruct = (POWNERITEM)pItem; - LONG lItemID = pDrawStruct->idItem; int eAction = 0; int eStatus = 0; @@ -727,17 +714,10 @@ bool wxListBox::OS2OnDraw ( // // The item may be -1 for an empty listbox // - if (lItemID == -1L) + if (pDrawStruct->idItem == -1L) return false; - wxListBoxItem* pData = (wxListBoxItem*)PVOIDFROMMR( ::WinSendMsg( GetHwnd() - ,LM_QUERYITEMHANDLE - ,MPFROMLONG(pDrawStruct->idItem) - ,(MPARAM)0 - ) - ); - - wxCHECK(pData, false ); + wxListBoxItem* pData = (wxListBoxItem*)m_aItems[pDrawStruct->idItem]; wxClientDC vDc(this); wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();