+void Entry::slider_value_changed(double value)
+{
+ if(text.get_n_lines()>visible_rows)
+ first_row = text.get_n_lines()-visible_rows-static_cast<unsigned>(value);
+}
+
+void Entry::check_view_range()
+{
+ if(!multiline || !text_part)
+ return;
+
+ const GL::Font *font = style->get_font();
+ float font_size = font->get_default_size();
+ unsigned line_spacing = static_cast<unsigned>(font_size*6/5);
+
+ const Sides &margin = text_part->get_margin();
+ visible_rows = (geom.h-margin.top-margin.bottom)/line_spacing;
+
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+
+ if(first_row>row)
+ first_row = row;
+ else if(row>=first_row+visible_rows)
+ first_row = row+1-visible_rows;
+
+ if(slider)
+ {
+ unsigned scroll = max(text.get_n_lines(), visible_rows)-visible_rows;
+ slider->set_range(0, scroll);
+ slider->set_value(scroll-first_row);