| 806 | } |
| 807 | |
| 808 | Highlight CLogView::GetSelectionHighlight(CDCHandle dc, int iItem) const |
| 809 | { |
| 810 | auto rect = GetSubItemRect(iItem, ColumnToSubItem(Column::Message), LVIR_BOUNDS); |
| 811 | auto dragStart = m_dragStart; |
| 812 | dragStart.x -= GetScrollPos(SB_HORZ); |
| 813 | auto dragEnd = m_dragEnd; |
| 814 | dragEnd.x -= GetScrollPos(SB_HORZ); |
| 815 | if (!m_dragging || !Contains(rect, dragStart)) |
| 816 | return Highlight(0, 0, 0, TextColor(0, 0)); |
| 817 | |
| 818 | int x1 = std::min(dragStart.x, dragEnd.x); |
| 819 | int x2 = std::max(dragStart.x, dragEnd.x); |
| 820 | |
| 821 | int begin = GetTextIndex(dc, iItem, x1); |
| 822 | int end = GetTextIndex(dc, iItem, x2); |
| 823 | return Highlight(0, begin, end, TextColor(Colors::Selection, Colors::Text)); |
| 824 | } |
| 825 | |
| 826 | void CLogView::DrawSubItem(CDCHandle dc, int iItem, int iSubItem, const ItemData& data) const |
| 827 | { |