| 756 | } |
| 757 | |
| 758 | void DrawHighlightedText(HDC hdc, const RECT& rect, std::wstring text, std::vector<Highlight> highlights, const Highlight& selection) |
| 759 | { |
| 760 | InsertHighlight(highlights, selection); |
| 761 | |
| 762 | AddEllipsis(hdc, text, rect.right - rect.left); |
| 763 | |
| 764 | int height = GetTextSize(hdc, text, text.size()).cy; |
| 765 | POINT pos = { rect.left, rect.top + (rect.bottom - rect.top - height)/2 }; |
| 766 | RECT rcHighlight = rect; |
| 767 | for (auto& highlight : highlights) |
| 768 | { |
| 769 | rcHighlight.right = rect.left + GetTextSize(hdc, text, highlight.begin).cx; |
| 770 | ExtTextOut(hdc, pos, rcHighlight, text); |
| 771 | |
| 772 | rcHighlight.left = rcHighlight.right; |
| 773 | rcHighlight.right = rect.left + GetTextSize(hdc, text, highlight.end).cx; |
| 774 | { |
| 775 | Win32::ScopedTextColor txtcol(hdc, highlight.color.fore); |
| 776 | Win32::ScopedBkColor bkcol(hdc, highlight.color.back); |
| 777 | ExtTextOut(hdc, pos, rcHighlight, text); |
| 778 | } |
| 779 | rcHighlight.left = rcHighlight.right; |
| 780 | } |
| 781 | rcHighlight.right = rect.right; |
| 782 | ExtTextOut(hdc, pos, rcHighlight, text); |
| 783 | } |
| 784 | |
| 785 | void CLogView::DrawBookmark(CDCHandle dc, int iItem) const |
| 786 | { |
no test coverage detected