]> ncurses.scripts.mit.edu Git - ncurses.git/blob - Ada95/html/terminal_interface-curses-forms-field_types-user-choice_s.html
ncurses 4.2
[ncurses.git] / Ada95 / html / terminal_interface-curses-forms-field_types-user-choice_s.html
1 <HTML>
2 <HEAD>
3 <TITLE></TITLE>
4 </HEAD>
5 <BODY BGCOLOR="#99ccbb" TEXT="#000000" LINK="#4060b0" VLINK="#000080" ALINK="#ff4040">
6 <PRE>
7 <I>------------------------------------------------------------------------------</I>
8 <I>--                                                                          --</I>
9 <I>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</I>
10 <I>--                                                                          --</I>
11 <I>--           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --</I>
12 <I>--                                                                          --</I>
13 <I>--                                 S P E C                                  --</I>
14 <I>--                                                                          --</I>
15 <I>------------------------------------------------------------------------------</I>
16 <I>-- Copyright (c) 1998 Free Software Foundation, Inc.                        --</I>
17 <I>--                                                                          --</I>
18 <I>-- Permission is hereby granted, free of charge, to any person obtaining a  --</I>
19 <I>-- copy of this software and associated documentation files (the            --</I>
20 <I>-- "Software"), to deal in the Software without restriction, including      --</I>
21 <I>-- without limitation the rights to use, copy, modify, merge, publish,      --</I>
22 <I>-- distribute, distribute with modifications, sublicense, and/or sell       --</I>
23 <I>-- copies of the Software, and to permit persons to whom the Software is    --</I>
24 <I>-- furnished to do so, subject to the following conditions:                 --</I>
25 <I>--                                                                          --</I>
26 <I>-- The above copyright notice and this permission notice shall be included  --</I>
27 <I>-- in all copies or substantial portions of the Software.                   --</I>
28 <I>--                                                                          --</I>
29 <I>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</I>
30 <I>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</I>
31 <I>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</I>
32 <I>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</I>
33 <I>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</I>
34 <I>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</I>
35 <I>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</I>
36 <I>--                                                                          --</I>
37 <I>-- Except as contained in this notice, the name(s) of the above copyright   --</I>
38 <I>-- holders shall not be used in advertising or otherwise to promote the     --</I>
39 <I>-- sale, use or other dealings in this Software without prior written       --</I>
40 <I>-- authorization.                                                           --</I>
41 <I>------------------------------------------------------------------------------</I>
42 <I>--  <A HREF="http://home.t-online.de/home/Juergen.Pfeifer">J&uuml;rgen Pfeifer</A>, Email: <A HREF="mailto:Juergen.Pfeifer@T-Online.de">Juergen.Pfeifer@T-Online.de</A>                      --</I>
43 <I>--  Version Control:</I>
44 <I>--  @Revision: 1.1 @</I>
45 <I>------------------------------------------------------------------------------</I>
46 <B>with</B> Ada.Unchecked_Deallocation;
47 <B>with</B> Terminal_Interface.Curses.<A HREF="terminal_interface-curses-aux_s.html#32:35">Aux</A>;
48
49 <B>package</B> Terminal_Interface.Curses.Forms.Field_Types.User.Choice <B>is</B>
50
51    type User_Defined_Field_Type_With_Choice <B>is</B> <B>abstract</B> <B>new</B>
52      User_Defined_Field_Type <B>with</B> <B>null</B> <B>record</B>;
53    <I>--  This is the root of the mechanism we use to create field types in</I>
54    <I>--  Ada95 that allow the prev/next mechanism. You should your own type</I>
55    <I>--  derive from this one and implement the Field_Check, Character_Check</I>
56    <I>--  Next and Previous functions for your own type.</I>
57
58    type User_Defined_Field_Type_With_Choice_Access <B>is</B> <B>access</B> <B>all</B>
59      User_Defined_Field_Type_With_Choice'Class;
60
61    <B>function</B> Next
62      (Fld : Field;
63       Typ : User_Defined_Field_Type_With_Choice) <B>return</B> Boolean
64       <B>is</B> <B>abstract</B>;
65    <I>--  If True is returned, the function successfully generated a next</I>
66    <I>--  value into the fields buffer.</I>
67
68    <B>function</B> Previous
69      (Fld : Field;
70       Typ : User_Defined_Field_Type_With_Choice) <B>return</B> Boolean
71       <B>is</B> <B>abstract</B>;
72    <I>--  If True is returned, the function successfully generated a previous</I>
73    <I>--  value into the fields buffer.</I>
74
75    <I>--  +----------------------------------------------------------------------</I>
76    <I>--  | Private Part.</I>
77    <I>--  |</I>
78 <B>private</B>
79    <B>use</B> type Interfaces.C.Int;
80
81    <B>function</B> Generic_Next (Fld : Field;
82                           Usr : System.Address) <B>return</B> <A HREF="terminal_interface-curses-aux_s.html#36:12">C_Int</A>;
83    <B>pragma</B> Convention (C, Generic_Next);
84    <I>--  This is the generic next Choice_Function for the low-level fieldtype</I>
85    <I>--  representing all the User_Defined_Field_Type derivates. It routes</I>
86    <I>--  the call to the Next implementation for the type.</I>
87
88    <B>function</B> Generic_Prev (Fld : Field;
89                           Usr : System.Address) <B>return</B> <A HREF="terminal_interface-curses-aux_s.html#36:12">C_Int</A>;
90    <B>pragma</B> Convention (C, Generic_Prev);
91    <I>--  This is the generic prev Choice_Function for the low-level fieldtype</I>
92    <I>--  representing all the User_Defined_Field_Type derivates. It routes</I>
93    <I>--  the call to the Previous implementation for the type.</I>
94
95 <B>end</B> Terminal_Interface.Curses.Forms.Field_Types.User.Choice;
96
97 </PRE>
98
99 <P><HR><P>
100 <P>
101 This is BETA software. The interface is subject to change without notice.<P>
102 <!-- Do NOT delete my name or the tool name from below; -->
103 <!-- giving me credit is a condition of use of ada2html -->
104 <P><I>This hypertext format was generated by <A HREF="http://www.adahome.com/Tutorials/Lovelace/dwheeler.htm">David A. Wheeler</A>'s <A HREF="http://www.adahome.com/Resources/Tools/ada2html/ada2html.htm">ada2html</A></I>
105 </BODY>
106 </HTML>
107