MCPcopy Create free account
hub / github.com/BeneficialCode/WinArk / DrawNumber

Method DrawNumber

WinArk/HexControl.cpp:505–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505void CHexControl::DrawNumber(CDCHandle dc, int64_t offset, uint64_t value, int digitsChanged) {
506 auto pos = GetPointFromOffset(offset);
507 CString temp = FormatNumber(value);
508 HideCaret();
509 bool selected = false;
510 dc.SetTextColor(selected ? ::GetSysColor(COLOR_HIGHLIGHTTEXT) : m_Colors.Text);
511 dc.SetBkColor(selected ? ::GetSysColor(COLOR_HIGHLIGHT) : ::GetSysColor(COLOR_WINDOW));
512 if (digitsChanged < m_DataSize * 2)
513 dc.TextOut(pos.x, pos.y, temp, m_DataSize * 2);
514 dc.SetTextColor(RGB(255, 0, 0));
515 dc.TextOut(pos.x + m_CharWidth * (m_DataSize * 2 - digitsChanged), pos.y,
516 temp.Right(digitsChanged), digitsChanged);
517 ShowCaret();
518}
519
520void CHexControl::UpdateCaret() {
521 auto pt = GetPointFromOffset(m_CaretOffset);

Callers

nothing calls this directly

Calls 1

SetTextColorMethod · 0.80

Tested by

no test coverage detected