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

Method Item2Position

SOUI/src/control/STreeView.cpp:314–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312 }
313
314 int STreeViewItemLocator::Item2Position(HTREEITEM hItem) const
315 {
316 if(!_IsItemVisible(hItem))
317 {
318 SASSERT(FALSE);
319 return -1;
320 }
321
322 int nRet = 0;
323 //获得父节点开始位置
324 HTREEITEM hParent = m_adapter->GetParentItem(hItem);
325 if(hParent!=ITvAdapter::ITEM_NULL && hParent != ITvAdapter::ITEM_ROOT)
326 {
327 nRet = Item2Position(hParent);
328 //越过父节点
329 nRet += GetItemHeight(hParent);
330 }
331 //越过前面兄弟结点
332 nRet += _GetItemOffset(hItem);
333
334 return nRet;
335 }
336
337 int STreeViewItemLocator::GetScrollLineSize() const
338 {

Callers 14

OnPaintMethod · 0.45
UpdateVisibleItemsMethod · 0.45
OnItemGetRectMethod · 0.45
EnsureVisibleMethod · 0.45
UpdateVisibleItemsMethod · 0.45
_OnItemGetRectMethod · 0.45
EnsureVisibleMethod · 0.45
OnPaintMethod · 0.45
UpdateVisibleItemsMethod · 0.45
CalcItemDrawRectMethod · 0.45
OnPaintMethod · 0.45
EnsureVisibleMethod · 0.45

Calls 2

GetItemHeightFunction · 0.85
GetParentItemMethod · 0.45

Tested by

no test coverage detected