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

Method OnDblClick

DebugView++/LogView.cpp:609–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

607}
608
609LRESULT CLogView::OnDblClick(NMHDR* pnmh)
610{
611 auto& nmhdr = *reinterpret_cast<NMITEMACTIVATE*>(pnmh);
612
613 if (SubItemToColumn(nmhdr.iSubItem) != Column::Message || nmhdr.iItem < 0 || static_cast<size_t>(nmhdr.iItem) >= m_logLines.size())
614 return 0;
615
616 int nFit = GetTextIndex(nmhdr.iItem, nmhdr.ptAction.x);
617 auto text = TabsToSpaces(GetItemWText(nmhdr.iItem, ColumnToSubItem(Column::Message)));
618
619 int begin = nFit;
620 while (begin > 0)
621 {
622 if (!iswordchar(text[begin - 1]))
623 break;
624 --begin;
625 }
626 int end = nFit;
627 while (end < static_cast<int>(text.size()))
628 {
629 if (!iswordchar(text[end]))
630 break;
631 ++end;
632 }
633 SetHighlightText(std::wstring(text.begin() + begin, text.begin() + end));
634 return 0;
635}
636
637LRESULT CLogView::OnItemChanged(NMHDR* pnmh)
638{

Callers

nothing calls this directly

Calls 3

TabsToSpacesFunction · 0.85
iswordcharFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected