-// change the state of the item and redraw it
-void wxCheckListBoxItem::Check(bool check)
-{
- m_bChecked = check;
-
- // index may be changed because new items were added/deleted
- if ( m_pParent->GetItemIndex(this) != (int)m_nIndex )
- {
- // update it
- int index = m_pParent->GetItemIndex(this);
-
- wxASSERT_MSG( index != wxNOT_FOUND, wxT("what does this item do here?") );
-
- m_nIndex = (size_t)index;
- }
-
- HWND hwndListbox = (HWND)m_pParent->GetHWND();
-
- RECT rcUpdate;
-
- if ( ::SendMessage(hwndListbox, LB_GETITEMRECT,
- m_nIndex, (LPARAM)&rcUpdate) == LB_ERR )
- {
- wxLogDebug(wxT("LB_GETITEMRECT failed"));
- }
-
- ::InvalidateRect(hwndListbox, &rcUpdate, FALSE);
-}
-
-// send an "item checked" event
-void wxCheckListBoxItem::SendEvent()
-{
- wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, m_pParent->GetId());
- event.SetInt(m_nIndex);
- event.SetEventObject(m_pParent);
- event.SetString(m_pParent->GetString(m_nIndex));
- m_pParent->ProcessCommand(event);
-}
-