-- B O D Y --
-- --
------------------------------------------------------------------------------
--- Copyright (c) 2000 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 --
------------------------------------------------------------------------------
-- Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
-- Version Control
--- $Revision: 1.1 $
+-- $Revision: 1.9 $
+-- $Date: 2009/12/26 17:38:58 $
-- Binding Version 01.00
------------------------------------------------------------------------------
-- Windows and scrolling tester.
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
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
when Curses_Exception => return False;
end HaveScroll;
-
procedure newwin_legend (curpw : Window) is
package p is new genericPuts (200);
);
buf : Bounded_String;
- do_keypad : Boolean := HaveKeyPad (curpw);
- do_scroll : Boolean := HaveScroll (curpw);
+ do_keypad : constant Boolean := HaveKeyPad (curpw);
+ do_scroll : constant Boolean := HaveScroll (curpw);
pos : Natural;
Clear_To_End_Of_Line;
end newwin_legend;
-
procedure transient (curpw : Window; msg : String) is
begin
newwin_legend (curpw);
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;
res : pair;
i : Line_Position := 0;
j : Column_Position := 0;
- si : Line_Position := lri - uli + 1;
- sj : Column_Position := lrj - ulj + 1;
+ si : constant Line_Position := lri - uli + 1;
+ sj : constant Column_Position := lrj - ulj + 1;
begin
res.y := uli;
res.x := ulj;
end loop;
end selectcell;
-
function getwindow return Window is
rwindow : Window;
ul, lr : pair;
return rwindow;
end getwindow;
-
procedure newwin_move (win : Window;
dy : Line_Position;
dx : Column_Position) is
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
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)'
Allow_Scrolling (Mode => True);
- End_Mouse;
+ End_Mouse (Mask2);
Set_Raw_Mode (SwitchOn => True);
Erase;
End_Windows;