| 340 | } |
| 341 | |
| 342 | void CButtonUI::PaintText(HDC hDC) |
| 343 | { |
| 344 | if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED; |
| 345 | else m_uButtonState &= ~ UISTATE_FOCUSED; |
| 346 | if( !IsEnabled() ) m_uButtonState |= UISTATE_DISABLED; |
| 347 | else m_uButtonState &= ~ UISTATE_DISABLED; |
| 348 | |
| 349 | if( m_dwTextColor == 0 ) m_dwTextColor = m_pManager->GetDefaultFontColor(); |
| 350 | if( m_dwDisabledTextColor == 0 ) m_dwDisabledTextColor = m_pManager->GetDefaultDisabledColor(); |
| 351 | |
| 352 | if( m_sText.IsEmpty() ) return; |
| 353 | int nLinks = 0; |
| 354 | RECT rc = m_rcItem; |
| 355 | rc.left += m_rcTextPadding.left; |
| 356 | rc.right -= m_rcTextPadding.right; |
| 357 | rc.top += m_rcTextPadding.top; |
| 358 | rc.bottom -= m_rcTextPadding.bottom; |
| 359 | |
| 360 | DWORD clrColor = IsEnabled()?m_dwTextColor:m_dwDisabledTextColor; |
| 361 | |
| 362 | if( ((m_uButtonState & UISTATE_PUSHED) != 0) && (GetPushedTextColor() != 0) ) |
| 363 | clrColor = GetPushedTextColor(); |
| 364 | else if( ((m_uButtonState & UISTATE_HOT) != 0) && (GetHotTextColor() != 0) ) |
| 365 | clrColor = GetHotTextColor(); |
| 366 | else if( ((m_uButtonState & UISTATE_FOCUSED) != 0) && (GetFocusedTextColor() != 0) ) |
| 367 | clrColor = GetFocusedTextColor(); |
| 368 | |
| 369 | if( m_bShowHtml ) |
| 370 | CRenderEngine::DrawHtmlText(hDC, m_pManager, rc, m_sText, clrColor, \ |
| 371 | NULL, NULL, nLinks, m_uTextStyle); |
| 372 | else |
| 373 | CRenderEngine::DrawText(hDC, m_pManager, rc, m_sText, clrColor, \ |
| 374 | m_iFont, m_uTextStyle); |
| 375 | } |
| 376 | |
| 377 | void CButtonUI::PaintStatusImage(HDC hDC) |
| 378 | { |
nothing calls this directly
no test coverage detected