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

Method PaintStatusImage

DuiLib/Control/UIProgress.cpp:97–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95 }
96
97 void CProgressUI::PaintStatusImage(HDC hDC)
98 {
99 if( m_nMax <= m_nMin ) m_nMax = m_nMin + 1;
100 if( m_nValue > m_nMax ) m_nValue = m_nMax;
101 if( m_nValue < m_nMin ) m_nValue = m_nMin;
102
103 RECT rc = {0};
104 if( m_bHorizontal ) {
105 rc.right = (m_nValue - m_nMin) * (m_rcItem.right - m_rcItem.left) / (m_nMax - m_nMin);
106 rc.bottom = m_rcItem.bottom - m_rcItem.top;
107 }
108 else {
109 rc.top = (m_rcItem.bottom - m_rcItem.top) * (m_nMax - m_nValue) / (m_nMax - m_nMin);
110 rc.right = m_rcItem.right - m_rcItem.left;
111 rc.bottom = m_rcItem.bottom - m_rcItem.top;
112 }
113
114 if( !m_sForeImage.IsEmpty() ) {
115 m_sForeImageModify.Empty();
116 if (m_bStretchForeImage)
117 m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d'"), rc.left, rc.top, rc.right, rc.bottom);
118 else
119 m_sForeImageModify.SmallFormat(_T("dest='%d,%d,%d,%d' source='%d,%d,%d,%d'")
120 , rc.left, rc.top, rc.right, rc.bottom
121 , rc.left, rc.top, rc.right, rc.bottom);
122
123 if( !DrawImage(hDC, (LPCTSTR)m_sForeImage, (LPCTSTR)m_sForeImageModify) ) m_sForeImage.Empty();
124 else return;
125 }
126 }
127
128 bool CProgressUI::IsStretchForeImage()
129 {

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