]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/sample-form_demo.adb
ncurses 6.0 - patch 20160130
[ncurses.git] / Ada95 / samples / sample-form_demo.adb
index 621892672e3bddbd8b960deae0eb71732fe02dc3..ed84526feae2c057dd96ac6357cb833f34d0e266 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-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            --
 -- sale, use or other dealings in this Software without prior written       --
 -- authorization.                                                           --
 ------------------------------------------------------------------------------
---  Author: Juergen Pfeifer <Juergen.Pfeifer@T-Online.de> 1996
+--  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.5 $
---  Binding Version 00.93
+--  $Revision: 1.16 $
+--  $Date: 2011/03/23 00:44:12 $
+--  Binding Version 01.00
 ------------------------------------------------------------------------------
-with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
-with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
-
 with Terminal_Interface.Curses; use Terminal_Interface.Curses;
-with Terminal_Interface.Curses.Panels; use Terminal_Interface.Curses.Panels;
 with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
 with Terminal_Interface.Curses.Forms.Field_User_Data;
-with Terminal_Interface.Curses.Forms.Form_User_Data;
-with Sample.Keyboard_Handler; use Sample.Keyboard_Handler;
 with Sample.My_Field_Type; use Sample.My_Field_Type;
-with Sample.Manifest; use Sample.Manifest;
 with Sample.Explanation; use Sample.Explanation;
 with Sample.Form_Demo.Aux; use Sample.Form_Demo.Aux;
 with Sample.Function_Key_Setting; use Sample.Function_Key_Setting;
@@ -72,10 +66,6 @@ package body Sample.Form_Demo is
      Terminal_Interface.Curses.Forms.Field_User_Data (User_Data,
                                                       User_Access);
 
-   package Frm_U is new
-     Terminal_Interface.Curses.Forms.Form_User_Data (User_Data,
-                                                     User_Access);
-
    type Weekday is (Sunday, Monday, Tuesday, Wednesday, Thursday,
                     Friday, Saturday);
 
@@ -88,7 +78,7 @@ package body Sample.Form_Demo is
    procedure Demo
    is
 
-      Mft : My_Data := (Ch => 'X');
+      Mft : constant My_Data := (Ch => 'X');
 
       FA : Field_Array_Access := new Field_Array'
         (Make (0, 14, "Sample Entry Form"),
@@ -118,16 +108,16 @@ package body Sample.Form_Demo is
       Notepad ("FORM-PAD00");
       Default_Labels;
 
-      Set_Field_Type (FA (6), Enum_Field);
-      Set_Field_Type (FA (7), I_F);
-      Set_Field_Type (FA (8), Mft);
+      Set_Field_Type (FA.all (6), Enum_Field);
+      Set_Field_Type (FA.all (7), I_F);
+      Set_Field_Type (FA.all (8), Mft);
 
       F1 := new User_Data'(Data => 4711);
-      Fld_U.Set_User_Data (FA (1), F1);
+      Fld_U.Set_User_Data (FA.all (1), F1);
 
       Fh.Drive_Me (Frm);
 
-      Fld_U.Get_User_Data (FA (1), F2);
+      Fld_U.Get_User_Data (FA.all (1), F2);
       pragma Assert (F1 = F2);
       pragma Assert (F1.Data = F2.Data);