| 33 | } |
| 34 | |
| 35 | void ListView::ScrollToItem(int index) |
| 36 | { |
| 37 | double itemHeight = 20.0; |
| 38 | double y = itemHeight * index; |
| 39 | if (y < scrollbar->GetPosition()) |
| 40 | { |
| 41 | scrollbar->SetPosition(y); |
| 42 | } |
| 43 | else if (y + itemHeight > scrollbar->GetPosition() + GetHeight()) |
| 44 | { |
| 45 | scrollbar->SetPosition(std::max(y + itemHeight - GetHeight(), 0.0)); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | void ListView::OnScrollbarScroll() |
| 50 | { |
no test coverage detected