]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/samples/sample-form_demo-aux.ads
ncurses 4.1
[ncurses.git] / Ada95 / samples / sample-form_demo-aux.ads
1 ------------------------------------------------------------------------------
2 --                                                                          --
3 --                       GNAT ncurses Binding Samples                       --
4 --                                                                          --
5 --                            Sample.Form_Demo.Aux                          --
6 --                                                                          --
7 --                                 S P E C                                  --
8 --                                                                          --
9 --  Version 00.92                                                           --
10 --                                                                          --
11 --  The ncurses Ada95 binding is copyrighted 1996 by                        --
12 --  Juergen Pfeifer, Email: Juergen.Pfeifer@T-Online.de                     --
13 --                                                                          --
14 --  Permission is hereby granted to reproduce and distribute this           --
15 --  binding by any means and for any fee, whether alone or as part          --
16 --  of a larger distribution, in source or in binary form, PROVIDED         --
17 --  this notice is included with any such distribution, and is not          --
18 --  removed from any of its header files. Mention of ncurses and the        --
19 --  author of this binding in any applications linked with it is            --
20 --  highly appreciated.                                                     --
21 --                                                                          --
22 --  This binding comes AS IS with no warranty, implied or expressed.        --
23 ------------------------------------------------------------------------------
24 --  Version Control
25 --  $Revision: 1.2 $
26 ------------------------------------------------------------------------------
27 with Terminal_Interface.Curses; use  Terminal_Interface.Curses;
28 with Terminal_Interface.Curses.Panels; use  Terminal_Interface.Curses.Panels;
29 with Terminal_Interface.Curses.Forms;  use  Terminal_Interface.Curses.Forms;
30
31 package Sample.Form_Demo.Aux is
32
33    procedure Geometry (F  : in  Form;
34                        L  : out Line_Count;
35                        C  : out Column_Count;
36                        Y  : out Line_Position;
37                        X  : out Column_Position);
38    --  Calculate the geometry for a panel beeing able to be used to display
39    --  the menu.
40
41    function Create (F     : Form;
42                     Title : String;
43                     Lin   : Line_Position;
44                     Col   : Column_Position) return Panel;
45    --  Create a panel decorated with a frame and the title at the specified
46    --  position. The dimension of the panel is derived from the menus layout.
47
48    procedure Destroy (F : in Form;
49                       P : in out Panel);
50    --  Destroy all the windowing structures associated with this menu and
51    --  panel.
52
53    function Get_Request (F           : Form;
54                          P           : Panel;
55                          Handle_CRLF : Boolean := True) return Key_Code;
56    --  Centralized request driver for all menus in this sample. This
57    --  gives us a common key binding for all menus.
58
59    function Make (Top         : Line_Position;
60                   Left        : Column_Position;
61                   Text        : String) return Field;
62    --  create a label
63
64    function Make  (Height      : Line_Count := 1;
65                    Width       : Column_Count;
66                    Top         : Line_Position;
67                    Left        : Column_Position;
68                    Off_Screen  : Natural := 0) return Field;
69    --  create a editable field
70
71    function Default_Driver (F : Form;
72                             K : Key_Code;
73                             P : Panel) return Boolean;
74
75    function Count_Active (F : Form) return Natural;
76    --  Count the number of active fields in the form
77
78 end Sample.Form_Demo.Aux;