MCPcopy Create free account
hub / github.com/CobaltFusion/DebugViewPP / OnLButtonUp

Method OnLButtonUp

DebugView++/LogView.cpp:527–563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

525}
526
527void CLogView::OnLButtonUp(UINT /*flags*/, CPoint point)
528{
529 SetMsgHandled(false);
530
531 if (m_scrollX)
532 KillTimer(1);
533
534 if (!m_dragging)
535 return;
536
537 m_dragging = false;
538
539 auto dragStart = m_dragStart;
540 dragStart.x -= GetScrollPos(SB_HORZ);
541
542 if (abs(point.x - dragStart.x) <= GetSystemMetrics(SM_CXDRAG) &&
543 abs(point.y - dragStart.y) <= GetSystemMetrics(SM_CYDRAG))
544 return;
545
546 LVHITTESTINFO info;
547 info.flags = 0;
548 info.pt = dragStart;
549 SubItemHitTest(&info);
550 int x1 = std::min(dragStart.x, point.x);
551 int x2 = std::max(dragStart.x, point.x);
552 m_dragStart = CPoint();
553 m_dragEnd = CPoint();
554 ReleaseCapture();
555 Invalidate();
556
557 if ((info.flags & LVHT_ONITEM) == 0 || SubItemToColumn(info.iSubItem) != Column::Message)
558 return;
559
560 int begin = GetTextIndex(info.iItem, x1);
561 int end = GetTextIndex(info.iItem, x2);
562 SetHighlightText(TabsToSpaces(GetItemWText(info.iItem, ColumnToSubItem(Column::Message))).substr(begin, end - begin));
563}
564
565void CLogView::OnTimer(UINT_PTR nIDEvent)
566{

Callers

nothing calls this directly

Calls 1

TabsToSpacesFunction · 0.85

Tested by

no test coverage detected