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

Method PaintRail

DuiLib/Control/UIScrollBar.cpp:941–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

939 }
940
941 void CScrollBarUI::PaintRail(HDC hDC)
942 {
943 if( m_rcThumb.left == 0 && m_rcThumb.top == 0 && m_rcThumb.right == 0 && m_rcThumb.bottom == 0 ) return;
944 if( !IsEnabled() ) m_uThumbState |= UISTATE_DISABLED;
945 else m_uThumbState &= ~ UISTATE_DISABLED;
946
947 m_sImageModify.Empty();
948 if( !m_bHorizontal ) {
949 m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), m_rcThumb.left - m_rcItem.left, \
950 (m_rcThumb.top + m_rcThumb.bottom) / 2 - m_rcItem.top - m_cxyFixed.cx / 2, \
951 m_rcThumb.right - m_rcItem.left, \
952 (m_rcThumb.top + m_rcThumb.bottom) / 2 - m_rcItem.top + m_cxyFixed.cx - m_cxyFixed.cx / 2);
953 }
954 else {
955 m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), \
956 (m_rcThumb.left + m_rcThumb.right) / 2 - m_rcItem.left - m_cxyFixed.cy / 2, \
957 m_rcThumb.top - m_rcItem.top, \
958 (m_rcThumb.left + m_rcThumb.right) / 2 - m_rcItem.left + m_cxyFixed.cy - m_cxyFixed.cy / 2, \
959 m_rcThumb.bottom - m_rcItem.top);
960 }
961
962 if( (m_uThumbState & UISTATE_DISABLED) != 0 ) {
963 if( !m_sRailDisabledImage.IsEmpty() ) {
964 if( !DrawImage(hDC, (LPCTSTR)m_sRailDisabledImage, (LPCTSTR)m_sImageModify) ) m_sRailDisabledImage.Empty();
965 else return;
966 }
967 }
968 else if( (m_uThumbState & UISTATE_PUSHED) != 0 ) {
969 if( !m_sRailPushedImage.IsEmpty() ) {
970 if( !DrawImage(hDC, (LPCTSTR)m_sRailPushedImage, (LPCTSTR)m_sImageModify) ) m_sRailPushedImage.Empty();
971 else return;
972 }
973 }
974 else if( (m_uThumbState & UISTATE_HOT) != 0 ) {
975 if( !m_sRailHotImage.IsEmpty() ) {
976 if( !DrawImage(hDC, (LPCTSTR)m_sRailHotImage, (LPCTSTR)m_sImageModify) ) m_sRailHotImage.Empty();
977 else return;
978 }
979 }
980
981 if( !m_sRailNormalImage.IsEmpty() ) {
982 if( !DrawImage(hDC, (LPCTSTR)m_sRailNormalImage, (LPCTSTR)m_sImageModify) ) m_sRailNormalImage.Empty();
983 else return;
984 }
985 }
986}

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected