| 301 | } |
| 302 | |
| 303 | void CBarGraph::DoOnPaint(CDC &dc) { |
| 304 | DrawBackground(dc, items_, false, 0); |
| 305 | DrawRange(dc, items_, 0); |
| 306 | |
| 307 | auto pSeq = parent_.GetSequence(); |
| 308 | if (!pSeq) |
| 309 | return; |
| 310 | int Count = pSeq->GetItemCount(); |
| 311 | |
| 312 | const int StepWidth = GetItemWidth(); |
| 313 | const int StepHeight = GetItemHeight(); // // // |
| 314 | const int Top = GetItemTop(); // // // |
| 315 | |
| 316 | if (m_iHighlightedValue > 0 && m_iHighlightedItem >= 0 && m_iHighlightedItem < Count) { |
| 317 | int x = region_.left + m_iHighlightedItem * StepWidth + 1; |
| 318 | int y = Top + StepHeight * (items_ - m_iHighlightedValue); |
| 319 | int w = StepWidth; |
| 320 | int h = StepHeight * m_iHighlightedValue; |
| 321 | DrawShadowRect(dc, x, y, w, h); |
| 322 | } |
| 323 | |
| 324 | // Draw items |
| 325 | for (int i = 0; i < Count; ++i) { |
| 326 | int x = region_.left + i * StepWidth + 1; |
| 327 | int y = Top + StepHeight * (items_ - pSeq->GetItem(i)); |
| 328 | int w = StepWidth; |
| 329 | int h = StepHeight * pSeq->GetItem(i); |
| 330 | |
| 331 | if (parent_.GetCurrentPlayPos() == i) |
| 332 | DrawPlayRect(dc, x, y, w, h); |
| 333 | else if ((m_iHighlightedItem == i) && (pSeq->GetItem(i) >= m_iHighlightedValue)) |
| 334 | DrawCursorRect(dc, x, y, w, h); |
| 335 | else |
| 336 | DrawRect(dc, x, y, w, h); |
| 337 | } |
| 338 | |
| 339 | DrawLine(dc); |
| 340 | } |
| 341 | |
| 342 | |
| 343 |
nothing calls this directly
no test coverage detected