+
+ if(items.empty())
+ max_scroll = 0;
+ else
+ max_scroll = last_to_first_row(rows.size()-1);
+
+ if(first_row>max_scroll)
+ first_row = max_scroll;
+
+ slider.set_range(0, max_scroll);
+ slider.set_page_size(rows.size()-max_scroll);
+ slider.set_value(max_scroll-first_row);
+}
+
+void List::scroll_to_focus()
+{
+ if(focus_index<0 || items[focus_index]->is_visible())
+ return;
+
+ unsigned focus_row = item_index_to_row(static_cast<unsigned>(focus_index));
+ if(focus_row<first_row)
+ slider.set_value(max_scroll-focus_row);
+ else
+ slider.set_value(max_scroll-last_to_first_row(focus_row));
+}
+
+void List::slider_value_changed(double value)
+{
+ if(max_scroll>0 && !ignore_slider_change)
+ {
+ first_row = max_scroll-static_cast<unsigned>(value);
+ mark_rebuild();