!Last Modified: 5-FEB-1989 15:17:46.46, By: FLEMING procedure eve_windows_module_init eve$x_largest_width := 65535; ! value taken from EVE V1.0 endprocedure; procedure eag_show_window ( needed_lines ) ! Adjusts map window if needed. ! This procedure checks, and if necessary, creates/adjusts/deletes the ! map window so as to display the specified number of map_window lines. ! If the argument is 0, the map window will go away. If a size change ! is needed, this routine adjusts the size of the lower EVE window and ! the EVE main window to compensate for the size of the map_window, keeping ! track of the buffers kept in the EVE windows as well. LOCAL save_window, ! Temporary storage for current window buffer_var, ! Temporary storage for buffer variable adjustment; ! Needed adjustment to map window save_window := current_window; adjustment := eag_map_window_size - needed_lines; if (needed_lines) = 0 then ! Get rid of map window if (get_info (eag_map_window, "type") = window ) then unmap ( eag_map_window ); delete ( eag_map_window ); save_window := eve$x_this_window; endif; endif; if adjustment <> 0 then ! we must adjust the size of the mapping window SET (SCREEN_UPDATE, OFF); ! For speed and to avoid confusion if adjustment > 0 then ! Window is too big if (needed_lines) <> 0 then ! Window exists adjust_window ( eag_map_window, adjustment, 0); endif; endif; if eve$x_number_of_windows = 1 then position (eve$main_window); adjust_window ( eve$main_window, 0, adjustment); eve_two_windows; adjust_window ( eve$bottom_window, 0, adjustment); eve_one_window; else position (eve$bottom_window); buffer_var := current_buffer; adjust_window ( eve$bottom_window, 0, adjustment); position (eve$top_window); eve_one_window; adjust_window ( eve$main_window, 0, adjustment); eve_two_windows; position (eve$bottom_window); eve_buffer ( GET_INFO( buffer_var, "NAME" ) ); endif; if adjustment < 0 then ! window is too small (might not exist) if (get_info (eag_map_window, "type") = window ) then adjust_window ( eag_map_window, adjustment, 0); else eag_map_window := create_window ( ((screen_length - needed_lines) - 1), needed_lines, off); map (eag_map_window, eag_map_buffer); endif; endif; SET (SCREEN_UPDATE, ON); endif; position ( beginning_of ( eag_map_buffer)); eag_map_window_size := needed_lines; position (save_window); ENDPROCEDURE ! procedure eve_toggle_number_of_windows ! Toggle 1/2 windows, show map SET (SCREEN_UPDATE, OFF); ! For speed and to avoid confusion if eve$x_number_of_windows = 1 then eve_two_windows; else eve_one_window; endif; ! if eag_map_lock = 1 then ! eag_show_map; ! endif; SET (SCREEN_UPDATE, ON); ! For speed and to avoid confusion endprocedure ! Set width for all windows ! ! Parameters: ! ! set_parameter ! Number of columns per line - input ! modified to toggle between windows on , also do not allow >132 width ! 11/4/86 procedure eve_set_width (set_parameter) local new_width, ! Local copy of set parameter loop_window, ! Window currently being checked in loop current_left_margin, current_width, prompt, last_buffer, loop_buffer, last_window; ! Last VAXTPU window if not (eve$prompt_number (set_parameter, new_width, "Set width to: ", " ")) then current_width:=get_info(current_window,'WIDTH'); if current_width < 80 then new_width := 80; else if current_width = 80 then new_width := 132; else new_width := 80; endif; endif; endif; if (new_width <= 0) or (new_width > 132) then message (fao ("Cannot set width to !SL", new_width)); return; else if new_width > eve$x_largest_width then new_width := eve$x_largest_width; endif; endif; last_buffer := get_info(buffers,eve$kt_last); loop_buffer := get_info(buffers,eve$kt_first); loop if (new_width > 80) then set (margins,loop_buffer,1,132); else set (margins,loop_buffer,1,80); endif; exitif loop_buffer = last_buffer; loop_buffer := get_info(buffers,"next"); endloop; last_window := get_info (windows, eve$kt_last); loop_window := get_info (windows, eve$kt_first); loop set (width, loop_window, new_width); exitif loop_window = last_window; loop_window := get_info (windows, "next"); endloop; message(" "); ! without this, next message never appears on screen--bug message (fao ("Width set to !SL", new_width)); endprocedure ! Modification of procedure found in eve$windows.tpu procedure eve$display_choices ! Prepare choices for display (message_to_display, command_name) local last_reply, ! Last reply of prompt string last_command, ! Command invoked by a key saved_window, saved_mark; on_error [TPU$_CONTROLC]: eve$$restore_position (saved_window, saved_mark); eve$learn_abort; abort; [OTHERWISE]: eve$$restore_position (saved_window, saved_mark); endon_error; saved_window := current_window; saved_mark := mark (FREE_CURSOR); eve$message (message_to_display); ! If no default buffer exists, then we're most likely executing ! an ambiguous command from a /COMMAND file. Just abort. if get_info (eve$default_buffer, "type") <> BUFFER then eve$learn_abort; return (FALSE); endif; position (end_of (eve$choice_buffer)); eve$format_choices; eve$$x_ambiguous_parse := 1; position (beginning_of (eve$choice_buffer)); last_reply := ""; if eve$$x_prompt_flag then position (end_of (eve$recall_line_buffer)); if mark (NONE) <> beginning_of (eve$recall_line_buffer) then move_vertical (-1); last_reply := " " + current_line; endif; eve$$x_prompt_flag := 0; endif; if eve$$x_command_line_flag then ! Command has been written in command buffer ! And EVE$PROCESS_COMMAND will map CHOICE_WINDOWS if last_reply <> "" then position (end_of (eve$command_buffer)); move_horizontal (-1); erase_line; copy_text (eve$x_command_prompt + eve$x_do_line + last_reply); endif; else ! Not a command if eve$$x_help_active = 0 ! Let HELP handle ambiguous topics. then ! Otherwise, we need a command name. ! A key was defined to a command, and either the command or one of its ! arguments is ambiguous eve$map_choices; if command_name <> "" then ! the EVE command finding the ambiguity last_command := command_name; last_reply := ""; else ! the last key's definition = ambiguous last_command := eve$$lookup_comment (last_key, eve$x_key_map_list); translate (last_command, " ", "_"); ! probably no args here endif; !!!!!!!!!!!!!!!!!!!!!!!!! MOD !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! If the last command was a get file then put the user in the choice buffer ! so that s/he can run eve_get_file after positioning over a file if (last_command = "eve_get_file") then !increment window count and store so user can get around eve$x_number_of_windows := eve$x_number_of_windows + 1; eve$$x_windows {eve$x_number_of_windows} := eve$choice_window; update(current_window); else position (saved_window);! so pre_command_window is set correctly eve$$enter_command_window; ! by eve$$enter_c_w copy_text (last_command + last_reply); eve$$set_command_line; endif; endif; endif; endprocedure; eve_windows_module_init;