MCPcopy Create free account
hub / github.com/SOUI2/soui / OnPaint

Method OnPaint

SOUI/src/control/STreeView.cpp:468–505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 13

GetClientRectFunction · 0.85
GetHeadPositionMethod · 0.80
GetItemIndentMethod · 0.80
OffsetRectMethod · 0.80
IsRectEmptyMethod · 0.80
PushClipRectMethod · 0.45
GetClipBoxMethod · 0.45
GetNextMethod · 0.45
Item2PositionMethod · 0.45
GetItemWidthMethod · 0.45
GetItemHeightMethod · 0.45
DrawMethod · 0.45

Tested by

no test coverage detected