X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsample-my_field_type.adb;h=dbdd88ab1c846a0ae3b7269efb607e6cd3602b44;hp=f2f1b112ba24d6aba98c3cc3df5864a13d6d443e;hb=e8c3445229c546ba14ea2992da4d93a9d31914f8;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/Ada95/samples/sample-my_field_type.adb b/Ada95/samples/sample-my_field_type.adb index f2f1b112..dbdd88ab 100644 --- a/Ada95/samples/sample-my_field_type.adb +++ b/Ada95/samples/sample-my_field_type.adb @@ -7,7 +7,8 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright 2020 Thomas E. Dickey -- +-- Copyright 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 -- @@ -33,23 +34,26 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.5 $ --- Binding Version 00.93 +-- $Revision: 1.17 $ +-- $Date: 2020/02/02 23:34:34 $ +-- 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;