X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsample.adb;h=648036f74a0bc017a477e28660984ec114942885;hp=ce0cc3a18717fd4cf1e0e35b6f14ab748b315c7b;hb=7a6bbc8cf41c5186d46accc3d08622dc86526b34;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/Ada95/samples/sample.adb b/Ada95/samples/sample.adb index ce0cc3a1..648036f7 100644 --- a/Ada95/samples/sample.adb +++ b/Ada95/samples/sample.adb @@ -7,7 +7,7 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright (c) 1998,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,14 +33,14 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------ --- Author: Juergen Pfeifer 1996 +-- Author: Juergen Pfeifer, 1996 -- Version Control --- $Revision: 1.8 $ --- Binding Version 00.93 +-- $Revision: 1.17 $ +-- $Date: 2008/09/27 14:42:40 $ +-- Binding Version 01.00 ------------------------------------------------------------------------------ with Text_IO; -with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; with Ada.Exceptions; use Ada.Exceptions; with Terminal_Interface.Curses; use Terminal_Interface.Curses; @@ -50,7 +50,6 @@ with Terminal_Interface.Curses.Menus.Menu_User_Data; with Terminal_Interface.Curses.Menus.Item_User_Data; with Sample.Manifest; use Sample.Manifest; -with Sample.Helpers; use Sample.Helpers; with Sample.Function_Key_Setting; use Sample.Function_Key_Setting; with Sample.Keyboard_Handler; use Sample.Keyboard_Handler; with Sample.Header_Handler; use Sample.Header_Handler; @@ -112,7 +111,7 @@ package body Sample is if K = QUIT then return True; elsif K = SELECT_ITEM then - if Idx in 1 .. 4 then + if Idx <= 4 then Hide (Pan); Update_Panels; end if; @@ -123,7 +122,7 @@ package body Sample is when 4 => Sample.Text_IO_Demo.Demo; when others => null; end case; - if Idx in 1 .. 4 then + if Idx <= 4 then Top (Pan); Show (Pan); Update_Panels; @@ -192,12 +191,12 @@ package body Sample is Set_Soft_Label_Key_Attributes (Color => Header_Color); -- This propagates the attributes to the label window - Clear_Soft_Label_Keys; Restore_Soft_Label_Keys; + Refresh_Soft_Label_Keys; end if; Init_Keyboard_Handler; - Set_Echo_Mode (FALSE); + Set_Echo_Mode (False); Set_Raw_Mode; Set_Meta_Mode; Set_KeyPad_Mode; @@ -206,6 +205,7 @@ package body Sample is -- We have some fixed key throughout this sample Main_Menu; End_Windows; + Curses_Free_All; exception when Event : others =>