indexing description: "Objects that represent an EV_DIALOG.% %The original version of this class was generated by EiffelBuild." date: "$Date$" revision: "$Revision$" class EB_GOTO_DIALOG inherit EB_GOTO_DIALOG_IMP create make feature -- Creation make (a_text_panel: KEYBOARD_SELECTABLE_TEXT_PANEL) is -- Make with text panel require text_panel_not_void: a_text_panel /= Void do default_create editor := a_text_panel initialize_line_number_label_text ensure editor_set: editor = a_text_panel end feature {NONE} -- Initialization 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 close_request_actions.extend (agent destroy) cancel_button.select_actions.extend (agent destroy) set_default_cancel_button (cancel_button) go_button.select_actions.extend (agent goto_line) line_number_text.key_press_actions.extend (agent on_key_pressed) line_number_text.change_actions.extend (agent on_value_changed (?)) end initialize_line_number_label_text is -- Set line number label text local l_line_count: INTEGER do l_line_count := editor.number_of_lines if l_line_count > 0 then line_number_label.set_text ("Line number (1 - " + editor.number_of_lines.out + ")") line_number_text.value_range.resize_exactly (1, l_line_count) end end feature {NONE} -- Implementation editor: KEYBOARD_SELECTABLE_TEXT_PANEL -- Editor to search goto_line is -- Goto line local l_line: INTEGER do if line_number_text.text.is_integer then l_line := line_number_text.text.to_integer if l_line > editor.number_of_lines then l_line := editor.number_of_lines elseif l_line < 1 then l_line := 1 end editor.set_first_line_displayed (l_line.min (editor.vertical_scrollbar.value_range.upper), True) editor.text_displayed.cursor.set_y_in_lines (l_line) end end on_key_pressed (a_key: EV_KEY) is -- Key was pressed in line number text field box do if a_key.code = (create {EV_KEY_CONSTANTS}).key_enter and then line_number_text.text.is_integer then go_button.enable_sensitive goto_line end end on_value_changed (a_value: INTEGER) is -- Text field changed do if line_number_text.text.is_integer then go_button.enable_sensitive else go_button.disable_sensitive end end invariant has_editor: editor /= Void end -- class GOTO_DIALOG