+ if(part.get_name()=="slider" && multiline)
+ slider->render(renderer);
+}
+
+void Entry::touch_press(int x, int y, unsigned finger)
+{
+ if(finger==0)
+ set_focus();
+ Widget::touch_press(x, y, finger);
+}
+
+bool Entry::key_press(unsigned key, unsigned mod)
+{
+ got_key_press = true;
+ if(key==Input::KEY_BACKSPACE)
+ {
+ if(selection_active)
+ erase_selection(true);
+ else if(edit_pos>0)
+ {
+ unsigned start_pos = text.move_offset(edit_pos, -1);
+ erase(start_pos, edit_pos-start_pos);
+ }
+ }
+ else if(key==Input::KEY_DELETE)
+ {
+ if(selection_active)
+ erase_selection(true);
+ else
+ {
+ unsigned end_pos = text.move_offset(edit_pos, 1);
+ erase(edit_pos, end_pos-edit_pos);
+ }
+ }
+ else if(key==Input::KEY_ENTER && multiline)
+ insert(edit_pos, "\n");
+ else if(key==Input::KEY_END)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row, text.get_line_length(row)), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_HOME)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row, 0), mod==MOD_SHIFT);
+ }
+ else if(key==Input::KEY_LEFT && mod==MOD_SHIFT)
+ move_edit_position(NAV_LEFT, true);
+ else if(key==Input::KEY_RIGHT && mod==MOD_SHIFT)
+ move_edit_position(NAV_RIGHT, true);
+ else if(key==Input::KEY_UP && mod==MOD_SHIFT && multiline)
+ move_edit_position(NAV_UP, true);
+ else if(key==Input::KEY_DOWN && mod==MOD_SHIFT && multiline)
+ move_edit_position(NAV_DOWN, true);
+ else
+ return false;
+
+ return true;
+}
+
+bool Entry::character(wchar_t ch)
+{
+ if(got_key_press && ch>=' ' && ch!=0x7F)
+ {
+ if(selection_active)
+ erase_selection(false);
+ insert(edit_pos, StringCodec::encode<StringCodec::Utf8>(StringCodec::ustring(1, ch)));
+ return true;
+ }
+
+ return false;
+}
+
+void Entry::focus_in()
+{
+ cursor_blink = true;
+ Widget::focus_in();
+ check_cursor_blink();
+}
+
+void Entry::focus_out()
+{
+ Widget::focus_out();
+ got_key_press = false;
+ check_cursor_blink();
+}
+
+bool Entry::navigate(Navigation nav)
+{
+ if(nav==NAV_LEFT || nav==NAV_RIGHT || ((nav==NAV_DOWN || nav==NAV_UP) && multiline))
+ move_edit_position(nav, false);
+ else if(nav==NAV_ACCEPT && !signal_enter.empty())
+ signal_enter.emit();
+ else
+ return false;
+
+ return true;
+}
+
+void Entry::animate(const Time::TimeDelta &)
+{
+ cursor_blink = !cursor_blink;
+ rebuild();
+}
+
+void Entry::on_geometry_change()
+{
+ if(multiline)
+ check_view_range();
+}
+
+void Entry::on_style_change()
+{
+ text.set_style(style);
+
+ if(!style)
+ {
+ text_part = 0;
+ return;
+ }
+
+ text_part = style->get_part("text");
+
+ if(multiline)
+ check_view_range();
+
+ check_cursor_blink();
+}
+
+void Entry::move_edit_position(Navigation nav, bool select)
+{
+ if(nav==NAV_LEFT)
+ set_edit_position(text.move_offset(edit_pos, -1), select);
+ else if(nav==NAV_RIGHT)
+ set_edit_position(text.move_offset(edit_pos, 1), select);
+ else if(nav==NAV_DOWN)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position(text.coords_to_offset(row+1, col), select);
+ }
+ else if(nav==NAV_UP)
+ {
+ unsigned row, col;
+ text.offset_to_coords(edit_pos, row, col);
+ set_edit_position((row>0 ? text.coords_to_offset(row-1, col) : 0), select);
+ }
+ else
+ throw invalid_argument("Entry::move_edit_position");
+}
+
+void Entry::set_edit_position(unsigned ep, bool select)
+{
+ if(select && !selection_active)
+ selection_pos = edit_pos;
+ selection_active = select;
+
+ unsigned old_edit_pos = edit_pos;
+ edit_pos = min(ep, text.size());
+
+ if(edit_pos!=old_edit_pos)
+ signal_edit_position_changed.emit(edit_pos);
+
+ if(multiline)
+ check_view_range();
+ rebuild();
+}
+
+void Entry::erase_selection(bool emit_change)
+{
+ unsigned start, end;
+ if(!get_selection(start, end))
+ return;
+
+ text.erase(start, end-start);
+ if(emit_change)
+ signal_text_changed.emit(text.get());
+ set_edit_position(start, false);
+}
+
+void Entry::check_cursor_blink()
+{
+ cursor_blink = (state&FOCUS);
+ if((state&FOCUS) && style)