X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;ds=sidebyside;f=Ada95%2Fsamples%2Fncurses2-acs_and_scroll.adb;h=5d965983b84e7a14b2c5674e7b1b6203791bb334;hb=6b43eaddcd1d9397fb3d51ce4c34f02472e93417;hp=66384cae080cf11539ce53e7a5dc5bbf3996a036;hpb=55ccd2b959766810cf7db8d1c4462f338ce0afc8;p=ncurses.git diff --git a/Ada95/samples/ncurses2-acs_and_scroll.adb b/Ada95/samples/ncurses2-acs_and_scroll.adb index 66384cae..5d965983 100644 --- a/Ada95/samples/ncurses2-acs_and_scroll.adb +++ b/Ada95/samples/ncurses2-acs_and_scroll.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 2000,2004 Free Software Foundation, Inc. -- +-- Copyright (c) 2000-2008,2009 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -35,8 +35,8 @@ ------------------------------------------------------------------------------ -- Author: Eugene V. Melaragno 2000 -- Version Control --- $Revision: 1.6 $ --- $Date: 2004/08/21 21:37:00 $ +-- $Revision: 1.9 $ +-- $Date: 2009/12/26 17:38:58 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -- Windows and scrolling tester. @@ -56,14 +56,12 @@ with Ada.Streams; use Ada.Streams; procedure ncurses2.acs_and_scroll is - Macro_Quit : constant Key_Code := Character'Pos ('Q') mod 16#20#; Macro_Escape : constant Key_Code := Character'Pos ('[') mod 16#20#; Quit : constant Key_Code := CTRL ('Q'); Escape : constant Key_Code := CTRL ('['); - Botlines : constant Line_Position := 4; type pair is record @@ -95,9 +93,6 @@ procedure ncurses2.acs_and_scroll is dx : Column_Position); function delete_framed (fp : FrameA; showit : Boolean) return FrameA; - use Ada.Streams.Stream_IO; - - -- A linked list -- I wish there was a standard library linked list. Oh well. type Frame is record @@ -173,7 +168,6 @@ procedure ncurses2.acs_and_scroll is when Curses_Exception => return False; end HaveScroll; - procedure newwin_legend (curpw : Window) is package p is new genericPuts (200); @@ -273,7 +267,6 @@ procedure ncurses2.acs_and_scroll is Clear_To_End_Of_Line; end newwin_legend; - procedure transient (curpw : Window; msg : String) is begin newwin_legend (curpw); @@ -290,16 +283,15 @@ procedure ncurses2.acs_and_scroll is else Add (Str => "All other"); end if; - Add (str => " characters are echoed, window should "); + Add (Str => " characters are echoed, window should "); if not HaveScroll (curpw) then Add (Str => "not "); end if; - Add (str => "scroll"); + Add (Str => "scroll"); Clear_To_End_Of_Line; end transient; - procedure newwin_report (win : Window := Standard_Window) is y : Line_Position; x : Column_Position; @@ -402,7 +394,6 @@ procedure ncurses2.acs_and_scroll is end loop; end selectcell; - function getwindow return Window is rwindow : Window; ul, lr : pair; @@ -442,7 +433,6 @@ procedure ncurses2.acs_and_scroll is return rwindow; end getwindow; - procedure newwin_move (win : Window; dy : Line_Position; dx : Column_Position) is @@ -500,8 +490,9 @@ begin case c is when Character'Pos ('c') mod 16#20# => -- Ctrl('c') declare - neww : FrameA := new Frame'(null, null, False, False, - Null_Window); + neww : constant FrameA := new Frame'(null, null, + False, False, + Null_Window); begin neww.wind := getwindow; if neww.wind = Null_Window then @@ -534,11 +525,11 @@ begin current := current.last; end if; when Character'Pos ('F') mod 16#20# => -- Ctrl('F') - if current /= null and HaveScroll (current.wind) then + if current /= null and then HaveScroll (current.wind) then Scroll (current.wind, 1); end if; when Character'Pos ('B') mod 16#20# => -- Ctrl('B') - if current /= null and HaveScroll (current.wind) then + if current /= null and then HaveScroll (current.wind) then -- The C version of Scroll may return ERR which is ignored -- we need to avoid the exception -- with the 'and HaveScroll(current.wind)'