MCPcopy Create free account
hub / github.com/cinience/RedisStudio / PaintText

Method PaintText

DuiLib/Control/UIEdit.cpp:519–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

517 }
518
519 void CEditUI::PaintText(HDC hDC)
520 {
521 if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor();
522 if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor();
523
524 if( m_sText.IsEmpty() ) return;
525
526 CDuiString sText = m_sText;
527 if( m_bPasswordMode ) {
528 sText.Empty();
529 LPCTSTR p = m_sText.GetData();
530 while( *p != _T('\0') ) {
531 sText += m_cPasswordChar;
532 p = ::CharNext(p);
533 }
534 }
535
536 RECT rc = m_rcItem;
537 rc.left += m_rcTextPadding.left;
538 rc.right -= m_rcTextPadding.right;
539 rc.top += m_rcTextPadding.top;
540 rc.bottom -= m_rcTextPadding.bottom;
541 if( IsEnabled() ) {
542 CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwTextColor, \
543 m_iFont, DT_SINGLELINE | m_uTextStyle);
544 }
545 else {
546 CRenderEngine::DrawText(hDC, m_pManager, rc, sText, m_dwDisabledTextColor, \
547 m_iFont, DT_SINGLELINE | m_uTextStyle);
548
549 }
550 }
551}

Callers

nothing calls this directly

Calls 5

GetDefaultFontColorMethod · 0.80
IsEmptyMethod · 0.80
EmptyMethod · 0.45
GetDataMethod · 0.45

Tested by

no test coverage detected