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

Method PaintButton2

DuiLib/Control/UIScrollBar.cpp:862–900  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

860 }
861
862 void CScrollBarUI::PaintButton2(HDC hDC)
863 {
864 if( !m_bShowButton2 ) return;
865
866 if( !IsEnabled() ) m_uButton2State |= UISTATE_DISABLED;
867 else m_uButton2State &= ~ UISTATE_DISABLED;
868
869 m_sImageModify.Empty();
870 m_sImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), m_rcButton2.left - m_rcItem.left, \
871 m_rcButton2.top - m_rcItem.top, m_rcButton2.right - m_rcItem.left, m_rcButton2.bottom - m_rcItem.top);
872
873 if( (m_uButton2State & UISTATE_DISABLED) != 0 ) {
874 if( !m_sButton2DisabledImage.IsEmpty() ) {
875 if( !DrawImage(hDC, (LPCTSTR)m_sButton2DisabledImage, (LPCTSTR)m_sImageModify) ) m_sButton2DisabledImage.Empty();
876 else return;
877 }
878 }
879 else if( (m_uButton2State & UISTATE_PUSHED) != 0 ) {
880 if( !m_sButton2PushedImage.IsEmpty() ) {
881 if( !DrawImage(hDC, (LPCTSTR)m_sButton2PushedImage, (LPCTSTR)m_sImageModify) ) m_sButton2PushedImage.Empty();
882 else return;
883 }
884 }
885 else if( (m_uButton2State & UISTATE_HOT) != 0 ) {
886 if( !m_sButton2HotImage.IsEmpty() ) {
887 if( !DrawImage(hDC, (LPCTSTR)m_sButton2HotImage, (LPCTSTR)m_sImageModify) ) m_sButton2HotImage.Empty();
888 else return;
889 }
890 }
891
892 if( !m_sButton2NormalImage.IsEmpty() ) {
893 if( !DrawImage(hDC, (LPCTSTR)m_sButton2NormalImage, (LPCTSTR)m_sImageModify) ) m_sButton2NormalImage.Empty();
894 else return;
895 }
896
897 DWORD dwBorderColor = 0xFF85E4FF;
898 int nBorderSize = 2;
899 CRenderEngine::DrawRect(hDC, m_rcButton2, nBorderSize, dwBorderColor);
900 }
901
902 void CScrollBarUI::PaintThumb(HDC hDC)
903 {

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