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

Method PaintStatusImage

DuiLib/Control/UIList.cpp:1488–1522  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1486}
1487
1488void CListHeaderItemUI::PaintStatusImage(HDC hDC)
1489{
1490 if( IsFocused() ) m_uButtonState |= UISTATE_FOCUSED;
1491 else m_uButtonState &= ~ UISTATE_FOCUSED;
1492
1493 if( (m_uButtonState & UISTATE_PUSHED) != 0 ) {
1494 if( m_sPushedImage.IsEmpty() && !m_sNormalImage.IsEmpty() ) DrawImage(hDC, (LPCTSTR)m_sNormalImage);
1495 if( !DrawImage(hDC, (LPCTSTR)m_sPushedImage) ) m_sPushedImage.Empty();
1496 }
1497 else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
1498 if( m_sHotImage.IsEmpty() && !m_sNormalImage.IsEmpty() ) DrawImage(hDC, (LPCTSTR)m_sNormalImage);
1499 if( !DrawImage(hDC, (LPCTSTR)m_sHotImage) ) m_sHotImage.Empty();
1500 }
1501 else if( (m_uButtonState & UISTATE_FOCUSED) != 0 ) {
1502 if( m_sFocusedImage.IsEmpty() && !m_sNormalImage.IsEmpty() ) DrawImage(hDC, (LPCTSTR)m_sNormalImage);
1503 if( !DrawImage(hDC, (LPCTSTR)m_sFocusedImage) ) m_sFocusedImage.Empty();
1504 }
1505 else {
1506 if( !m_sNormalImage.IsEmpty() ) {
1507 if( !DrawImage(hDC, (LPCTSTR)m_sNormalImage) ) m_sNormalImage.Empty();
1508 }
1509 }
1510
1511 if( !m_sSepImage.IsEmpty() ) {
1512 RECT rcThumb = GetThumbRect();
1513 rcThumb.left -= m_rcItem.left;
1514 rcThumb.top -= m_rcItem.top;
1515 rcThumb.right -= m_rcItem.left;
1516 rcThumb.bottom -= m_rcItem.top;
1517
1518 m_sSepImageModify.Empty();
1519 m_sSepImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rcThumb.left, rcThumb.top, rcThumb.right, rcThumb.bottom);
1520 if( !DrawImage(hDC, (LPCTSTR)m_sSepImage, (LPCTSTR)m_sSepImageModify) ) m_sSepImage.Empty();
1521 }
1522}
1523
1524void CListHeaderItemUI::PaintText(HDC hDC)
1525{

Callers

nothing calls this directly

Calls 4

DrawImageFunction · 0.85
IsEmptyMethod · 0.80
SmallFormatMethod · 0.80
EmptyMethod · 0.45

Tested by

no test coverage detected