]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/samples/sample-form_demo-aux.adb
ncurses 6.1 - patch 20191221
[ncurses.git] / Ada95 / samples / sample-form_demo-aux.adb
index 06a03b885f1968273c2996f80b3925395c8b1da2..a3b044dcc3eba5111b2c67b87a9992d128503a64 100644 (file)
@@ -7,7 +7,7 @@
 --                                 B O D Y                                  --
 --                                                                          --
 ------------------------------------------------------------------------------
--- Copyright (c) 1998 Free Software Foundation, Inc.                        --
+-- Copyright (c) 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            --
 -- sale, use or other dealings in this Software without prior written       --
 -- authorization.                                                           --
 ------------------------------------------------------------------------------
---  Author: Juergen Pfeifer <juergen.pfeifer@gmx.net> 1996
+--  Author:  Juergen Pfeifer, 1996
 --  Version Control
---  $Revision: 1.11 $
+--  $Revision: 1.17 $
+--  $Date: 2009/12/26 17:38:58 $
 --  Binding Version 01.00
 ------------------------------------------------------------------------------
 with Ada.Characters.Latin_1; use Ada.Characters.Latin_1;
@@ -47,7 +48,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
@@ -104,7 +105,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;
@@ -198,7 +199,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);
@@ -215,7 +216,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);
@@ -231,6 +232,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;