| 170 | } |
| 171 | |
| 172 | void CComboWnd::EnsureVisible(int iIndex) |
| 173 | { |
| 174 | if( m_pOwner->GetCurSel() < 0 ) return; |
| 175 | m_pLayout->FindSelectable(m_pOwner->GetCurSel(), false); |
| 176 | RECT rcItem = m_pLayout->GetItemAt(iIndex)->GetPos(); |
| 177 | RECT rcList = m_pLayout->GetPos(); |
| 178 | CScrollBarUI* pHorizontalScrollBar = m_pLayout->GetHorizontalScrollBar(); |
| 179 | if( pHorizontalScrollBar && pHorizontalScrollBar->IsVisible() ) rcList.bottom -= pHorizontalScrollBar->GetFixedHeight(); |
| 180 | int iPos = m_pLayout->GetScrollPos().cy; |
| 181 | if( rcItem.top >= rcList.top && rcItem.bottom < rcList.bottom ) return; |
| 182 | int dx = 0; |
| 183 | if( rcItem.top < rcList.top ) dx = rcItem.top - rcList.top; |
| 184 | if( rcItem.bottom > rcList.bottom ) dx = rcItem.bottom - rcList.bottom; |
| 185 | Scroll(0, dx); |
| 186 | } |
| 187 | |
| 188 | void CComboWnd::Scroll(int dx, int dy) |
| 189 | { |
nothing calls this directly
no test coverage detected