| 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 | { |
no test coverage detected