X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsample-keyboard_handler.adb;h=fdac054d29841e1cd78a460b278ddea7544b7c0a;hp=062a676ba0eef1bb23a511a7b254df6990a3e862;hb=f36e772702d4b512a4395e2db96470803485b6df;hpb=0eb88fc5281804773e2a0c7a488a4452463535ce diff --git a/Ada95/samples/sample-keyboard_handler.adb b/Ada95/samples/sample-keyboard_handler.adb index 062a676b..fdac054d 100644 --- a/Ada95/samples/sample-keyboard_handler.adb +++ b/Ada95/samples/sample-keyboard_handler.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 -- @@ -33,9 +33,10 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.7 $ +-- $Revision: 1.14 $ +-- $Date: 2006/06/25 14:30:22 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Strings; use Ada.Strings; @@ -69,7 +70,6 @@ package body Sample.Keyboard_Handler is function Command return Real_Key_Code; - function Command return Real_Key_Code is function My_Driver (F : Form; @@ -95,6 +95,9 @@ package body Sample.Keyboard_Handler is is Ch : Character; begin + if P = Null_Panel then + raise Panel_Exception; + end if; if C in User_Key_Code'Range and then C = QUIT then if Driver (F, F_Validate_Field) = Form_Ok then K := Key_None; @@ -102,7 +105,7 @@ package body Sample.Keyboard_Handler is end if; elsif C in Normal_Key_Code'Range then Ch := Character'Val (C); - if (Ch = LF or else Ch = CR) then + if Ch = LF or else Ch = CR then if Driver (F, F_Validate_Field) = Form_Ok then declare Buffer : String (1 .. Positive (Columns - 11));