]> ncurses.scripts.mit.edu Git - ncurses.git/blob - doc/html/ada/terminal_interface-curses-forms-field_types-user-choice__ads.htm
ncurses 6.0
[ncurses.git] / doc / html / ada / terminal_interface-curses-forms-field_types-user-choice__ads.htm
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
2 <HTML>
3 <HEAD>
4 <TITLE>terminal_interface-curses-forms-field_types-user-choice.ads</TITLE>
5 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6 <style type="text/css">
7 *.comment {
8         color: green;
9 }
10 *.symbol {
11         color: red;
12 }
13 </style>
14 </HEAD>
15 <BODY>
16 <HR><DIV style="text-align:center"><H1> File : terminal_interface-curses-forms-field_types-user-choice.ads </H1></DIV><HR>
17 <PRE>
18 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
19 <span class="comment"><EM>--                                                                          --</EM></span>
20 <span class="comment"><EM>--                           <A HREF="http://www.gnat.com">GNAT</A> ncurses Binding                           --</EM></span>
21 <span class="comment"><EM>--                                                                          --</EM></span>
22 <span class="comment"><EM>--           Terminal_Interface.Curses.Forms.Field_Types.User.Choice        --</EM></span>
23 <span class="comment"><EM>--                                                                          --</EM></span>
24 <span class="comment"><EM>--                                 S P E C                                  --</EM></span>
25 <span class="comment"><EM>--                                                                          --</EM></span>
26 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
27 <span class="comment"><EM>-- Copyright (c) 1998-2008,2011 Free Software Foundation, Inc.              --</EM></span>
28 <span class="comment"><EM>--                                                                          --</EM></span>
29 <span class="comment"><EM>-- Permission is hereby granted, free of charge, to any person obtaining a  --</EM></span>
30 <span class="comment"><EM>-- copy of this software and associated documentation files (the            --</EM></span>
31 <span class="comment"><EM>-- "Software"), to deal in the Software without restriction, including      --</EM></span>
32 <span class="comment"><EM>-- without limitation the rights to use, copy, modify, merge, publish,      --</EM></span>
33 <span class="comment"><EM>-- distribute, distribute with modifications, sublicense, and/or sell       --</EM></span>
34 <span class="comment"><EM>-- copies of the Software, and to permit persons to whom the Software is    --</EM></span>
35 <span class="comment"><EM>-- furnished to do so, subject to the following conditions:                 --</EM></span>
36 <span class="comment"><EM>--                                                                          --</EM></span>
37 <span class="comment"><EM>-- The above copyright notice and this permission notice shall be included  --</EM></span>
38 <span class="comment"><EM>-- in all copies or substantial portions of the Software.                   --</EM></span>
39 <span class="comment"><EM>--                                                                          --</EM></span>
40 <span class="comment"><EM>-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  --</EM></span>
41 <span class="comment"><EM>-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               --</EM></span>
42 <span class="comment"><EM>-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   --</EM></span>
43 <span class="comment"><EM>-- IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   --</EM></span>
44 <span class="comment"><EM>-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    --</EM></span>
45 <span class="comment"><EM>-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    --</EM></span>
46 <span class="comment"><EM>-- THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               --</EM></span>
47 <span class="comment"><EM>--                                                                          --</EM></span>
48 <span class="comment"><EM>-- Except as contained in this notice, the name(s) of the above copyright   --</EM></span>
49 <span class="comment"><EM>-- holders shall not be used in advertising or otherwise to promote the     --</EM></span>
50 <span class="comment"><EM>-- sale, use or other dealings in this Software without prior written       --</EM></span>
51 <span class="comment"><EM>-- authorization.                                                           --</EM></span>
52 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
53 <span class="comment"><EM>--  Author:  Juergen Pfeifer, 1996</EM></span>
54 <span class="comment"><EM>--  Version Control:</EM></span>
55 <span class="comment"><EM>--  @Revision: 1.14 @</EM></span>
56 <span class="comment"><EM>--  @Date: 2011/03/19 12:27:47 @</EM></span>
57 <span class="comment"><EM>--  Binding Version 01.00</EM></span>
58 <span class="comment"><EM>------------------------------------------------------------------------------</EM></span>
59 <b>with</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C;
60
61 <b>package</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_47_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_45_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_44_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>.<span class="symbol"><A NAME="ref_44_58" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_45_63">Choice</A></span> <b>is</b>
62    <b>pragma</b> Preelaborate
63      (<A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_47_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_45_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_44_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>.<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_44_58">Choice</A>);
64
65    <b>subtype</b> <span class="symbol"><A NAME="ref_48_12">C_Int</A></span> <b>is</b> <A HREF="interfac__ads.htm#ref_36_9">Interfaces</A>.C.int;
66
67    <b>type</b> <span class="symbol"><A NAME="ref_50_9">User_Defined_Field_Type_With_Choice</A></span> <b>is</b> <b>abstract</b> <b>new</b>
68      <A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_48_9">User_Defined_Field_Type</A> <b>with</b> <b>null</b> <b>record</b>;
69    <span class="comment"><EM>--  This is the root of the mechanism we use to create field types in</EM></span>
70    <span class="comment"><EM>--  Ada95 that allow the prev/next mechanism. You should your own type</EM></span>
71    <span class="comment"><EM>--  derive from this one and implement the Field_Check, Character_Check</EM></span>
72    <span class="comment"><EM>--  Next and Previous functions for your own type.</EM></span>
73
74    <b>type</b> <span class="symbol"><A NAME="ref_57_9">User_Defined_Field_Type_With_Choice_Access</A></span> <b>is</b> <b>access</b> <b>all</b>
75      <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_50_9">User_Defined_Field_Type_With_Choice</A>'Class;
76
77    <b>function</b> <span class="symbol"><A NAME="ref_60_13">Next</A></span>
78      (<span class="symbol"><A NAME="ref_61_7" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_60_13">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_51_9">Field</A>;
79       <span class="symbol"><A NAME="ref_62_7" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_60_13">Typ</A></span> : <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_50_9">User_Defined_Field_Type_With_Choice</A>) <b>return</b> Boolean
80       <b>is</b> <b>abstract</b>;
81    <span class="comment"><EM>--  If True is returned, the function successfully generated a next</EM></span>
82    <span class="comment"><EM>--  value into the fields buffer.</EM></span>
83
84    <b>function</b> <span class="symbol"><A NAME="ref_67_13">Previous</A></span>
85      (<span class="symbol"><A NAME="ref_68_7" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_67_13">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_51_9">Field</A>;
86       <span class="symbol"><A NAME="ref_69_7" HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_67_13">Typ</A></span> : <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_50_9">User_Defined_Field_Type_With_Choice</A>) <b>return</b> Boolean
87       <b>is</b> <b>abstract</b>;
88    <span class="comment"><EM>--  If True is returned, the function successfully generated a previous</EM></span>
89    <span class="comment"><EM>--  value into the fields buffer.</EM></span>
90
91    <span class="comment"><EM>--  +----------------------------------------------------------------------</EM></span>
92    <span class="comment"><EM>--  | Private Part.</EM></span>
93    <span class="comment"><EM>--  |</EM></span>
94 <b>private</b>
95    <b>function</b> <span class="symbol"><A NAME="ref_78_13" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_76_13">C_Generic_Choice</A></span> <b>return</b> <A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_133_9">C_Field_Type</A>;
96
97    <b>function</b> <span class="symbol"><A NAME="ref_80_13" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_50_13">Generic_Next</A></span> (<span class="symbol"><A NAME="ref_80_27" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_50_27">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_51_9">Field</A>;
98                           <span class="symbol"><A NAME="ref_81_27" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_51_27">Usr</A></span> : System.Address) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2098_9">Curses_Bool</A>;
99    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_80_13">Generic_Next</A>);
100    <span class="comment"><EM>--  This is the generic next Choice_Function for the low-level fieldtype</EM></span>
101    <span class="comment"><EM>--  representing all the User_Defined_Field_Type derivatives. It routes</EM></span>
102    <span class="comment"><EM>--  the call to the Next implementation for the type.</EM></span>
103
104    <b>function</b> <span class="symbol"><A NAME="ref_87_13" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_62_13">Generic_Prev</A></span> (<span class="symbol"><A NAME="ref_87_27" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_62_27">Fld</A></span> : <A HREF="terminal_interface-curses-forms__ads.htm#ref_51_9">Field</A>;
105                           <span class="symbol"><A NAME="ref_88_27" HREF="terminal_interface-curses-forms-field_types-user-choice__adb.htm#ref_63_27">Usr</A></span> : System.Address) <b>return</b> <A HREF="terminal_interface-curses__ads.htm#ref_2098_9">Curses_Bool</A>;
106    <b>pragma</b> Convention (C, <A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_87_13">Generic_Prev</A>);
107    <span class="comment"><EM>--  This is the generic prev Choice_Function for the low-level fieldtype</EM></span>
108    <span class="comment"><EM>--  representing all the User_Defined_Field_Type derivatives. It routes</EM></span>
109    <span class="comment"><EM>--  the call to the Previous implementation for the type.</EM></span>
110
111 <b>end</b> <A HREF="terminal_interface__ads.htm#ref_42_9">Terminal_Interface</A>.<A HREF="terminal_interface-curses__ads.htm#ref_47_28">Curses</A>.<A HREF="terminal_interface-curses-forms__ads.htm#ref_45_35">Forms</A>.<A HREF="terminal_interface-curses-forms-field_types__ads.htm#ref_44_41">Field_Types</A>.<A HREF="terminal_interface-curses-forms-field_types-user__ads.htm#ref_44_53">User</A>.<A HREF="terminal_interface-curses-forms-field_types-user-choice__ads.htm#ref_44_58">Choice</A>;
112 </PRE></BODY></HTML>