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

Method GetItemRect

SOUI/src/control/SListCtrl.cpp:425–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

423
424
425CRect SListCtrl::GetItemRect(int nItem, int nSubItem)
426{
427 if (!(nItem>=0 && nItem<GetItemCount() && nSubItem>=0 && nSubItem<GetColumnCount()))
428 return CRect();
429
430 CRect rcItem;
431 rcItem.top = m_nItemHeight*nItem;
432 rcItem.bottom = rcItem.top+m_nItemHeight;
433 rcItem.left = 0;
434 rcItem.right = 0;
435
436 for (int nCol = 0; nCol < GetColumnCount(); nCol++)
437 {
438 SHDITEM hdi;
439 hdi.mask = SHDI_WIDTH|SHDI_ORDER;
440
441 m_pHeader->GetItem(nCol, &hdi);
442 rcItem.left = rcItem.right;
443 rcItem.right = rcItem.left+hdi.cx.toPixelSize(GetScale());
444 if (hdi.iOrder == nSubItem)
445 break;
446 }
447
448 CRect rcList = GetListRect();
449 // 变换到窗口坐标
450 rcItem.OffsetRect(rcList.TopLeft());
451 // 根据原点坐标修正
452 rcItem.OffsetRect(-m_ptOrigin);
453
454 return rcItem;
455}
456
457//////////////////////////////////////////////////////////////////////////
458// 自动修改pt的位置为相对当前项的偏移量

Callers 15

HitTestMethod · 0.45
OnMouseEventMethod · 0.45
OnMouseWheelMethod · 0.45
OnSetCursorMethod · 0.45
HitTestMethod · 0.45
OnMouseEventMethod · 0.45
OnMouseWheelMethod · 0.45
OnSetCursorMethod · 0.45
OnPaintMethod · 0.45
UpdateVisibleItemsMethod · 0.45
CalcItemDrawRectMethod · 0.45
HitTestMethod · 0.45

Calls 6

CRectClass · 0.85
toPixelSizeMethod · 0.80
OffsetRectMethod · 0.80
GetItemCountFunction · 0.50
GetScaleFunction · 0.50
GetItemMethod · 0.45

Tested by

no test coverage detected