indexing description: "Objects that represent an EV_TITLED_WINDOW.% %The original version of this class was generated by EiffelBuild." date: "$Date$" revision: "$Revision$" class SEARCH_CONTROL inherit SEARCH_CONTROL_IMP SHARED_OBJECTS undefine copy, is_equal, default_create end create make feature {NONE} -- Initialization make is -- do default_create end user_initialization is -- called by `initialize'. -- Any custom user initialization that -- could not be performed in `initialize', -- (due to regeneration of implementation class) -- can be added here. do search_button.select_actions.extend (agent search_panel_text) search_text.key_press_actions.extend (agent key_pressed) end feature {NONE} -- Implementation panel: SELECTABLE_TEXT_PANEL is -- Panel do Result := shared_document_manager.current_editor end search_panel_text is -- local l_pos, l_line: INTEGER l_text: SELECTABLE_TEXT l_panel: like panel do l_panel := panel if l_panel /= Void and not l_panel.text.is_empty and then not search_text.text.is_empty then l_text := l_panel.text_displayed l_text.search_string_from_cursor (search_text.text) if l_text.successful_search then -- Highlight found text l_pos := l_text.found_string_total_character_position l_line := l_text.found_string_line l_panel.set_first_line_displayed (l_line, True) l_panel.select_region (l_pos, l_pos + search_text.text.count) end end end key_pressed (a_key: EV_KEY) is -- Key pressed event do if a_key.code = (create {EV_KEY_CONSTANTS}).key_enter then search_panel_text end end end -- class SEARCH_CONTROL