]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/sample-my_field_type.adb
ncurses 5.9 - patch 20150404
[ncurses.git] / Ada95 / samples / sample-my_field_type.adb
index 11e422684e6afcbf1836df452a6726725a8daf79..e0d6f6732d12fa377bfeffb82c088695d665c55d 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 1998-2006,2008 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@gmx.net> 1996
+--  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.7 $
+--  $Revision: 1.16 $
+--  $Date: 2008/07/26 18:47:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
-with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms;
 
 --  This is a very simple user defined field type. It accepts only a
 --  defined character as input into the field.
 --
 package body Sample.My_Field_Type is
 
-   --  That's simple. There are no field validity checks.
+   --  That's simple. There are minimal field validity checks.
    function Field_Check (Fld : Field;
                          Typ : My_Data) return Boolean
    is
    begin
+      if Fld = Null_Field or Typ.Ch = Character'Val (0) then
+         return False;
+      end if;
       return True;
    end Field_Check;