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

Method DrawItemText

RedisStudio/DuiEx/UIMenu.cpp:508–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508void CMenuElementUI::DrawItemText(HDC hDC, const RECT& rcItem)
509{
510 if( m_sText.IsEmpty() ) return;
511
512 if( m_pOwner == NULL ) return;
513 TListInfoUI* pInfo = m_pOwner->GetListInfo();
514 DWORD iTextColor = pInfo->dwTextColor;
515 if( (m_uButtonState & UISTATE_HOT) != 0 ) {
516 iTextColor = pInfo->dwHotTextColor;
517 }
518 if( IsSelected() ) {
519 iTextColor = pInfo->dwSelectedTextColor;
520 }
521 if( !IsEnabled() ) {
522 iTextColor = pInfo->dwDisabledTextColor;
523 }
524 int nLinks = 0;
525 RECT rcText = rcItem;
526 rcText.left += pInfo->rcTextPadding.left;
527 rcText.right -= pInfo->rcTextPadding.right;
528 rcText.top += pInfo->rcTextPadding.top;
529 rcText.bottom -= pInfo->rcTextPadding.bottom;
530
531 if( pInfo->bShowHtml )
532 CRenderEngine::DrawHtmlText(hDC, m_pManager, rcText, m_sText, iTextColor, \
533 NULL, NULL, nLinks, DT_SINGLELINE | pInfo->uTextStyle);
534 else
535 CRenderEngine::DrawText(hDC, m_pManager, rcText, m_sText, iTextColor, \
536 pInfo->nFont, DT_SINGLELINE | pInfo->uTextStyle);
537}
538
539
540SIZE CMenuElementUI::EstimateSize(SIZE szAvailable)

Callers

nothing calls this directly

Calls 2

IsEmptyMethod · 0.80
GetListInfoMethod · 0.45

Tested by

no test coverage detected