]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/ncurses2-menu_test.adb
ncurses 5.8 - patch 20110326
[ncurses.git] / Ada95 / samples / ncurses2-menu_test.adb
index 0b96315e1c04cbf8a2db48a91bb2c0f5a54b956c..bce9782372a40f391e20eedf4f795af5de808dc2 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 2000 Free Software Foundation, Inc.                        --
+-- Copyright (c) 2000-2006,2011 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            --
 --                                                                          --
 -- 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
 ------------------------------------------------------------------------------
 --  Author: Eugene V. Melaragno <aldomel@ix.netcom.com> 2000
 --  Version Control
---  $Revision: 1.1 $
+--  $Revision: 1.8 $
+--  $Date: 2011/03/23 00:39:28 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with ncurses2.util; use ncurses2.util;
@@ -45,10 +46,10 @@ with Terminal_Interface.Curses.Menus; use Terminal_Interface.Curses.Menus;
 with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
 
 procedure ncurses2.menu_test is
 with Terminal_Interface.Curses.Mouse; use Terminal_Interface.Curses.Mouse;
 
 procedure ncurses2.menu_test is
-   function menu_virtualize (c : Key_Code) return Menu_Request_Code;
+   function menu_virtualize (c : Key_Code) return Key_Code;
    procedure xAdd (l : Line_Position; c : Column_Position; s : String);
 
    procedure xAdd (l : Line_Position; c : Column_Position; s : String);
 
-   function menu_virtualize (c : Key_Code) return Menu_Request_Code is
+   function menu_virtualize (c : Key_Code) return Key_Code is
    begin
       case c is
          when Character'Pos (newl) | Key_Exit =>
    begin
       case c is
          when Character'Pos (newl) | Key_Exit =>
@@ -89,9 +90,11 @@ procedure ncurses2.menu_test is
       new String'("Platypi"),
       new String'("Lemurs"));
 
       new String'("Platypi"),
       new String'("Lemurs"));
 
-   items_a : Item_Array_Access := new Item_Array (1 .. animals'Last + 1);
+   items_a : constant Item_Array_Access :=
+      new Item_Array (1 .. animals'Last + 1);
 
    tmp : Event_Mask;
 
    tmp : Event_Mask;
+
    procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
    begin
       Add (Line => l, Column => c, Str => s);
    procedure xAdd (l : Line_Position; c : Column_Position; s : String) is
    begin
       Add (Line => l, Column => c, Str => s);
@@ -107,7 +110,7 @@ procedure ncurses2.menu_test is
    c1 : Key_Code;
 
    c : Driver_Result;
    c1 : Key_Code;
 
    c : Driver_Result;
-   r : Menu_Request_Code;
+   r : Key_Code;
 begin
    tmp := Start_Mouse;
    xAdd (0, 0, "This is the menu test:");
 begin
    tmp := Start_Mouse;
    xAdd (0, 0, "This is the menu test:");
@@ -118,9 +121,9 @@ begin
    Refresh;
 
    for i in animals'Range loop
    Refresh;
 
    for i in animals'Range loop
-      items_a (i) := New_Item (animals (i).all);
+      items_a.all (i) := New_Item (animals (i).all);
    end loop;
    end loop;
-   items_a (animals'Last + 1) := Null_Item;
+   items_a.all (animals'Last + 1) := Null_Item;
 
    m := New_Menu (items_a);
 
 
    m := New_Menu (items_a);
 
@@ -161,5 +164,5 @@ begin
 
    Delete (m);
 
 
    Delete (m);
 
-   tmp := Start_Mouse (No_Events);
+   End_Mouse (tmp);
 end ncurses2.menu_test;
 end ncurses2.menu_test;