| 196 | |
| 197 | |
| 198 | void SListView::OnPaint(IRenderTarget *pRT) |
| 199 | { |
| 200 | if(m_bDataSetInvalidated) |
| 201 | { |
| 202 | UpdateVisibleItems(); |
| 203 | m_bDataSetInvalidated = FALSE; |
| 204 | } |
| 205 | |
| 206 | SPainter duiDC; |
| 207 | BeforePaint(pRT,duiDC); |
| 208 | |
| 209 | |
| 210 | int iFirst = m_iFirstVisible; |
| 211 | if(iFirst!=-1) |
| 212 | { |
| 213 | CRect rcClient; |
| 214 | GetClientRect(&rcClient); |
| 215 | pRT->PushClipRect(&rcClient,RGN_AND); |
| 216 | |
| 217 | CRect rcClip,rcInter; |
| 218 | pRT->GetClipBox(&rcClip); |
| 219 | |
| 220 | int nOffset = m_lvItemLocator->Item2Position(iFirst)-m_siVer.nPos; |
| 221 | |
| 222 | CRect rcItem(rcClient); |
| 223 | rcItem.bottom = rcItem.top + nOffset; |
| 224 | |
| 225 | SPOSITION pos= m_lstItems.GetHeadPosition(); |
| 226 | int i=0; |
| 227 | for(;pos;i++) |
| 228 | { |
| 229 | ItemInfo ii = m_lstItems.GetNext(pos); |
| 230 | rcItem.top=rcItem.bottom; |
| 231 | rcItem.bottom = rcItem.top + m_lvItemLocator->GetItemHeight(iFirst+i); |
| 232 | rcInter.IntersectRect(&rcClip,&rcItem); |
| 233 | if(!rcInter.IsRectEmpty()) |
| 234 | ii.pItem->Draw(pRT,rcItem); |
| 235 | rcItem.top = rcItem.bottom; |
| 236 | rcItem.bottom += m_lvItemLocator->GetDividerSize(); |
| 237 | if(m_pSkinDivider) |
| 238 | {//绘制分隔线 |
| 239 | m_pSkinDivider->Draw(pRT,rcItem,0); |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | pRT->PopClip(); |
| 244 | } |
| 245 | AfterPaint(pRT,duiDC); |
| 246 | } |
| 247 | |
| 248 | BOOL SListView::OnScroll(BOOL bVertical,UINT uCode,int nPos) |
| 249 | { |
nothing calls this directly
no test coverage detected