- if(text.get_n_lines()>visible_rows)
- first_row = text.get_n_lines()-visible_rows-static_cast<unsigned>(value);
+ if(select && !selection_active)
+ selection_pos = edit_pos;
+ selection_active = select;
+
+ edit_pos = min(ep, text.size());
+ if(multiline)
+ check_view_range();
+ rebuild();
+}
+
+void Entry::erase_selection()
+{
+ if(!selection_active)
+ return;
+
+ unsigned start = selection_pos;
+ unsigned end = edit_pos;
+ if(start>end)
+ swap(start, end);
+
+ text.erase(start, end-start);
+ set_edit_position(start, false);
+}
+
+void Entry::check_cursor_blink()
+{
+ cursor_blink = (state&FOCUS);
+ if((state&FOCUS) && style)
+ {
+ const Part *cursor_part = style->get_part("cursor");
+ if(cursor_part && cursor_part->get_graphic(ACTIVE|FOCUS)!=cursor_part->get_graphic(NORMAL|FOCUS))
+ {
+ set_animation_interval(Time::sec/2);
+ return;
+ }
+ }
+
+ stop_animation();