1 ------------------------------------------------------------------------------
3 -- GNAT ncurses Binding Samples --
5 -- Sample.My_Field_Type --
11 -- The ncurses Ada95 binding is copyrighted 1996 by --
12 -- Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de --
14 -- Permission is hereby granted to reproduce and distribute this --
15 -- binding by any means and for any fee, whether alone or as part --
16 -- of a larger distribution, in source or in binary form, PROVIDED --
17 -- this notice is included with any such distribution, and is not --
18 -- removed from any of its header files. Mention of ncurses and the --
19 -- author of this binding in any applications linked with it is --
20 -- highly appreciated. --
22 -- This binding comes AS IS with no warranty, implied or expressed. --
23 ------------------------------------------------------------------------------
26 ------------------------------------------------------------------------------
27 with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
28 with Terminal_Interface.Curses.Forms.Field_Types;
30 -- This is a very simple user defined field type. It accepts only a
31 -- defined character as input into the field.
33 package Sample.My_Field_Type is
35 type My_Data is new Ada_Defined_Field_Type with
39 type My_Access is access My_Data;
43 function F_Check (Fld : Field; Info : My_Access) return Boolean;
44 function C_Check (Ch : Character; Info : My_Access) return Boolean;
46 package One_Character_Only is new
47 Terminal_Interface.Curses.Forms.Field_Types
48 (My_Data, My_Access, F_Check, C_Check);
50 end Sample.My_Field_Type;