- if ( ListBox_SetItemData(GetHwnd(), N, Client_data) == LB_ERR )
- wxLogDebug(_T("LB_SETITEMDATA failed"));
+void wxListBox::DoSetItemClientData(int n, void *clientData)
+{
+ wxCHECK_RET( n >= 0 && n < m_noItems,
+ 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
+
+ if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR )
+ wxLogDebug(wxT("LB_SETITEMDATA failed"));
+}
+
+bool wxListBox::HasMultipleSelection() const
+{
+ return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);