]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/ncurses2-acs_and_scroll.adb
ncurses 5.6 - patch 20070210
[ncurses.git] / Ada95 / samples / ncurses2-acs_and_scroll.adb
index 65c2939a8597426b277f5675fcfc16892389a088..3ffba4462d111cd1b3ffc999786ac8bd58c65ad9 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000-2004,2006 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,7 +35,8 @@
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.7 $
+--  $Date: 2006/06/25 14:24:40 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 --  Windows and scrolling tester.
@@ -55,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
@@ -96,7 +95,6 @@ procedure ncurses2.acs_and_scroll is
 
    use Ada.Streams.Stream_IO;
 
-
    --  A linked list
    --  I  wish there was a standard library linked list. Oh well.
    type Frame is record
@@ -172,7 +170,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);
@@ -224,8 +221,8 @@ procedure ncurses2.acs_and_scroll is
          );
 
       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;
 
@@ -272,7 +269,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);
@@ -298,7 +294,6 @@ procedure ncurses2.acs_and_scroll is
       Clear_To_End_Of_Line;
    end transient;
 
-
    procedure newwin_report (win : Window := Standard_Window) is
       y : Line_Position;
       x : Column_Position;
@@ -331,8 +326,8 @@ procedure ncurses2.acs_and_scroll is
       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;
@@ -401,7 +396,6 @@ procedure ncurses2.acs_and_scroll is
       end loop;
    end selectcell;
 
-
    function getwindow return Window is
       rwindow : Window;
       ul, lr : pair;
@@ -441,7 +435,6 @@ procedure ncurses2.acs_and_scroll is
       return rwindow;
    end getwindow;
 
-
    procedure newwin_move (win : Window;
                           dy  : Line_Position;
                           dx  : Column_Position) is
@@ -499,8 +492,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
@@ -714,7 +708,7 @@ begin
 
    Allow_Scrolling (Mode => True);
 
-   End_Mouse;
+   End_Mouse (Mask2);
    Set_Raw_Mode (SwitchOn => True);
    Erase;
    End_Windows;