indexing description: "[ Multiline textarea ]" date: "$Date$" revision: "$Revision$" class EM_TEXTAREA inherit EM_TEXTBOX redefine delegate_factory, handle_key_down end create make_empty, make_from_text feature {NONE} -- Initialisation delegate_factory: FUNCTION [ANY, TUPLE [], like delegate] is -- Factory to create default delegate do Result := theme_delegates.textarea_delegate_factory end feature {NONE} -- Keyboard management handle_key_down (event: EM_KEYBOARD_EVENT) is -- Handle key down event. local inserted_character: CHARACTER do if is_unicode_enabled then if event.unicode_character.code > 0 then if event.key /= event.sdlk_backspace and event.key /= event.sdlk_delete and event.key /= event.sdlk_return and event.key /= event.sdlk_tab then inserted_character := event.unicode_character end end else if event.is_shift_pressed then inserted_character := event.character.as_upper else inserted_character := event.character end end if inserted_character.code > 0 then insert_character_at_cursor (inserted_character) elseif event.key = event.sdlk_return then insert_character_at_cursor ('%N') elseif event.key = event.sdlk_backspace and cursor_position > 0 then delete_character_left_of_cursor elseif event.key = event.sdlk_delete and cursor_position < text.count then delete_character_right_of_cursor elseif event.key = event.sdlk_left and cursor_position > 0 then move_cursor_left elseif event.key = event.sdlk_right and cursor_position < text.count then move_cursor_right elseif event.key = event.sdlk_home then set_cursor_position (0) elseif event.key = event.sdlk_end then set_cursor_position (text.count) end set_changed ensure then changed: is_changed end end