X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsample-my_field_type.adb;h=74c5140675a4d424f9eccf4b7314e505d153479d;hp=cd289b91cbd6dd67d21956a67a889d5c6ade981a;hb=5242fccf157e715ed878455a3efea6c82b840eb5;hpb=a8987e73ec254703634802b4f7ee30d3a485524d diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb index cd289b91..74c51406 100644 --- a/Ada95/samples/sample-my_field_type.adb +++ b/Ada95/samples/sample-my_field_type.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-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,21 +35,25 @@ ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.9 $ +-- $Revision: 1.15 $ +-- $Date: 2006/06/25 14:30:22 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ -with Terminal_Interface.Curses.Forms; use Terminal_Interface.Curses.Forms; +with 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;