| 466 | } |
| 467 | |
| 468 | void STreeView::OnPaint( IRenderTarget * pRT ) |
| 469 | { |
| 470 | SPainter painter; |
| 471 | BeforePaint(pRT, painter); |
| 472 | |
| 473 | CRect rcClient; |
| 474 | GetClientRect(&rcClient); |
| 475 | pRT->PushClipRect(&rcClient, RGN_AND); |
| 476 | |
| 477 | CRect rcClip, rcInter; |
| 478 | pRT->GetClipBox(&rcClip); |
| 479 | |
| 480 | CPoint pt(0,-1); |
| 481 | for(SPOSITION pos = m_visible_items.GetHeadPosition();pos;) |
| 482 | { |
| 483 | ItemInfo ii = m_visible_items.GetNext(pos); |
| 484 | HTREEITEM hItem = (HTREEITEM)ii.pItem->GetItemIndex(); |
| 485 | if(pt.y == -1) |
| 486 | { |
| 487 | pt.y = m_tvItemLocator->Item2Position(hItem)-m_siVer.nPos; |
| 488 | } |
| 489 | CSize szItem(m_tvItemLocator->GetItemWidth(hItem),m_tvItemLocator->GetItemHeight(hItem)); |
| 490 | |
| 491 | pt.x = m_tvItemLocator->GetItemIndent(hItem) - m_siHoz.nPos; |
| 492 | |
| 493 | CRect rcItem(pt,szItem); |
| 494 | rcItem.OffsetRect(rcClient.TopLeft()); |
| 495 | if(!(rcItem & rcClip).IsRectEmpty()) |
| 496 | {//draw the item |
| 497 | ii.pItem->Draw(pRT,rcItem); |
| 498 | } |
| 499 | pt.y += m_tvItemLocator->GetItemHeight(hItem); |
| 500 | } |
| 501 | |
| 502 | pRT->PopClip(); |
| 503 | |
| 504 | AfterPaint(pRT, painter); |
| 505 | } |
| 506 | |
| 507 | void STreeView::OnSize( UINT nType, CSize size ) |
| 508 | { |
nothing calls this directly
no test coverage detected