void CUndoListBox::OnMouseMove(UINT nFlags, CPoint point) { CListBox::OnMouseMove(nFlags, point); BOOL bOutside; int iItem = ItemFromPoint(point, bOutside); if (!bOutside) { SelItemRange(FALSE, iItem + 1, GetCount() - 1); if (iItem == 0) { SetSel(0); } else { SelItemRange(TRUE, 0, iItem); } CString strLabel; strLabel.Format(_T("Undo %d Actions"), iItem + 1); m_Bar.SetLabel(strLabel); } }
void CListBoxCtrl::ClearSelections() { if (!multiSelection) { SetCurSel(-1); } else { int nItem = GetCount(); if (nItem > 0) { SelItemRange(FALSE, 0, nItem - 1); } } }