! ! SCROLL FORWARD ONE SCREEN PROCEDURE eve_next_screen fred$move_by_screen (1); ENDPROCEDURE; ! ! Scroll back one screen PROCEDURE eve_previous_screen fred$move_by_screen (-1); ENDPROCEDURE; ! ! ! ***** FRED$MOVE_BY_SCREEN ***** ! ! Procedure to move by screen - used by eve_next_screen and eve_previous_screen ! Positive numbers move forward (like next screen), negative numbers backward ! Returns false if an error is encountered; otherwise returns true. ! ! FRED Version: Reduced amount of scrolling to provide overlap ! between scrolls. ! ! Parameters: ! ! how_many_screens Number of screens to move - input ! PROCEDURE fred$move_by_screen (how_many_screens) LOCAL how_much_scroll, ! How many lines to scroll scroll_window, ! Window to be scrolled this_window, ! Current window this_column, ! Current column in scroll_window this_row, ! Current row in scroll_window old_scroll_top, ! Original value of scroll_top old_scroll_bottom, ! Original value of scroll_bottom old_scroll_amount; ! Original value of scroll_amount ! Trap and ignore messages about move beyond buffer boundaries - ! just move to top or bottom line of buffer on_error fred$move_by_screen := 0; ! and continue endon_error; fred$move_by_screen := 1; this_window := CURRENT_WINDOW; if this_window = eve$command_window then if eve$x_ambiguous_parse then scroll_window := eve$choice_window; else scroll_window := eve$x_pre_command_window; endif; POSITION (scroll_window); else scroll_window := this_window; endif; how_much_scroll := GET_INFO (scroll_window, eve$kt_visible_length); if GET_INFO (scroll_window, "status_line") <> eve$kt_null then how_much_scroll := how_much_scroll - 5; else how_much_scroll := how_much_scroll - 4; endif; if how_much_scroll <= 0 then how_much_scroll := 1; endif; ! By using a scrolling region and move_vertical, we can move to the first or ! last line on the screen when on the first or last screen in the buffer. Also ! is much faster for scrolling a select range than using the scroll builtin. this_row := GET_INFO (scroll_window, eve$kt_current_row); if this_row = 0 then ! Screen info not all updated yet this_row := GET_INFO (scroll_window, eve$kt_visible_top); endif; this_column := GET_INFO (scroll_window, "current_column"); POSITION (search (line_begin, reverse)); if GET_INFO (scroll_window, eve$kt_beyond_eol) then UPDATE (scroll_window); endif; old_scroll_top := GET_INFO (scroll_window, "scroll_top"); old_scroll_bottom := GET_INFO (scroll_window, "scroll_bottom"); old_scroll_amount := GET_INFO (scroll_window, "scroll_amount"); SET (scrolling, scroll_window, on, this_row - GET_INFO (scroll_window, eve$kt_visible_top), GET_INFO (scroll_window, "visible_bottom") - this_row, 0); MOVE_VERTICAL (how_many_screens * how_much_scroll); UPDATE (scroll_window); CURSOR_HORIZONTAL (this_column - GET_INFO (scroll_window, "current_column")); if this_window <> current_window then POSITION (this_window); endif; SET (scrolling, scroll_window, on, old_scroll_top, old_scroll_bottom, old_scroll_amount); ENDPROCEDURE;