X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Fsamples%2Fsample-form_demo-aux.adb;h=072b1871a8d340ca72ecbcacce90f95bbeaff045;hp=c7874df35ba8e86c842f700556421c875fcd886b;hb=e8c3445229c546ba14ea2992da4d93a9d31914f8;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01;ds=sidebyside diff --git a/Ada95/samples/sample-form_demo-aux.adb b/Ada95/samples/sample-form_demo-aux.adb index c7874df3..072b1871 100644 --- a/Ada95/samples/sample-form_demo-aux.adb +++ b/Ada95/samples/sample-form_demo-aux.adb @@ -7,7 +7,8 @@ -- B O D Y -- -- -- ------------------------------------------------------------------------------ --- Copyright (c) 1998 Free Software Foundation, Inc. -- +-- Copyright 2020 Thomas E. Dickey -- +-- Copyright 1998-2004,2009 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 -- @@ -34,9 +35,9 @@ -- authorization. -- ------------------------------------------------------------------------------ -- Author: Juergen Pfeifer, 1996 --- Contact: http://www.familiepfeifer.de/Contact.aspx?Lang=en -- Version Control --- $Revision: 1.12 $ +-- $Revision: 1.18 $ +-- $Date: 2020/02/02 23:34:34 $ -- Binding Version 01.00 ------------------------------------------------------------------------------ with Ada.Characters.Latin_1; use Ada.Characters.Latin_1; @@ -48,7 +49,7 @@ with Sample.Explanation; use Sample.Explanation; package body Sample.Form_Demo.Aux is - procedure Geometry (F : in Form; + procedure Geometry (F : Form; L : out Line_Count; -- Lines used for menu C : out Column_Count; -- Columns used for menu Y : out Line_Position; -- Proposed Line for menu @@ -105,7 +106,7 @@ package body Sample.Form_Demo.Aux is return Pan; end Create; - procedure Destroy (F : in Form; + procedure Destroy (F : Form; P : in out Panel) is W, S : Window; @@ -199,7 +200,7 @@ package body Sample.Form_Demo.Aux is Text : String) return Field is Fld : Field; - C : Column_Count := Column_Count (Text'Length); + C : constant Column_Count := Column_Count (Text'Length); begin Fld := New_Field (1, C, Top, Left); Set_Buffer (Fld, 0, Text); @@ -216,7 +217,7 @@ package body Sample.Form_Demo.Aux is Left : Column_Position; Off_Screen : Natural := 0) return Field is - Fld : Field := New_Field (Height, Width, Top, Left, Off_Screen); + Fld : constant Field := New_Field (Height, Width, Top, Left, Off_Screen); begin if Has_Colors then Set_Foreground (Fld => Fld, Color => Form_Fore_Color); @@ -232,6 +233,9 @@ package body Sample.Form_Demo.Aux is P : Panel) return Boolean is begin + if P = Null_Panel then + raise Panel_Exception; + end if; if K in User_Key_Code'Range and then K = QUIT then if Driver (F, F_Validate_Field) = Form_Ok then return True;